Creation of Database from Runrev

Jim Ault JimAultWins at yahoo.com
Thu Dec 7 11:46:20 EST 2006


You need to look at the docs for the 'execute' or the 'query' command,
depending on which SQL statement you are sending, and use 'theSQL' as the
string to pass in the function.

Jim Ault
Las Vegas


On 12/7/06 8:32 AM, "jhonken" <jhonken at webdsp.com> wrote:

> Jim,
>   Thanks for the response.  How do you execute the SQL that you've
> stored in "theSQL"?  Jeff
> 
> -----Original Message-----
> From: Jim Ault [mailto:JimAultWins at yahoo.com]
> Sent: Thursday, December 07, 2006 11:26 AM
> To: How to use Revolution
> Subject: Re: Creation of Database from Runrev
> 
> 
> On 12/7/06 7:55 AM, "jhonken" <jhonken at webdsp.com> wrote:
> 
>> My application has a Sqlite database that I'd like to create from
>> Runrev.  The problem I've had in the past is that I can't execute a
>> realllly long SQL statement within Rev.  Is there some trick to it or
>> is there another way?  The limitations I've run into are:
>>  
>> 1.  It seems that the SQL statement likes to be on one line. 2.  I've
>> tried to use the continuation character in the statement in the past
>> but the statement is so long it seems to choke.
>>  
>> Does anyone have any ideas on how I can execute a long create
>> statement?
> 
> If you mean build a long string in a variable then there are a few ways
> Using the merge for SQL is my preference
> 
> Some readable ways for SQL
>   --that  "do-it-all-in-one-line"
>   --without using "replace"
>   -- only one function call, merge()
>   --   yet remain readable
> 
> ------------------ one line  (watch word wrap)
>   put merge("DELETE FROM [[tmysqltableName]] Where [[tIDcolumnName]] =
> '[[tRecordID]]'") into theSQL
> 
>   -------------------- or another way = same result (watch word wrap)
>   put merge("DELETE FROM [[tmysqltableName]] Where [[tIDcolumnName]] =
> '[[tRecordID]]'") \
>       into theSQL
> 
>   -------------------- yet another way = same result
>   put merge("DELETE FROM [[tmysqltableName]] "  & \
>   "Where [[tIDcolumnName]] = '[[tRecordID]]'") \
>       into theSQL
> 
>   -------------------- or another way to get a COMPLEX result
>   put tRecordID + 1 into tRecordID2
> 
> put merge("" & \
>       "DELETE FROM [[tmysqltableName]] "& \
>       "Where ([[tIDcolumnName]] = '[[tRecordID]]' "& \
>       "OR  [[tIDcolumnName]] = '[[tRecordID-1]]') "& \
>       "AND  [[tIDcolumnName]] = '[[tRecordID2]]'" & \
>       "") into theSQL3
> 
> Fun with Rev  
> 
> Jim Ault
> Las Vegas
> 
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list