Greetings, Monks.
I'm getting the following error from a
prepare_cached statement:
DBD::ODBC::db prepare_cached failed: (DBD: st_prepare/SQLAllocStmt err=-2)
Problem is that the statement IS correct (I've tested directly into the db).
Here's the piece of code:
$dbh = SysUtils::Connect;
if ($filial ne "0")
{
$sthg = $dbh->prepare_cached("SELECT DISTINCT login FROM usuar
+ios WHERE filial='$filial' AND auth=4 AND login<>'$filial'"); #this o
+ne works
$sthg->execute;
$xg = 0;
while (@rowf = $sthg->fetchrow_array())
{
$gerente[$xg] = $rowf[0];
$xg++;
}
$sthg->finish;
$cnt2= 0;
foreach $gerente (@gerente)
{
$nome_g = "";
$meta_g = "";
$ctp = 0;
if ($cnt2 == 0)
{
$sthn = $dbh->prepare_cached("SELECT DISTINCT nome FROM us
+uarios WHERE login='$gerente' AND filial='$filial'") or die "ERRO!";
+#HERE'S THE STATEMENT THAT IS GENERATING THE ERROR
$sthn->execute;
while (@rown = $sthn->fetchrow_array())
{
$nome_g = $rown[0];
$meta_g = $rown[1];
}
Does anybody ran into a similar error? Any ideas about what's going on?
The database is Access 2000 in a - obviously - Win32 enviroment - Windows 2000 Professional.
TIA,
my
($author_nickname, $author_email) = ("DaWolf","erabbott\@terra.com.br")
if ($author_name eq "Er
Galvão Abbott");
In reply to DBI bug?
by DaWolf
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.