Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

DB Write again, again..

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

Re: DB Write again, again..

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

New Member

Re: DB Write again, again..

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

New Member

Re: DB Write again, again..

ARGGGHHHH...

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

thx..

Steffen

Re: DB Write again, again..

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.

138
Views
5
Helpful
4
Replies
CreatePlease login to create content