Source language: Translate to:

HPWSqLite odd behavour.....

Questions about NeoBook PlugIns

Moderator: Neosoft Support

HPWSqLite odd behavour.....

Postby David de Argentina » Sat Mar 10, 2007 12:13 pm

Hi all,

I need to update a blob field wihtin a SQLite database.table.
I created this script:

setvar "[base]" "[pubdir]MySQLiteDatabase.db"
setvar "[text]" "Some text"
Setvar "[SQL]" "update MyTable set MyBLOBField='[text]' where id=1"
hpwSQLiteCreate "hpwGrid2" "[base]" "[Result]"
hpwSQLiteQuery "hpwgrid2" "[base]" "[SQL]" "|" "[Result]"

When i execute this script, process works ok. no error.

When i browse the table, i check at MyBLOBField field, there is this Literal: "[text]" and not "Some Text"

At SqLite webpage i found:

'keyword' A keyword in single quotes is interpreted as a literal string if it occurs in a context where a string literal is allowed, otherwise it is understood as an identifier.

"keyword" A keyword in double-quotes is interpreted as an identifier if it matches a known identifier. Otherwise it is interpreted as a string literal.

[keyword] A keyword enclosed in square brackets is always understood as an identifier. This is not standard SQL. This quoting mechanism is used by MS Access and SQL Server and is included in SQLite for compatibility.

(extracted from http://www.sqlite.org/lang_keywords.html )

if i try to update other char fields i receive the same odd behavour

Any ideas?

Thanks in advance,
David de Argentina
User avatar
David de Argentina
 
Posts: 1562
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby HPW » Sat Mar 10, 2007 2:25 pm

When i adopt your sample into the demo-app:

Setvar "[text]" "Some text"
Setvar "[SQL]" "update Simpsons set FirstName='[text]' where ID=1"
hpwSQLiteQuery "RSqlConsole" "[PubDir][P1SqlDba]" "[SQL]" "|" "[hpwSQLiteResult]"


I get in the debugger:
hpwSQLitseLastErrorMessage = SQL logic error or missing database
SQL= update Simpsons set FirstName='Some text' where ID=1

So what can 'SQL logic error' mean?
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby HPW » Sat Mar 10, 2007 3:08 pm

I get something to work:

Setvar "[text]" "Some text"
Setvar "[SQL]" "update Simpsons set FirstName='[text]' where LastName='Simpson'"
hpwSQLiteQuery "RSqlConsole" "[PubDir][P1SqlDba]" "[SQL]" "|" "[hpwSQLiteResult]"


ID seems not to be a valid column, it seems to be a SQLite internal thing.

PS: The Browser 1.1 from here http://sqlitebrowser.sourceforge.net/ is practical to examine 2.X db's and testing SQL's
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby David de Argentina » Sun Mar 11, 2007 1:31 am

No error Hans-Peter,

I'm trying Neobook process a text entry as variable. Its only a literal....

Process i'm trying to do couldnt be possible...
or process Sql instructions programmatically or type all Sql Instruction... without variables... only literals...

Excuse me for waste your time.

Best regards,

David de Argentina
User avatar
David de Argentina
 
Posts: 1562
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina


Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 1 guest

cron