Found the following in sqlite.h.in. This indicates to me that DBD-SQLite
isn't handling this "error" string correctly.

/*
** Return the error code for the most recent sqlite3_* API call
associated
** with sqlite3 handle 'db'. SQLITE_OK is returned if the most recent 
** API call was successful.
**
** Calls to many sqlite3_* functions set the error code and string
returned
** by sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16()
** (overwriting the previous values). Note that calls to
sqlite3_errcode(),
** sqlite3_errmsg() and sqlite3_errmsg16() themselves do not affect the
** results of future invocations.
**
** Assuming no other intervening sqlite3_* API calls are made, the error
** code returned by this function is associated with the same error as
** the strings  returned by sqlite3_errmsg() and sqlite3_errmsg16().
*/
int sqlite3_errcode(sqlite3 *db);

/*
** Return a pointer to a UTF-8 encoded string describing in english the
** error condition for the most recent sqlite3_* API call. The returned
** string is always terminated by an 0x00 byte.
**
** The string "not an error" is returned when the most recent API call
was
** successful.
*/
const char *sqlite3_errmsg(sqlite3*);

/*
** Return a pointer to a UTF-16 native byte order encoded string
describing
** in english the error condition for the most recent sqlite3_* API
call.
** The returned string is always terminated by a pair of 0x00 bytes.
**
** The string "not an error" is returned when the most recent API call
was
** successful.
*/
const void *sqlite3_errmsg16(sqlite3*); 

-----Original Message-----
From: Clark Christensen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 07, 2007 7:30 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] What does this mean???

Jim,

Line 398 in dbdimp.c appears to be in DBD-SQLite's $sth->execute code.

I agree with Puneet.  If you wrap your DBI calls in eval blocks and test
$@, you might get more info about the error (or maybe not).  Also,
setting RaiseError, and ShowErrorStatement in $dbh wouldn't hurt.

    $dbh = DBI->connect("dbi:SQLite:dbname=$dbname","","",
{RaiseError=>1, ShowErrorStatement=>1});
    $sql = "insert or replace into...";
    eval { $sth = $dbh->prepare( $sql ) };
    die $@ if ($@);
    eval { $sth->execute };
    die $@ if ($@);


Not sure if any of that helps at all.  "not an error" on $sth->execute
is bound to be nasty to diagnose.  FWIW, it looks like "not an error" is
the result of a call to sqlite3_errmsg().

Unrelated to your issue is a DBI presentation you may be interested to
look through at
http://search.cpan.org/src/TIMB/DBI_AdvancedTalk_2004/index.htm

 -Clark

----- Original Message ----
From: "Anderson, James H (IT)" <[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org
Sent: Wednesday, February 7, 2007 3:28:00 PM
Subject: RE: [sqlite] What does this mean???

Yes, I printed out the errstr. That was what I sent in the original
mail.

$sth = $dbh->prepare( $sql ) or die $dbh->errstr;
$sth->execute                or die $dbh->errstr;

which produced:

not an error(21) at dbdimp.c line 398

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of P
Kishor
Sent: Wednesday, February 07, 2007 6:16 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] What does this mean???

On 2/7/07, Anderson, James H (IT) <[EMAIL PROTECTED]>
wrote:
> Context :)
>
> insert or replace into TMP_credDerivOrig
> select
> A.date,
..
> A.CDRefId
>   from TMP_credDerivOrig   A,
>        C1_credDerivComment B
>  where A.CDId = B.CDId;


yes, but you want to know why an error is appearing, so you have to
show the code that is causing the error. The above is just the SQL
statement. How on earth can one decipher whether or not you have some
error in your code from that.

Did you print out the DBI err str? Did you wrap it in an eval and then
print out the reason it died? That would really help find the cause of
the error.

Else, you can always open up dbdimp.c and look at line 398. That
should set you in the right direction.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of P
> Kishor
> Sent: Wednesday, February 07, 2007 5:39 PM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] What does this mean???
>
> On 2/7/07, Anderson, James H (IT) <[EMAIL PROTECTED]>
> wrote:
> > not an error(21) at dbdimp.c line 398
> >
> > I'm using DBD::SQLite and got this error. What does it mean and how
> best
> > to hanle it?
> >
>
>
> well, how about some context? What is the structure of the table(s)
> you are querying, what is the query, the relevant code snippet,
> something to go on?
>
> The error string itself means that you did something via Perl that
> violated whatever it was at line 398 of the c program dbdimp.c.
>
> --
> Puneet Kishor http://punkish.eidesis.org/
> Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
> Open Source Geospatial Foundation http://www.osgeo.org/education/
> ---------------------------------------------------------------------
> collaborate, communicate, compete
> =====================================================================
>
>
------------------------------------------------------------------------
> -----
> To unsubscribe, send email to [EMAIL PROTECTED]
>
------------------------------------------------------------------------
> -----
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender
does not intend to waive confidentiality or privilege. Use of this email
is prohibited when received in error.
>


-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
Open Source Geospatial Foundation http://www.osgeo.org/education/
---------------------------------------------------------------------
collaborate, communicate, compete
=====================================================================

------------------------------------------------------------------------
-----
To unsubscribe, send email to [EMAIL PROTECTED]
------------------------------------------------------------------------
-----
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender
does not intend to waive confidentiality or privilege. Use of this email
is prohibited when received in error.

------------------------------------------------------------------------
-----
To unsubscribe, send email to [EMAIL PROTECTED]
------------------------------------------------------------------------
-----





------------------------------------------------------------------------
-----
To unsubscribe, send email to [EMAIL PROTECTED]
------------------------------------------------------------------------
-----
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender does not 
intend to waive confidentiality or privilege. Use of this email is prohibited 
when received in error.

Reply via email to