Page 1 of 1

SQL layout on different lines

Posted: Tue Jan 22, 2019 4:35 pm
by hrcap
Hi All

I am currently putting together some SQL statements and am having to lay them out on a single line, e.g.

put "account_create, timestamp_create, timestamp_create_utc, account_mod, timestamp_mod, timestamp_mod_utc, _kp_uuid_username, email_user, date_of_birth, password_hint, password, username" into tFields


is there a way to allow this to be set out on separate lines (which i find easier to read), e.g.

put "
account_create,
timestamp_create,
timestamp_create_utc,
account_mod,
timestamp_mod,
timestamp_mod_utc,
kp_uuid_username,
email_user, date_of_birth,
password_hint,
password,
username"
into tFields


Many Thanks

Re: SQL layout on different lines

Posted: Tue Jan 22, 2019 4:49 pm
by bogs
hrcap wrote:
Tue Jan 22, 2019 4:35 pm
is there a way to allow this to be set out on separate lines
Well, the line continuation character comes to mind. Alternately, as Devin pointed out in the bottom of that page, you can store the meat of the query in a list box or cust. property or whatever you like really, then just call it.

Re: SQL layout on different lines

Posted: Wed Jan 23, 2019 1:56 pm
by MaxV
Try this

Code: Select all

replace "," with (comma & return) in tFields
See also: https://livecode.wikia.com/wiki/Replace

Re: SQL layout on different lines

Posted: Wed Jan 23, 2019 2:12 pm
by bogs
Hm, I'm pretty sure he means in the script editor Max.

In case you don't mean the script editor hrcap, Max's line will take

Code: Select all

 "account_create, timestamp_create, timestamp_create_utc, account_mod, timestamp_mod, timestamp_mod_utc, _kp_uuid_username, email_user, date_of_birth, password_hint, password, username"
 
and put it like this in a field

Code: Select all

account_create,
timestamp_create,
timestamp_create_utc,
account_mod,
timestamp_mod,
timestamp_mod_utc,
kp_uuid_username,
email_user, date_of_birth,
password_hint,
password,
username"