Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    9

    Unanswered: odbc select where parameters

    Im enabling an apllication to use ODBC to connect to sqlserver which currently uses Oracle OCI, i have no prior knowledge about odbc use.
    Im unsure how to approach where clause parameters (bind parameters)
    ie Oracle OCI
    select name into :name from emp where name = :a_name

    via ODBC, connecting to sql server i'm attempting

    select name from emp where name = ?

    with,
    sqlprepare
    sqlbindparameter
    sqlexecute
    sqlbindcol
    sqlfetch

    all seems ok with sqlbindparameter, but sqlexecute fails with sqlstate 22001, String data, right truncation.
    The question: can i use ? parameter in where conditions, if not whats the best approach.
    Many Thanks.

  2. #2
    Join Date
    Jan 2004
    Posts
    9
    resolved. problem was oci doesnt require null terminated char string, odbc does

Posting Permissions

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