Home » SQL & PL/SQL » SQL & PL/SQL » function & wrap utility (merged)
function & wrap utility (merged) [message #387996] Mon, 23 February 2009 00:05 Go to next message
rajasekhar857
Messages: 500
Registered: December 2008
Senior Member
hi,the function is working fine before the wrapping.
after wrapping throwing exception used in anonymous blocks like
"vwexists" is invalid".

CREATE OR REPLACE FUNCTION VWIsExists(PARAMS VARCHAR2) RETURN INT As
TExist INT;
begin
BEGIN
EXECUTE IMMEDIATE (PARAMS) INTO TExist;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN(0);
NULL;
WHEN OTHERS THEN
RETURN(0);
NULL;
END;
RETURN(TExist);
end;
/
function [message #388000 is a reply to message #387996] Mon, 23 February 2009 00:17 Go to previous messageGo to next message
rajasekhar857
Messages: 500
Registered: December 2008
Senior Member
hi,
can anyone tell me how to write a function using dbms_sql to check whether the given character value exists or not.
ex: following function

CREATE OR REPLACE FUNCTION VWIsExists(PARAMS VARCHAR2) RETURN INT As
TExist INT;
begin
BEGIN
EXECUTE IMMEDIATE(PARAMS) INTO TExist;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN(0);
NULL;
WHEN OTHERS THEN
RETURN(0);
NULL;
END;
RETURN(TExist);
end;
Re: wrap utility [message #388002 is a reply to message #387996] Mon, 23 February 2009 00:21 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You should perhaps take some time and review your PL/SQL manual, go to Oracle documentation pages and study PL/SQL User's Guide and Reference book, etc. - whatever it takes to learn PL/SQL basics.

Reading your previous messages on the Forum, it appears that you are incapable of creating even very simple piece of code. Although people will probably provide help (read: working code), it will not make you understand the concept and - in a long run - you'll fail.

Besides, Oracle errors are not meant to be played in a theatre so there's no need to make up your own error interpretation. If you want people know what's going on, post actual Oracle error code (ORA-xxxxx, PLS-xxxxx, etc.).

Re: function [message #388025 is a reply to message #388000] Mon, 23 February 2009 00:49 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
From one of your previous topic with the same function:
Michel Cadot wrote on Tue, 17 February 2009 10:20
From your previous posts:
BlackSwan wrote on Tue, 17 February 2009 05:35
You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
So we can help you & please be consistent & correct in your postings.


Yes, if you are willing to Read The Fine Manual.

BlackSwan wrote on Tue, 10 February 2009 05:58
>iam getting exceptions
Exceptions? What exceptions? I don't see any problem.

You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
So we can help you


Michel Cadot wrote on Tue, 10 February 2009 07:55
From your previous topic:
Michel Cadot wrote on Mon, 09 February 2009 07:28
Copy and paste EXACTLY what you did.
Before read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Regards
Michel

Which the same one than this one, so I merged one and the following is still true:
Michel Cadot wrote on Mon, 09 February 2009 12:32
You still didn't post what I asked and how I asked it.

Regards
Michel


And so on.

Regards
Michel

[Updated on: Mon, 23 February 2009 00:50]

Report message to a moderator

Re: function [message #388031 is a reply to message #388025] Mon, 23 February 2009 00:59 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
@Michel

You do know that it is an option NOT to respond to a thread, right?
Your reply adds nothing to this thread, except more unreadability.
Apparently, your previous attempts on this poster did not have any result.
Not replying might trigger the OP to come back, asking why noone replied yet. That would be a good moment to point him to the Forum Guide. (In a brief and professional manner)
Re: wrap utility [message #388043 is a reply to message #387996] Mon, 23 February 2009 01:11 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Michel Cadot wrote on Mon, 23 February 2009 07:49
From one of your previous topic with the same function:
Michel Cadot wrote on Tue, 17 February 2009 10:20
From your previous posts:
BlackSwan wrote on Tue, 17 February 2009 05:35
You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
So we can help you & please be consistent & correct in your postings.


Yes, if you are willing to Read The Fine Manual.

BlackSwan wrote on Tue, 10 February 2009 05:58
>iam getting exceptions
Exceptions? What exceptions? I don't see any problem.

You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
So we can help you


Michel Cadot wrote on Tue, 10 February 2009 07:55
From your previous topic:
Michel Cadot wrote on Mon, 09 February 2009 07:28
Copy and paste EXACTLY what you did.
Before read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Regards
Michel

Which the same one than this one, so I merged one and the following is still true:
Michel Cadot wrote on Mon, 09 February 2009 12:32
You still didn't post what I asked and how I asked it.

Regards
Michel


And so on.

Regards
Michel



Re: function [message #388101 is a reply to message #388000] Mon, 23 February 2009 03:43 Go to previous messageGo to next message
ashoka_bl
Messages: 398
Registered: November 2006
Location: Bangalore
Senior Member

rajasekhar857,

Quote:

whether the given character value exists or not.


Can you please clear this point !

And also, what do you pass this function, what sort of values ? And Oracle Version.

Regards,
Ashoka BL
Bengaluru
Re: function [message #388111 is a reply to message #388000] Mon, 23 February 2009 04:34 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Can you explain in detail what your function is meant to do.

It looks like you're expecting to get either a piece of SQL or a piece of executable code as input.
Is this the case?
Previous Topic: sql query
Next Topic: how to avoid outer join?
Goto Forum:
  


Current Time: Fri Feb 14 09:59:48 CST 2025