If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Using variable in SQL Script DB2 Z/OS

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-09-12, 04:25
techday techday is offline
Registered User
 
Join Date: Nov 2011
Posts: 24
Using variable in SQL Script DB2 Z/OS

DB2 Z/OS 10.1.5

Hi

Iam trying to write a simple query in a SQL script (not Stored Proc).
in IBM Data Studio sql script.

Basically assign to a variable and retrive.
declare var char(5)
set var = 'hello';
select var from sysibm.sysdummy1;

I have tried some of the options like begin atomic,statement terminator given in other threads, but they do not seem
to work.

Is variable assignmnet not available in Z/OS?
DB2 local variables
declaring variables inside DB2

Is temp table the only solution?
Reply With Quote
  #2 (permalink)  
Old 02-10-12, 01:23
techday techday is offline
Registered User
 
Join Date: Nov 2011
Posts: 24
Is some more details required?
Can someone give the syntax to be used?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On