Output Through with a SQL Statement

mcunningham

New Member
Is there a way to substitute variables in a SQL statement embedded within an INPUT THROUGH statement. Here is what my code looks like:

assign
a = "something"
b = "something"
c = "something".

output through "/path/mysql -u uid -ppwd -D db -e 'insert into cust values (I want to substitute variables here)'".

put a b c.

I have tried any number of ways to put the variables into that statement and nothing seems to work.

I have tried creating a "cmd" variable and typing the entire sql statement into it and then using output through value(cmd) and that strips out all quotation marks - even those I force using ~ which then nets an error message.

I have also tried putting the code into a UNIX SILENT command and get the same results.

Am I missing something or is there a way to substitute the variables?

Thanks in advance for your help!!

Mary
 

lcombepine

New Member
Hi, Mary.

Have you tested something like this :
output through "/path/mysql -u uid -ppwd -D db -e 'insert into cust values " + a + "something" + b + "something" + c + "somthing'".
 

mcunningham

New Member
Yes and it doesn't seem to like the embedded quotes within the single quotes even preceeding with the tilde "~". It causes error messages. I've seen so many different error message that I am not sure which one this scenario produces, but it doesn't work.

thanks!
Mary
 
Top