in reply to Re: Can't execute sql
in thread Can't execute sql

yes line 209 is $sth->execute()
I do execute similar code in a different sub routine. The only difference is the sql statement.
In this code I am executing a stored proc in the other code I am executing a select statement that fetches the database name.
As you can see I do successfully get the database name D_CHRIS
The $$dbh is correct. We use our own module that passes back references from $app.

Replies are listed 'Best First'.
Re: Re: Re: Can't execute sql
by ibanix (Hermit) on Jan 28, 2003 at 19:36 UTC
    Check the the user running the script has correct rights to run the stored proc?

    Try some test cases against the stored proc?

    ibanix $ echo '$0 & $0 &' > foo; chmod a+x foo; foo;
Re: Re: Re: Can't execute sql
by steves (Curate) on Jan 28, 2003 at 19:57 UTC

    Knowing the database still would help. How SP's are executed differs across databases. In Oracle, for example, I need to surround the SP to be executed with BEGIN/END statements like this:

    $sth = $dbh->prepare(" BEGIN :1:=util.end_of_day(:2); END; ");
      Database is Sybase user is sa.
      If I cut and paste the sql from the error message and run it on the Sybase server it works just fine. I have run it with the exec, execute and with out.