multi line Livecode field uploaded to MySQL

Tim Selander selander at tkf.att.ne.jp
Sat Feb 16 05:49:27 EST 2019


Thank you!

It didn't quite work for me at first, but in re-reading the 
Dictionary on revExecuteSQL and reading BYU's page on the 
subject, I got it working.

Really appreciate your help.

Tim Selander
Tokyo

On 2019.02.16 18:17, Ludovic THEBAULT via use-livecode wrote:
>
>> Le 16 févr. 2019 à 09:17, Tim Selander via use-livecode <use-livecode at lists.runrev.com> a écrit :
>>
>> Thank you for your reply, but I haven't gotten it working yet.
>>
>> The code in my first post was from my working stack. Here is what I have from my non-working stack after re-writing to follow your instructions:
>> ------------
>> # Construct SQL
>> put "INSERT INTO contactInfo(key,organization,denomination,address,category,tel,fax,tEmail,access,founded,staff,servicetime,web,character)" & \
>> " VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)" into tSQL
>> # Execute SQL
>> revExecuteSQL(gconnection,tSQL,vkey,vorg,vdenom,vadd,vcategory,vtel,vfax,vtEmail,vaccess,vfounded,vstaff,vtime,vweb,vcat)
>> put the result into tTmp
>> ------------
>>
>> The table name is "contactInfo" and the list of the table's fields is in the paranthesis.
>>
>> The VALUES(:1,:2....  syntax is something I haven't seen before. I assume that you need as many numbers as you have fields?
>>
>> You say to use variables, and I am assuming in the "revExecuteSQL" line. Is that correct? I tried the list of variables both with the quotes you used, and without just to see. I also tried replacing the revExecuteSQL comman with revdb_execute. Both result in this error: {execution error at line n/a (External handler execution error: revdberr,syntax error) near "revdberr,syntax error"}
>>
>> I appreciate your taking the time to educate me.
>>
>> Tim Selander
>>
>
>
> Here an example :
>
> put fld "name" into tName
>
> put the label of btn "title" into tTitle
> put fld "first_name" into fFirst_Name
>
> put fld "address" into tAddress
>
> put fld "citycode" into tCitycode
>
> put fld "tCity" into tCity
>
> put fld "tPhone" into tPhone
>
> put fld "tEmail" into tEmail
>
> put "INSERT INTO address ( tAddress, tCitycode, tEmail, tName, fFirst_Name, tPhone, tTitle, tCity) VALUES ( :1, :2, :3, :4, :5, :6, :7, :8 );" into tSQL
> revExecuteSQL tDatabaseID, tSQL, "tAddress", "tCitycode", "tEmail", "tName", "fFirst_Name", "tPhone", "tTitle", "tCity"
>
> //The quote are necessary in last line
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>





More information about the use-livecode mailing list