Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Remember me

Go Back   Tutorialized ForumsDatabasesOracle

Add This Thread To:   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
Unread Tutorialized Forums Sponsor:
Old September 17th, 2012, 08:26 PM
tamss13 tamss13 is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
Join Date: Sep 2012
Posts: 2 tamss13 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 4 sec
Reputation Power: 0
Need help creating a loop

I am writing a query from an Oracle 11g database and I need to create a loop to fill out data in a portion of the query.

I can pull up to three names and some may have three and other don't---- the names could come from person_info table or the comp_driver_info so I can get data out of either and I need three or less

(h.person_f_name||' '||h.person_l_name) Witness_Name,
h.person_address Witness_Street_Address,
h.person_city Witness_City,
h.person_state Witness_State,
h.person_zip Witness_Zip,
h.person_home_phone Witness_Home_Phone_Number,

(e.compdrvr_f_name||' '||e.compdrvr_l_name) Second_Witness_Name,
e.compdrvr_address Second_Witness_Street_Address,
e.compdrvr_city Second_Witness_City,
e.compdrvr_state Second_Witness_State,
e.compdrvr_zip Second_Witness_Zip,
null Second_Witness_Home_Ph_Num,
e.compdrvr_office_phone Second_Witness_Bus_Ph_Num,
null Second_Wit_Relation_to_Claim,
null Second_Wit_Time_of_Acc_Desc,
--<run loop to fill> Third_Witness_Name,
--<run loop to fill> Third_Witness_Street,
-- <run loop to fill> Third_Witness_City,
--<run loop to fill> Third_Witness_State,
--<run loop to fill> Third_Witness_Zip,
--<run loop to fill> Third_Witness_H_P_Num,

incident a
Left Join incident_witness_xref n
On a.incident_id=n.incident_id
Left Join person_info h
On n.person_id=h.person_id
Left Join comp_driver_info e
On n.compdrvr_id=e.compdrvr_id

Reply With Quote

Viewing: Tutorialized ForumsDatabasesOracle > Need help creating a loop

Developer Shed Advertisers and Affiliates

Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.

© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap