cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
414
Views
5
Helpful
4
Replies

DB Write again, again..

steffenluttge
Level 1
Level 1

hello..

I´ve been reading the other DBwrite conversions in the forum, and i seems that noone has a solution, if you want to use DB write with a $var.

are there another way to write variables in databases from scripts.

regards

Steffen

4 Replies 4

Did you check my earlier post out. DBwrite works. You can use insert/update statement with variables. What issues are you having?

>>>>>

When you are using variables in the sql statement, use the $ before the variable name.

For example, If your telnum variable name is varTelNum and CallerID is in variable varCLID and your table name is TestTable with fields TelNum and ClID, then your insert statement will be as follows:

Insert into TestTable(TelNum, CLID) values ($varTelNum, $varCallerID)

So, the format is

Insert into (

,
,....,
) values ($, $,....,$)

Hope this helps. You can dummy some data into the variables and use the test button in the DBWrite node to test the insert.

Good luck. Please rate posts

I get the NullPointerException when I try..

the Update works fine..

i´ve tried with String and Integer..

DBwrite : INSERT INTO ny VALUES('9') works fine but

INSERT INTO ny VALUES('$nummer') or

INSERT INTO ny VALUES($nummer) doesn´t.

Steffen

ARGGGHHHH...

Tried once more... without the ' ' - and didn´t test the insert.. and it worked...

thx..

Steffen

If you put the '', then you have to give the actual value if the value is a string. If you are using the $ and the variable, you don't put the quotes because if the variable is a string, then it already has the quotes built in (which is not seen).

Anywayz, good that you got it figured out.