I would like to be more specific about the scenario I encountered. 
Suppose the following SQL statement is executed by calling sqlite3_exec:

SELECT mySqlFunction()

Inside the body of the mySqlFuntion() the following statements are executed
through calls to sqlite3_exec:

CREATE TEMP TABLE MyTempTable AS SELECT ...

Then a couple of

SELECT x, y FROM MyTempTable ...

And finally:

DROP TABLE MyTempTable

The last statement execution fails on Linux (Fedora Core 4) with the
following error "database table is locked" but not on Windows XP.
What would be a reason for that?

Thanks,

Iulian.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 14, 2006 5:14 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Recursive sqlite3_exec call

"Iulian Popescu" <[EMAIL PROTECTED]> wrote:
> Hello,
> 
>  
> 
> Is that possible to define a SQL function that calls sqlite3_exec on the
> same db handler through which was executed (passed to the function as user
> data)?
> 

Yes.  But a table being read cannot be written by the
recursive call.  So you cannot do an UPDATE on the same
row you are looking at.
--
D. Richard Hipp   <[EMAIL PROTECTED]>



Reply via email to