Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Batch File Calling .SQL File With Parameters

850978Apr 4 2011 — edited Apr 4 2011
Hello All:

I might / might not have code correct, as I can't find a Google result to answer the question and can't test this solution until it goes live, so I want to make sure I have it correct.

I have a batch file (file1.bat) that sets up some variables. Inside this file, I am calling a .sql procedure like this:
sqlplus username/password@environment @c:\sql\export.sql %cID% %sID% %exportFilename%

How do I utilize those parameters inside export.sql so they are passed to the oracle procedure?

I am currently using the following code:
BEGIN
sinterface.export(&1, &2, &3);
EXCEPTION
WHEN OTHERS
THEN NULL;
END;

Will this code work? I know if I call another .bat file from the file1.bat code, I can get the parameters such as:
SET cID = %1
SET sID = %2
SET exportFileName = %3

OR

SET CompID = %compID%
SET SiteID = %siteID%
SET exportFileName = %exportFilename%

But I have no idea if / how this translates to an oracle .sql file to call a stored procedure. I got one Google result to show using &1, &2, &3 to set the parameters from the batch file, but as I can't test this, I really have no idea if this would work.

Would anyone be able to confirm the correct method?

Thanks
Andy
This post has been answered by CraigB on Apr 4 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 2 2011
Added on Apr 4 2011
3 comments
1,886 views