Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > Oracle
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 8th, 2006, 05:07 PM
Registered User
 
Join Date: Jan 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Create and executing an oracle stored procedure

Hi All,
I am new to Oracle. I am facing problem in executing the procedure. My requirement is to create a procedure which passes one input parameter and gets the stats data for that input value and should return an array or ADO.
Can somebody help me pls...



CREATE OR REPLACE procedure DB_Popup1 ( c_Val IN Schema1.Table1_stat_data.id%TYPE, cur_val OUT Schema1.Table1_stat_data.number%TYPE)is

begin

select distinct count(*) into cur_val from Schema1.Table1_stat_data
where TO_CHAR(Table1_stat_data.datetime,'dd-mon-yyyy') = TO_CHAR(SYSDATE -2,'dd-mon-yyyy')
AND id_cre = '1609' group by id having count(*) < 244;

end;
/

Thanks in advance,

Ven

  #2 (permalink)  
Old January 10th, 2006, 05:10 AM
Authorized User
 
Join Date: Sep 2003
Location: Delhi, Delhi, India.
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to prabodh_mishra
Default

Try using ref cursors..
Define a package with procedure and ref. cursor declaration.
Write the procedure in the package body.
It's the most convenient way to return a multidimensional
array like data...

PROCEDURE <proc name>
( var1 IN NUMBER,
   CUR_1 IN OUT refCur_1
 )
IS
BEGIN
    OPEN refCur_1 FOR
    <SELECT statement>
END;


 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Oracle Stored Procedure life.gurpreet C# 2005 0 March 13th, 2007 04:54 AM
Executing an UPDATE Stored Procedure ashg657 Access VBA 1 June 9th, 2006 06:29 AM
Executing a stored procedure from ASP tlbacon527 Classic ASP Databases 2 January 23rd, 2004 03:50 PM
Executing a Stored Procedure using ASP. treadmill Classic ASP Databases 3 July 24th, 2003 04:21 PM



All times are GMT -4. The time now is 05:27 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.