Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2011
    Posts
    24

    Unanswered: 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?
    http://www.dbforums.com/db2/1636464-...variables.html
    http://www.dbforums.com/db2/1634357-...nside-db2.html

    Is temp table the only solution?

  2. #2
    Join Date
    Nov 2011
    Posts
    24
    Is some more details required?
    Can someone give the syntax to be used?

  3. #3
    Join Date
    Jan 2010
    Posts
    206
    Did you find a solution here? I have the same issue ....

  4. #4
    Join Date
    Feb 2004
    Posts
    18
    z/os doesn't support this function.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •