Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2014
    Posts
    294

    Unanswered: Dynamic SELECT statement

    Hi,

    I am new to stored procedures. I am trying to create a stored procedure, that has to accept the table name at run time & to display the records from that table.

    SELECT * FROM TABLE_NAME. Here TABLE_NAME value has to be passed at run time. I tried to get samples from google,previous posts, even from the samples of the procedures from the SAMPLE directory. But there are nothing.
    Can anyone kindly provide me some sample code,to do this.
    thanks

  2. #2
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    The sample SpServer.java (provided in the samples/java/jdbc directory on your db2-server ) has several examples of dynamic select statements. Make it work for you.
    The only thing you need to do is use your brain.

  3. #3
    Join Date
    Jul 2014
    Posts
    294

    Dynamic SELECT statement

    @db2mor

    I know how to use My Brain.No need of your suggestions. U may be an expert on this technology. I have my own expertise. I am learning now. This is a public forum. Try to learn some thing first ,how to behave .....

  4. #4
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    You posted that your searched the samples directory for examples and "there are nothing", although in fact the opposite is true. Are you sure you are behaving correctly?

Tags for this Thread

Posting Permissions

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