Db2 Global Variable Insert Example


  Asked by Anonymous - Db2 Global Variable Insert Example :
Can anyone show example of inserting using a db2 global variable or similar example to show how this works? Thx

Anonymous Says:
What have you tried so far?

Anonymous Says:
Here is a simple example with insert. First off I assume you have create the global variable because thats the first step.

Then you set the value of the variable
Set test.my_value = 'This is my text'

Then you use that global variable in your sql insert

insert into test.my_table
(field1, field2, field3)
Values ('testing','testing',test.myvalue)

I didnt test this but I dont see a syntax error, but get the idea.

Anonymous Says:
whoops type thats test.my_value on the variable

Anonymous Says:
great, thx

Add your reply below ...

Your Nickname:

Your Reply:

Type the code: