in reply to Re: Pass the values to the sybase stored procedure using DBI-Sybase module and exexute the procedure.
in thread Pass the values to the sybase stored procedure using DBI-Sybase module and exexute the procedure.

Corion,
Thank yoy very much for your suggestion!
I have to pass nearly 20-25 fields to the stored procedure. I can check whether a value is defined for a key or not. But I don't know how to pass a null value if the value is undefined by using the same sql statement.

Placeholders are not accepted in my code. If I am using placeholders, error mesages like "DBD::Sybase::st execute failed: ct_param() failed!" are displayed.
Thanks
  • Comment on Re^2: Pass the values to the sybase stored procedure using DBI-Sybase module and exexute the procedure.

Replies are listed 'Best First'.
Re^3: Pass the values to the sybase stored procedure using DBI-Sybase module and exexute the procedure.
by Corion (Patriarch) on Jun 27, 2006 at 13:02 UTC

    So, if you need to create the SQL statement including the values as a string, have you looked at the quote method of DBI? I find it very helpfull to first try out my SQL in the SQL shell (isql for Sybase I think) and when I'm satisfied with the SQL statement to reproduce that statement in my Perl code. Have you done that already?

      I am using the qq!......! for quoting the sql statements.
      Should I need to replace this with $sql=$dbh->quote(......).
      Please suggest.
      DBD::Sybase accepts the NULL for null values.

        Please, please read the documentation on the quote method to learn what it is used for. Also, print out your SQL statements before passing them to your database, and think about what will happen when you have a string with whitespace in it. Actually, have you tried typing any of your SQL statements manually into your interactive SQL shell? Some values, namely, strings, need quoting to be valid in SQL. So you will need to add proper quotes around all the values that are strings.

Re^3: Pass the values to the sybase stored procedure using DBI-Sybase module and exexute the procedure.
by shmem (Chancellor) on Jun 27, 2006 at 13:02 UTC
    Does DBD::Sybase accept the NULL alias for null values?