1

I've a script that I am using to build/drop tables and basically setting up the entire schema. After googling, I still can't figure out how to run a stored procedure.

The script is a .txt file, and I run it using Apex SQL Oracle.

If I write only this line in a script:

execute procedurename(1); --where 1 is paramter. 

You have requested to run a script that does not contain any runnable statements.

7
  • Is it a script or a stored procedure? To run a script in sql*plus (not sure what Apex is), you'd preface it with @, e.g. @c:\temp\your_script.txt. Commented Apr 28, 2012 at 23:47
  • @Marc script is running fine. I just need that script o call the stored procedure. Does it make sense? Do you need more details? Commented Apr 28, 2012 at 23:58
  • The script should be able to call the stored proc with call packagename.procname(1); Commented Apr 28, 2012 at 23:59
  • @Marc what is packagename? how do i find out what's corresponding package name for my environment? or do I create a package from scratch for this task? Commented Apr 29, 2012 at 0:05
  • if your stored proc is not in a package, you don't need a package name. Just call procname(param); should work. Commented Apr 29, 2012 at 0:05

2 Answers 2

2
SQL>create or replace procedure procedurename(p_num number) 
as 
begin 
null; 
end;
/

Procedure created.

SQL>execute procedurename(1);

PL/SQL procedure successfully completed.

everything seems ok on SQLPLUS with oracle 11.

so it must be an apex thing.

Sign up to request clarification or add additional context in comments.

Comments

2

Since execute is a sqlplus statement ,try calling the procedure using begin-end PLSQL block in Apex SQL

BEGIN
procedurename(1); 
END;
/

save this in a file proc_call.sql and then call it in your script like

 @C:\proc_call.sql 

where C: is the sample path

For some information refer the below link

https://forums.oracle.com/forums/thread.jspa?threadID=618393

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.