Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EASY Select statement

Status
Not open for further replies.

maeling

Technical User
Sep 23, 2002
109
GB
The following SQL query allows me to obtain customer information by querying on post code, however I would like to be able to query on all of the other fields in this query (if that makes sense. I can query on one field at a time,by changing the post code selection, however I can't get the statement to allow multiple query criteria, so I can query on all field at the same time. Help !




select CA.CUSTOMER_ID, DAN.Cust_Ord_Customer_TAB.Get_Name(CA.CUSTOMER_ID) CUSTOMER_NAME,
CA.ADDRESS,DAN.CUSTOMER_INFO_ADDRESS_TAB.Get_Phone ( Ca.customer_id,ca.address_id,sysdate ) phone_no,
DAN.CUSTOMER_INFO_ADDRESS_TAB.Get_Line(ca.customer_id,ca.address_id,DAN.CUSTOMER_INFO_ADDRESS_TAB.Get_Lines_Count(ca.customer_id,ca.address_id )) post_code,
DAN.CUST_ORD_CUSTOMER_TAB.Get_Market_Code (CA.customer_ID) MARKET from DAN.CUSTOMER_INFO_ADDRESS CA
WHERE
UPPER(DAN.CUSTOMER_INFO_ADDRESS_TAB.Get_Line(ca.customer_id,ca.address_id,DAN.CUSTOMER_INFO_ADDRESS_TAB.Get_Lines_Count(ca.customer_id,ca.address_id))) like UPPER(nvl('&POST_CODE','% '')'))
order by DAN.CUST_ORD_CUSTOMER_TAB.Get_Market_Code (CA.customer_ID),CA.CUSTOMER_ID
 
i've never seen ansi sql like that

what are those, function calls? looks like some kind of custom logic encapsulated in function calls to join to some other table

i'm guessing from your use of the NVL function that you might get more results posting your question in the Oracle forum

rudy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top