SQL question

  • Creator
    Topic
  • #51824
    Jim Kosloskey
    Participant

    All,

    When doing a bindparameter command there is a place for the buffer size (a couple of them).

    If the parameter is a varchar(max) how does one indicate the buffer should adapt to the actual length of the parameter (these are inbound parameters to a stored procedure)?

    I know I can calculate the length of the parameter into a variable and use that for the buffer value, but I just wanted to know if there was an intrinsic way to do this in the bindparameter command.

    I have researched on the Microsoft site and I do not see that his is possible but it is very likely I am either missing or mis-reading something.

    email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

Viewing 2 reply threads
  • Author
    Replies
    • #71871
      Ray Barnes
      Participant

      Hmmm … in C++ have seen SQLPutData() and SQL_LEN_DATA_AT_EXEC?  C++ 6 though.

    • #71872
      Jim Kosloskey
      Participant

      ray,

      Thanks.

      I guess I should have added this:

      Using ODBC to invoke a Stored Procedure via Cloverleaf Data Integrator and Tcl.

      Thus the parameter is in Tcl not yet known to the Stored Procedure.

      In order to pass the parameter to the Stored Procedure I need to bind the parameter and provide buffer space.

      I don’t think the command you suggested at this point will do me any good. I think that is only useful if I want to find out the length of a DB element either at or after execution and bind is done before execution.

      Unless I am mis-understanding the use of the suggested command.

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #71873
      Ray Barnes
      Participant

      Hi Jim,

      Tought it might apply, but would have to run a code-sample myself. Don’t use C++ all that often. Eill let you know if I find something good.

Viewing 2 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,117
Forums
28
Topics
9,292
Replies
34,435
Topic Tags
286
Empty Topic Tags
10