Home » SQL & PL/SQL » SQL & PL/SQL » Converting Prompt syntax into regular sql (Oracle IDE 4.0)
Converting Prompt syntax into regular sql [message #635320] Thu, 26 March 2015 11:52 Go to next message
haryshenoy
Messages: 1
Registered: March 2015
Location: United States
Junior Member
I have a code that is similar to sql and it has prompts and If clauses in it. I want to convert it into regular Oracle sql and run it in developer. Can you please let me know how I can modify the IF and prompts to form the right syntax for looking at the data in developer?

WHERE
PO_DOC_ACTG.DOC_FUNC_CD <> 3.00 and
PO_DOC_ACTG.DOC_PHASE_CD = 3.00 and
(If {?Department Code} <> 'ALL' then
MA_DOC_HDR.DOC_DEPT_CD = {?Department Code}
else True) and
(If {?Master Agreement Doc ID} <> 'ALL' then
MA_DOC_HDR.DOC_ID = {?Master Agreement Doc ID}
else True) and
(If {?Vendor Code} <> 'ALL' then
PO_DOC_ACTG.VEND_CUST_CD = {?Vendor Code}
else True) and
PO_DOC_ACTG.DOC_CD = "DO" and
MA_DOC_HDR.DOC_FUNC_CD <> 3.00 and
MA_DOC_HDR.DOC_PHASE_CD = 3.00

Thanks,
Hari

[Updated on: Thu, 26 March 2015 11:55]

Report message to a moderator

Re: Converting Prompt syntax into regular sql [message #635323 is a reply to message #635320] Thu, 26 March 2015 12:18 Go to previous message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Use CASE.

Previous Topic: insert statement w/o having unique constraint error
Next Topic: SQL query (merged 3)
Goto Forum:
  


Current Time: Thu Apr 18 16:37:39 CDT 2024