Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

converting block into procedure..

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I want to change the following anonymous block to procedure syntax... I am gonna pass one parameter to the procedure and need to return 'true' or 'false', if the parameter is in the table or not... and I don't know how to execute oracle procedure in ASP.... please, help me...

declare
CURSOR BADWORD_CUR IS
SELECT BADWORD FROM SY_BADWORDS WHERE BADWORD = 'NONE';
BADWORD_REC BADWORD_CUR%ROWTYPE;
BEGIN
OPEN BADWORD_CUR;
FETCH BADWORD_CUR INTO BADWORD_REC;
IF( BADWORD_CUR%ROWCOUNT > 0 ) THEN
DBMS_OUTPUT.PUT_LINE('TRUE');
ELSE
DBMS_OUTPUT.PUT_LINE('FALSE');
END IF;
CLOSE BADWORD_CUR;
END;
 
If I may suggest an alternative approach to your block:

CREATE OR REPLACE PROCEDURE my_proc(p_badword VARCHAR2) AS
v_badword VARCHAR2(100);
BEGIN
SELECT badword INTO v_badword
FROM sy_badwords
WHERE BADWORD = p_badword;
DBMS_OUTPUT.PUT_LINE('TRUE');
EXCEPTION
WHEN no_data_found THEN
DBMS_OUTPUT.PUT_LINE('FALSE');
END;

 
then, how can I execute this procedure in Active Server Pages by using Javascript?? anyone knows how to do it??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top