05-29-2007 06:05 PM - edited 03-14-2019 12:54 AM
Hi all,
I have problem with DB Write in CRA Editor
I can insert data in table in SQL server with this command
INSERT INTO table1(SDT) VALUES (123)
after run script, i see 123 is appeared in table1
But when i create variable X (interger ) with value=123 and using command
INSERT INTO table1(SDT) VALUES(@X)
i test and see 0 row is altered. And after run script, no thing appeared in table1
Thanks first
Please reply as soon as possible.
I will vote 5 * for you.
05-29-2007 07:59 PM
Any one can help me to use variable in SQL query in DB Write??
05-30-2007 05:32 AM
I think your problem is because you're using "@" instead of "$". Here is an example from one of my script:
INSERT INTO StatMenu(SessionID,DateTime,Choice) VALUES ($lCurrentSessionID,$strCurrentDateTime,'M1000')
There are two variables (String) and one hard-coded value ('M1000').
Hope this help !
Steven
05-30-2007 05:47 PM
Thanks Steven,
But when i use "$" instead of "@":
INSERT INTO table1(Number) VALUES($x);
I see this error when test this SQL command by click Excute button ont tab "Test"
" Test SQL Execution
Remote Error:Java.lang.NullPointerException
"
Hope you can help me.
05-31-2007 06:46 AM
It's probably because at the time you clicked the "Execute" button, the value of the "x" was null.
Anyway, I never use this button. Try with a real call or with reactive debugging. It should work just fine.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: