altSQLite variable substitution

Mark Wieder mwieder at ahsoftware.net
Mon Dec 11 12:16:54 EST 2006


Jim-

Monday, December 11, 2006, 7:28:46 AM, you wrote:

> There are some peculiarities you need to be aware of using the current
> revdb.dll and the altSQLite driver.

> These apply to using the "bound" form of substitution, which is :1 etc. and
> a following variable reference.

> 1. Never reference a variable that is empty. Rev will crash.

Haven't come across this. I've been experimenting with empty variables
and nonexistent variables and haven't had it crash yet. Have you
Bugzillad this?

> 2. Don't reference vars that have chars that can be interpreted as math
> symbols (dash, asterisk, plus, etc). They will cause Rev to crash. (I assume
> SSN stands for Social Security Number as in XXX-XX-XXXX? For some reason the
> drivers attempt to perform math with this eventhough it is "data" :-(

Right. I found that one, and I throw quotes around anything that might
get executed. This really should be in the docs, or better yet, fixed.

> Try this:

> 1. Type the SSN column as lower case "blob" (Not the standard BLOB) in the
> database. Chris uses lower case to let his driver know this a binary column.

I originally had it as a "blob" type, but switched to varchar when
that wasn't working in order to try to extract as simple example as
possible.

    put "create table CDData(id integer primary key, Notes varchar)" into tSQL
    revExecuteSQL dbID, tSQL
    put "blahblahblah" into tNotes
    put "INSERT INTO CDData(id, Notes) VALUES(null,:1)" into tSQL
    RevExecuteSQL dbID, tSQL, "tNotes"

which results in 'near ")": syntax error'

Removing the variable substitution works.
    put "INSERT INTO CDData(id, Notes) VALUES(null,"&tNotes&")" into tSQL

Thanks.

-- 
-Mark Wieder
 mwieder at ahsoftware.net




More information about the use-livecode mailing list