Home » SQL & PL/SQL » SQL & PL/SQL » primary key issue (oracle plsql)
primary key issue [message #352836] Thu, 09 October 2008 19:00 Go to next message
veenadhari
Messages: 6
Registered: February 2008
Junior Member
Hi All,
I have a table (stg_tab) which has no primary key in it. I used to uniquely identify each row using the rowid.Now, I declared a table type such as

TYPE t_temp_tab IS TABLE OF stg_tab%ROWTYPE;
l_temp_tab t_temp_tab; ( declaration )

select ROWID,column1,column2 BULK COLLECT INTO l_temp_tab FROM
stg_tab; (this statement is throwing an error)

now when i want to unquily identify each row in the table type i am not able to do so using rowid. rowid is not being identified as a column. is there any way out to uniquely identify each row in some other way ?? Please help ! Confused
Re: primary key issue [message #352850 is a reply to message #352836] Thu, 09 October 2008 22:36 Go to previous message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

Use table of records ..

Something like
 TYPE t_nom_rec IS RECORD (obj_id           t_nom.obj_id%TYPE,
                            telex_id         t_nom.telex_id%TYPE,
                            facility_desc    t_facility.facility_desc%TYPE, 
                            shipper_desc     t_shipper.shipper_desc%TYPE, 
                            nomination_type  t_lookup.lk_desc%TYPE, 
                            effective_hour   t_nom.effective_hour%TYPE,    
                            quantity         t_nom.quantity%TYPE,
                            approved_ind     t_nom.approved_ind%TYPE,
                            verified_ind     t_nom.verified_ind%TYPE,
                            superseded_ind   t_nom.superseded_ind%TYPE,
                            agg_ind          t_nom.agg_ind%TYPE,
                            rejected_ind     t_nom.rejected_ind%TYPE);
  TYPE t_nom_tab IS TABLE OF t_nom_rec INDEX BY BINARY_INTEGER;
  v_nom_tab t_nom_tab;




Thumbs Up
Rajuvan.
Previous Topic: Multiple joins through multiple tables
Next Topic: Joining results of 2 queries
Goto Forum:
  


Current Time: Tue Dec 06 15:59:18 CST 2016

Total time taken to generate the page: 0.11331 seconds