Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2013
    Posts
    4

    Unanswered: select statement with varaible doesn't output any result on IBM data studio (ver10)

    select statement with varaible doesn't output any result on IBM data studio (ver10)

    The following query execute successfully but don't output any result. However, if i run select query independelty, I get result. Do I need to SET any control varaible to output result?

    CREATE VARIABLE MEMBER_ID VARCHAR(15) ;
    SET MEMBER_ID = '1100641' ;
    SELECT * FROM table where CLIENT =MEMBER_ID;
    DROP VARIABLE MEMBER_ID;

  2. #2
    Join Date
    Oct 2013
    Posts
    4
    I also tried host varaible to run sql query with varaibles. It works fine, however I need to enter host varaibles every time whenever, I copy and paste script into IBM data studio or open new session. I am trying to find out solution, where I can declare varables at top of scripts and run all queries at once. Is there any statement or solution on DB2, which I can automate script running without much interference.

Posting Permissions

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