DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: PreparedStatement and IN clause

  1. #1
    Join Date
    Dec 2000
    Posts
    95

    Question PreparedStatement and IN clause

    Hello All ,

    I have to write a SQL for a PreparedStatement which has the IN keyword in the where clause.The number of parameters which go into IN is decided dynamically.

    i can find out the number of parameters at runtime.Can i insert those specific number of ? in the SQL, prepare the SQL , set the values , and then execute the PreparedStatement ?

    i am using Oracle 9i and jdbc 2.0

    thanks,

    Srinivas

  2. #2
    Join Date
    Nov 2002
    Posts
    80
    of course you can.

    you lose a little of the advantages (statement caching) of the prepared statement, but gain on not needing to worry about escape codes, number format etc.

Posting Permissions

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


Click Here to Expand Forum to Full Width