03-03-2004 05:28 AM - edited 03-13-2019 04:05 AM
I'm using the following syntax to write to a database in a IVR script.
INSERT INTO call_log
(callMSGNum,callTelNumber)
VALUES
('12','555-1212')
The above works fine, However when I substitute the variable name instead of the straight text the write doesn't work.
Is there a syntax issue that I'm missing? All the docs that I find show examples of writing actual values not variables.
I'm substituting the variable name for the values listed above. If I leave the quotes then I get the variable NAME inserted in to the database. If I remove the quotes the insert fails.
Any ideas ?
03-03-2004 05:33 AM
Don't use quotes, and prefix the variables with dollar signs. Your query should look like this:
INSERT INTO call_log
(callMSGNum, callTelNumber)
VALUES
($msgNumber, $telephoneNumber)
where msgNumber and telephoneNumber are either String or Integer variables (depending on your database schema).
03-05-2004 07:59 AM
Thanks for tip, I wasn't sure of the syntax.
Here is what I have now.
INSERT INTO call_log
(MessageNumber,callTelNumber)
VALUES
($MessageDigitsChosen,$CallingNumber)
When I test that I get the following error:
Remote Error java.lang.NullPointerException
I have the columns in SQL defined as type 'varchar' length 50 Do you think I have a type mismatch ?
Or could it be something else
03-07-2004 09:25 PM
Hi,
Are you trying to insert Null values into the table which doesnot allow nulls? Also check if you have configured the DB subsystem and the same is in-service.
Regards
Yogi
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide