Hi, group,

I am trying to bind a boolean value for a stored procedure

The code is like this

 #analyze table using dbms_stats
                $sql_analyze = q{
                                        begin
                                        
dbms_stats.gather_table_stats(:ownname,:tabname,:partname,:cascade);
                                        end;
                                };
                $csr = $dbh->prepare($sql_analyze);

                $partition_name = "";
                $owner = "cshao";
                $csr->bind_param(":ownname","$owner");
                $csr->bind_param(":tabname","test1");
                $csr->bind_param(":partname","$partition_name");
                $csr->bind_param(":cascade","true");

                $csr->execute;

with the following errors:

DBD::Oracle::st execute failed: ORA-06502: PL/SQL: numeric or value error: character 
to number conversion error
ORA-06512: at line 3 (DBD ERROR: OCIStmtExecute) at ./analyze_dbms_stats.pl line 71.
DBD::Oracle::st execute failed: ORA-06502: PL/SQL: numeric or value error: character 
to number conversion error
ORA-06512: at line 3 (DBD ERROR: OCIStmtExecute) at ./analyze_dbms_stats.pl line 71.

If I remove the last line
$csr->bind_param(":cascade","true") 
and remove :cascade from the $sql_analyze
everything works fine.

How could I pass a boolean value to the database through perl?

Thanks very much for your help.

Reply via email to