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

Have you tried printing out your SQL statement before trying to execute it? Also think about how you will handle a Name with whitespace in it.

You should read up on DBI placeholders and what they are commonly used for.

  • Comment on Re: Pass the values to the sybase stored procedure using DBI-Sybase module and exexute the procedure.
  • Download Code

Replies are listed 'Best First'.
Re^2: Pass the values to the sybase stored procedure using DBI-Sybase module and exexute the procedure.
by Anonymous Monk on Jun 27, 2006 at 12:57 UTC
    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

      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.
      Does DBD::Sybase accept the NULL alias for null values?