Home » SQL & PL/SQL » SQL & PL/SQL » query to procedure (oracle 10g)
query to procedure [message #393926] Wed, 25 March 2009 00:16 Go to next message
rajasekhar857
Messages: 500
Registered: December 2008
Senior Member
hi,
i am usin one query as it should retrieve huge amount of data and getting performance problem.so now i wan to use a stored procedure
for performance sake.so please help me out how to use a query for using a procedure,my query is as follows
SELECT ENCOUNTER_NARRATION AS NARRATION , USER_NAME  AS CONSULTANT FROM EMREncounterData 
 INNER JOIN EMRENCOUNTERDETAILS on EMREncounterData.ENCOUNTER_ID=EMREncounterDetails.ENCOUNTER_ID
 INNER JOIN USERS ON CONSULTANT_ID=USER_LOGIN    	
     WHERE IS_SAVE_FOR_LATER=0 AND ( EMREncounterData.ENCOUNTER_ID = '1557'	
     OR EMREncounterData.ENCOUNTER_ID IN (SELECT PARALLEL_ENCOUNTER_ID FROM EMRTRACKPARALLELENCOUNTERS 
     WHERE PARENT_ENCOUNTER_ID= '1557'	)
     OR EMREncounterData.ENCOUNTER_ID IN (
       SELECT PARALLEL_ENCOUNTER_ID FROM EMRTRACKPARALLELENCOUNTERS 
      START WITH PARENT_ENCOUNTER_ID= '1557'	 CONNECT BY PRIOR PARALLEL_ENCOUNTER_ID=PARENT_ENCOUNTER_ID))
      order by EMREncounterData.ENCOUNTER_ID	
Re: query to procedure [message #393927 is a reply to message #393926] Wed, 25 March 2009 00:18 Go to previous messageGo to next message
BlackSwan
Messages: 25035
Registered: January 2009
Location: SoCal
Senior Member
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.

Post DDL for tables.
Post DML for test data.

Post expected/desired results.
Re: query to procedure [message #393929 is a reply to message #393927] Wed, 25 March 2009 00:32 Go to previous messageGo to next message
rajasekhar857
Messages: 500
Registered: December 2008
Senior Member
how to proceed with a stored procedure.van anyone give one example based on this?
Re: query to procedure [message #393930 is a reply to message #393926] Wed, 25 March 2009 00:37 Go to previous messageGo to next message
BlackSwan
Messages: 25035
Registered: January 2009
Location: SoCal
Senior Member
First you need to pass the qualification test to be the spell checker at the M & M factory.

Re: query to procedure [message #393936 is a reply to message #393926] Wed, 25 March 2009 01:36 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
What makes you think changing a plain SQL statement into a procedure will enhance your performance?
Previous Topic: problem in 'IN' clause of select query
Next Topic: & used input values
Goto Forum:
  


Current Time: Sat Dec 03 20:06:57 CST 2016

Total time taken to generate the page: 0.26363 seconds