SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Execute DBMS script fails with invalid parameter type

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Execute DBMS script fails with invalid parameter type
Author Message
haaibaai



Joined: 21 Oct 2008
Posts: 2
Country: Netherlands

Post Execute DBMS script fails with invalid parameter type Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7951

Post Reply with quote
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

Code:
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 View user's profile Send private message
haaibaai



Joined: 21 Oct 2008
Posts: 2
Country: Netherlands

Post Reply with quote
Thanks a bunch.

The solution was to just leave out the Call part in your solution.

Code:
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 View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.