The requirement is to be able to exit SQL*Plus depending on a condition tested within the script.
The problem is that the IF/THEN/ELSE construct is for PL*SQL, not SQL*Plus and the SQL*Plus command exit is not allowed. For example, the following does not work:
begin
IF :returncode != 0...
The requirement is to be able to exit SQL*Plus depending on a condition tested within the script.
The problem is that the IF/THEN/ELSE construct is for PL*SQL, not SQL*Plus and the SQL*Plus command exit is not allowed. For example, the following does not work:
begin
IF :returncode != 0...
And finally, what I think is a neater adaptation of the same approach, which requires two files to be set up in advance:
1. exit.sql containing the single line "exit"
2. continue.sql which will be empty
I can then continue (when it returns 0) or exit (when it returns 1) using:
COLUMN action...
I meant to add that if I change the PROCEDURE into a FUNCTION that returns an error indicator...
CREATE OR REPLACE FUNCTION test1 (xxx IN NUMBER) RETURN NUMBER IS
ex1 EXCEPTION;
BEGIN
IF xxx = 1 THEN
RAISE ex1;
END IF;
RETURN 0;
EXCEPTION
WHEN ex1 THEN...
Dagan,
Yes, that is quite convoluted, which I think answers my question "Can this be done?" with "not nicely".
It does work though. Response appreciated. Star.
Nick.
Dagon, thanks for reply.
Specifically, I was trying to remove the "ORA-06510: PL/SQL: unhandled user-defined exception" that it says is "ORA-06512: at line 4".
This was just my latest attempt; the following simpler alternative has a similar problem...
Hi.
I have a procedure that throws a user defined exception that I want to handle in SQL*PLUS where the procedure is called. When the exception is thrown, I want a user message to the console and for SQL*PLUS to exit with a non-zero return code.
Currently getting "unhandled user-defined...
I want to be able to create a text only pdf that I can print onto pre-printed paper (for reasons of quality and economy), but when someone views the pdf, I would like them to see it on an image of the pre-printed paper.
Is this possible with Acrobat? With a different reader? Is there anything...
Given:
Dim sh As Object
Set sh = CreateObject("WScript.Shell")
sed = "c:\BIPApps\ssed\ssed s/\x0D//g c:\old.txt > c:\new.txt"
Anybody got any idea why if this works ...
ret = Shell("cmd /c " & sed) ' returns PID
... this doesn't?
ret = sh.Run(sed, 0, True) ' returns 2
Thanks to all,
Nick.
Good idea PH.
I'm currently working against a development database, so I can use for the moment.
Won't be able to get views set up quite so easily against the Live database though, (stable, release procedures, ownership, blah, blah) so still interested in an Access based solution if anyone has...
I find that Access is unable to link to Oracle tables that have a VARCHAR2 column defined as the primary key.
All I get is the #DELETED indicators.
Anyone know how to resolve this (without changing the Oracle table).
Is it possible to link the table without selecting a Primary Key at all (I...
I know it's late, but for the record ....
The reason for your problem is that you have multiple unique indexes/constraints on the table. Presumably one is the oracle primary key, and why that one isn't automatically picked I have no idea.
The only way I have found to get it to pick the right...
RunSQL and OpenQuery action achieve the same thing for you; use whichever you prefer.
For the newest date, use max(Updated) instead of Count(InterpId). In fact, you can do them at the same time as in:
SELECT SongId, Count(InterpId) AS ITotal, Max(Updated) AS Newest INTO InterpCount FROM...
Jay,
Use two queries:
First a Make table query (a table called InterpCount in this example):
SELECT SongId, Count(InterpId) AS ITotal INTO InterpCount FROM Interpretation GROUP BY SongId;
Next an Update query:
UPDATE Song INNER JOIN InterpCount ON Song.SongId = InterpCount.SongId SET...
Now that's a cold fusion question that I can't help you with.
While I said "I wouldn't hold the total column", that is with all things being equal. If cold fusion gives you a reason to hold and update Total it in a table column, just do it.
The worse that can happen is it doesn't automatically...
Thanks bin.
I understand the BO reporter option installed on a "standalone" PC perhaps connecting to an Access db on the PC itself and/or an Oracle db on a remote server and/or ...;
I think I understand Infoview as something like a server based version of BO Reporter that everyone can access...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.