False alarm, 
After rereading my program code I found out that I had a "return" statement 
missing. 
After writing the array of commands to a file, there was an item, which was an 
empty SQL INSERT statement, added to the array of commands.
Sorry for the confusion.
/hex

-------------------------
Ursprungligt Meddelande:
Från: Mark Miesfeld <[email protected]>
Till: [email protected], Open Object Rexx Developer Mailing List 
<[email protected]>
Kopia: 
Datum: fredag, 15 juni 2012 01:26
Ämne: Re: [Oorexx-devel] ooSQLite usage
On Thu, Jun 14, 2012 at 1:11 PM, hakan <[email protected]> wrote:
> Found one strange thing
> The program creates an array of SQL insert statements, after parse of the 
> source file.
> This array is then used to do the actuall insert in the memory database (the 
> array is also saved to a file)
>
> memDB = .ooSQLiteConnection~new(":memory:")
> ....
> discDB = .ooSQLiteBackup~new(memDB, fileDB)
> ......
> do sql over mycmds
>   stmt = .ooSQLiteStmt~new(memDB, sql)
>   stmt~step
>   stmt~finalize
> end
> and then
> /* here we do the backup to disc */
>  ret = discdb~step(-1)
>  if ret == discDB~DONE then do
>    say 'Back up finished with no error:'  --discDB~lastErrCode 
> discDB~lastErrMsg
>  end
>  memDB~close
>
> What's happening is that one empty record is inserted in the database !
>
> creating an in memory database with ooSQlLite3 ( ooSQLite :memory:)
> and create table and then loading the table with .read mycmds.txt will not 
> create an empy row in memory database
>
> the last 2 record of input file (array) is
> INSERT INTO LIDS (lid, uid, empid, Name, privileges) VALUES('xxxxx', 
> yyyyyyyyyyy       ', '  zzzzz', 'name', privileges');             -- can't 
> show real values
> --empty line -- (just empty x'0D0A' )

Not sure I understand what is happening.  Does the empty line get passed into:

stmt = .ooSQLiteStmt~new(memDB, sql)


If you use the same file but load the records the way you first did,
not using an in-memory database, do you still get an empty record?

If you take the same file and chop it down to, say just the last 10
lines in file, do you still get the empty record?

--
Mark Miesfeld

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to