Exforsys

Online Training

refcursor type or rowtype

This is a discussion on refcursor type or rowtype within the Oracle Database forums, part of the Database category; hi pls advice me who can i go about to get .. i will be sending date and tp i need ...


Go Back   Exforsys > Database > Oracle Database

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-21-2008, 10:17 AM
Junior Member
 
Join Date: Aug 2007
Posts: 1
oracle_coorgi is on a distinguished road
refcursor type or rowtype

hi
pls advice me who can i go about to get ..
i will be sending date and tp i need to insert and update all in bs from sp,temp_table

Code:
CREATE OR REPLACE package testall as
type ref_all_cur is ref cursor;
procedure allsales_pnt
(
o_SPI OUT  testall.ref_all_cur,
ts_dt  date,
tp   cust_type.tp%type,
);
End testall;
/
CREATE OR REPLACE procedure allsp
(
o_SPI OUT  testall.ref_all_cur,
ts_dt  date,
tp   cust_type.tp%type,
)
as
v_count 				 number;
v_inputted_date 		 date;
begin
open o_spi_id for SELECT pspi FROM sp;
v_dt := TO_DATE('01-'||TO_CHAR(ts_dt,'MON-YYYY'),'DD-MON-YYYY');
v_sdt := TO_DATE('01-'||TO_CHAR(ts_dt,'MON-YYYY'),'DD-MON-YYYY'),-10);
select count(1) into v_count from bs where ts_dt = v_dt
and volt_tp_id = tp;
If v_count = 0 Then
insert into temp_table ---------------
while (v_sdt <= v_dt)
loop
	If tp = 1 Then
	insert into bs ---------------
	commit;
	End If;
	end loop;
	update 	bs----------------
	set 	tp = 5,
			ts_dt=vt_dt,
			pspi = o_spi_id
	where 	volt_tp_id is null;
	commit;
	end allsp;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-04-2008, 11:35 AM
grlewycky's Avatar
Junior Member
 
Join Date: Jan 2007
Posts: 9
grlewycky is on a distinguished road
After your CURSOR definitions and before your BEGIN

add something like this:


inv_record C_INVOICE%ROWTYPE;


CURSOR c_machine IS
Select name from v$database;
----
/*--------------------------------*/
/* */
/* */

machine_record c_machine%ROWTYPE;

/* */
/* */
/*--------------------------------*/
BEGIN

OPEN c_machine;
LOOP
FETCH c_machine INTO machine_record;
out_machine := machine_record.NAME;
EXIT WHEN c_machine%NOTFOUND;
end loop;
CLOSE c_machine;
__________________
from the mind of George Lewycky
grlewycky@yahoo.com | http://georgenet.net/oracle
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



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


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.