Home » SQL & PL/SQL » SQL & PL/SQL » How to call procedure in the select statement
How to call procedure in the select statement [message #440947] Thu, 28 January 2010 01:14 Go to next message
chaituu
Messages: 115
Registered: June 2008
Senior Member


CREATE OR REPLACE PROCEDURE test (
    p_codetype             VARCHAR2,
    p_serialno          NUMBER,
   p_outsrno       OUT   VARCHAR2
)

above procedure will generate some serial number and return it as out variable.i want to run this procedure
in the select statement.but i am getting error.can i call procedure in the select statement?

INSERT INTO emp
  (EMPID, DEPTID, empFILENO, emp_DATE)
  SELECT 'EMPID_DF_' || D.DEPTID,
         D.DEPTID,
         test('TEST', 'SMJSERIALNO', null),
         SYSDATE
    FROM DEP D
   WHERE D.DEPTID = '1234';
Re: How to call procedure in the select statement [message #440948 is a reply to message #440947] Thu, 28 January 2010 01:20 Go to previous message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
You can't call procedures from SQL. Make it a function.
Previous Topic: Simple SQL query
Next Topic: PL/SQL procedure - filling empty fields as a rule (merged 3)
Goto Forum:
  


Current Time: Tue Dec 06 00:22:45 CST 2016

Total time taken to generate the page: 0.08702 seconds