1. What is the value in $DICEpackage?
2. You should call $dbh->prepare() outside the loop.  Keep both prepared
handles in separate variables.
3. The bind variables (:1, :2, :3) definitely need to be separated by commas
(,) in both SQL statements.
4. You don't need either the quotes or braces in the first argument to
either $sth->execute().  Just use $tableName in that position.
5. The braces are also not needed in ${tableName} in the print statement.
6. Try adding DBI->trace(2,"file_name"); before this section to see what's
really happening.
--
Mac :})
Give a hobbit a fish and he'll eat fish for a day.
Give a hobbit a ring and he'll eat fish for an age.
----- Original Message -----
From: "Loo, Peter # PHX" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 12, 2001 3:15 PM
Subject: Stored Procedure (arguments)


> Can someone please tell me what this is all about?
>
> DBD::Oracle::st execute failed: ORA-01036: illegal variable name/number
(DBD
> ERROR: OCIBindByName) at sma_run_aggs.pl line 172.
>
> Here is my syntax:
>
>     foreach $tableName (@tableList) {
>       print STDERR "\n\nDropping indexes (${tableName}).\n";
>       $sth = $dbh->prepare("BEGIN $DICEpackage.DROP_INDEXES(:1:2:3);
END;");
>       $sth->execute("${tableName}", "ALL", "FALSE"); <=== Line 172
>       sub_dbms_output_errors($SearchString, $dbh);
>       print STDERR "Truncating table (${tableName}).\n";
>       $sth = $dbh->prepare("BEGIN $DICEpackage.TRUNCATE_TABLE(:1:2);
END;");
>       $sth->execute("${tableName}", "ALL");
>       sub_dbms_output_errors($SearchString, $dbh);
>       }


Reply via email to