Home » SQL & PL/SQL » SQL & PL/SQL » very urgent date problem!!
very urgent date problem!! [message #18438] Thu, 31 January 2002 02:42 Go to next message
Emine Deniz
Messages: 2
Registered: January 2002
Junior Member
Hello,
I use oracle 8i,I want to use a variable for date of day but it gives error! Can you tell me
what is wrong with it?
Thanks alot...

PROCEDURE get_all_at_once IS

TYPE p_sicil_table_type IS table of p1.p_sicil%TYPE
INDEX BY BINARY_INTEGER;
TYPE p_adi_table_type IS table of p1.p_adi%TYPE
INDEX BY BINARY_INTEGER;
TYPE p_soyadi_table_type IS table of p1.p_soyadi%TYPE
INDEX BY BINARY_INTEGER;
TYPE p_tay_bastar_table_type IS table of p3.p_tay_bastar%TYPE
INDEX BY BINARY_INTEGER;
TYPE p_ay_tar_table_type IS table of p3.p_ay_tar%TYPE
INDEX BY BINARY_INTEGER;

p_sicil_tab p_sicil_table_type;
p_adi_tab p_adi_table_type;
p_soyadi_tab p_soyadi_table_type;
p_tay_bastar_tab p_tay_bastar_table_type;
p_ay_tar_tab p_ay_tar_table_type;
a number;
CURSOR sicil IS SELECT a.p_sicil,a.p_adi,a.p_soyadi,b.p_tay_bastar,nvl(b.p_ay_tar,sysdate)
from p1 a,p3 b
where a.p_sicil=b.p_sicil;
begin

FETCH sicil BULK COLLECT INTO p_sicil_tab,p_adi_tab,p_soyadi_tab,p_tay_bastar_tab,p_ay_tar_tab;
a:=to_number(to_char(p_tay_bastar_tab,'dd'));

FORALL i IN 1..p_sicil_tab.last
INSERT INTO p27(p_sicil,adi,soyadi) VALUES (p_sicil_tab(i),p_adi_tab(i),p_soyadi_tab(i));

CLOSE sicil;
END;
Re: very urgent date problem!! [message #18442 is a reply to message #18438] Thu, 31 January 2002 03:51 Go to previous message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
you declared p_tay_bastar_tab as table type. you can't do that. open loop and get date part.

for i in p_tay_bastar_tab.count loop
a:= to_number(to_char(p_tay_bastar_tab(i),'dd'));
end loop
Previous Topic: UPDATING with INLINE QUERY
Next Topic: Pack a PL/SQL Table
Goto Forum:
  


Current Time: Tue Apr 23 20:02:56 CDT 2024