Page 1 of 1

Concatenation using put

Posted: Thu May 26, 2011 4:30 am
by jesse
I am attempting to put a SQL query into a variable and append it with a variable called LIMITSETTING.
In case you wonder the purpose of this is to allow me to limit the number of records loaded in a datagrid.
Initially I am loading 100 then I have a button to be clicked to load the next 100, and the next 100, and so on...

but the below code is not working:

Code: Select all

put "SELECT ID,TITLE FROM products  LIMIT " . LimitSetting into tSQL
My final tSQL value should look like this:

SELECT ID,TITLE FROM products LIMIT 0,200

Re: Concatenation using put

Posted: Thu May 26, 2011 4:45 am
by jesse
Way to easy... I should have just kept trouble shooting. In case anyone missed it at first as well you
simply use a "&" to seperate each variable and place static text in double quotes and enclose it all
in the parenths. Example shown below includes LimitBegin and LimitEnd in my query which allows me to limit
the number of rows shown in a datagrid.

put ("SELECT ID,TITLE FROM products LIMIT " & LimitBegin &","& LimitEnd) into tSQL