Results 1 to 3 of 3

Thread: sql help

  1. #1
    Join Date
    Jan 2008
    Posts
    13

    Unanswered: sql help

    HI all , I'm not too savvy when it comes to sql..can please someone tell me the following

    select col1 from table1 where col2 =?

    thankx
    Last edited by db2link; 10-23-08 at 14:32.

  2. #2
    Join Date
    Apr 2008
    Posts
    39
    question mark indicates parameter markers.

    When we want to pass value dynamically to a query we use these parameter markers.

    SELECT col1 FROM table1 WHERE col2=?

    means dynamically you can pass value to col2 in WHERE clause.

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    When a statement has parameter markers it means it has been prepared without any specific value to be used in place of the ?, and the SQL is compiled into a package and stored in package cache. Then when the prepared statement is executed, the value is supplied and substituted by DB2. This allows an SQL statement to be compiled (and access plan determined) once, but reused many times without having to recompile each time.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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