Home » SQL & PL/SQL » SQL & PL/SQL » Regarding PL/SQL Arguments
Regarding PL/SQL Arguments [message #36399] Sun, 25 November 2001 22:52 Go to next message
ram
Messages: 95
Registered: November 2000
Member
Is it possible to pass a where clause inside pl/sql block so that i can use that where clause inside the pl/sql block.

for example

procedure p1(whereclause varchar2) is

begin

Here i want to use the whereclause for select or update.Is is possible.

end

----------------------------------------------------------------------
Re: Regarding PL/SQL Arguments [message #36401 is a reply to message #36399] Sun, 25 November 2001 23:47 Go to previous message
Rajarshi Dasgupta
Messages: 52
Registered: October 2001
Member
procedure p1(whereclause varchar2) is
i number(4);

begin

EXECUTE IMMEDIATE "SELECT EMP_NO FROM EMP " || whereclause INTO i;

end ;

This is the easiest way to do. But U can also use DBMS_SQL package..... it has got many more utilities for dynamic SELECT, DDL, & DML......

----------------------------------------------------------------------
Previous Topic: Merge two table using PL/SQL
Next Topic: Can data be loaded into a table already having some records
Goto Forum:
  


Current Time: Thu Apr 02 13:52:08 CDT 2020