 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
haaibaai
Joined: 21 Oct 2008 Posts: 2 Country: Netherlands |
|
Execute DBMS script fails with invalid parameter type |
|
First of all, I'm new to 24/7 scheduler so maybe this is very obvious...
I'm trying to execute a DBMS script on an Oracle database (To update the statistics daily). But when I execute Scheduler throws an error. It mentions that the "stored procedure parameter of type 'BOOLEAN' is invalid for 'ESTIMATE_PERCENT'" when executing:
DIM analyse_sql,string
DIM rows, number
ConcatEx "Execute dbms_stats.gather_schema_stats (OWNNAME => 'owner', OPTIONS => 'GATHER AUTO', estimate_percent => dbms_stats.auto_sample_size);", analyse_sql
DatabaseConnect( "schema_owner" )
DatabaseExecute( analyse_sql, rows)
DatabaseDisconnect
The database connection is working fine with other tasks... Can anybody explain to me what I'm doing wrong?
Also, the script part is working fine when I execute it in a SQL editor tool (Golden).
|
|
Tue Oct 21, 2008 6:07 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7951
|
|
|
|
EXECUTE is not a PL/SQL statement in Oracle, it is SQL extension in which case you cannot use PL/SQL calling notation. The command you want is CALL. Secondary, when referring to PL/SQL elements such as BOOLEAN data types in your SQL code you should use PL/SQL compatible syntax. What you want to execute is below
 |
 |
BEGIN CALL dbms_stats.gather_schema_stats (OWNNAME => 'owner', OPTIONS => 'GATHER AUTO', estimate_percent => dbms_stats.auto_sample_size); END; |
and just in case.... for a simple task like that you don't need to use JAL and complicated script type jobs. Instead, choose database type for this job and paste the above SQL into the job SQL text box. Select connection from the drop-down and you are done. As simple as that.
Hope this helps.
|
|
Tue Oct 21, 2008 9:57 am |
|
 |
haaibaai
Joined: 21 Oct 2008 Posts: 2 Country: Netherlands |
|
|
|
Thanks a bunch.
The solution was to just leave out the Call part in your solution.
 |
 |
BEGIN dbms_stats.gather_schema_stats (OWNNAME => 'owner', OPTIONS => 'GATHER AUTO', estimate_percent => dbms_stats.auto_sample_size); END;
|
Also, the task is a little bit more complicated than just executing this one statement, but thanks for the tip.
Thanks again!
|
|
Wed Oct 22, 2008 3:44 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|