If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Outer Join problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-30-03, 10:42
sunitasorathia sunitasorathia is offline
Registered User
 
Join Date: Oct 2003
Posts: 7
Outer Join problem

I am stuck with the problem for so long. Could you please help.
Some how, I need to get around AND EXISTS ( Sub Query)

SELECT nl.title,
COALESCE(CHAR(ac.currentcy_date,'MM/DD/YYYY'),' '),
COALECE(CHAR(ORA8.ADD_MONTHS(ac.currentcy_date, co.currentcy_interval),'MM/DD/YYYY'),'Needs Initial Review'),
n.menu_position

FROM navbar_links nl,
navbars n,
ap_profile ap,
company co,
cy_review_sections crs RIGHT OUTER JOIN currentcy_review ac RIGHT OUTER JOIN
ON ac.applID = 3
ON ac1.cy_section_link_id = crs.cy_section_link_id
AND crs.cy_section_link_id = nl.link_id
AND nl.link_id = n.link_id
AND n.navbar_id = 9
and ap.appl_id = 3
AND co.company_id = ap.company_id
AND EXISTS
(SELECT 'x'
FROM ap_profile ac2, company co2
WHERE ac2.appl_id = 3
AND co2.company_id = ac2.company_id
AND co2.currentcy_interval > 0 AND co2.currentcy_interval is not null)

I get the following Error:

SQL0010N The string constant beginning with "x' FROM ap_profile
ac2, company co2 WHERE ac2.appl_id = 3 AND co2.comp" does not
have an ending string delimiter.

Explanation:

The statement contains a string constant, beginning with
"<string>", that is not terminated properly.

The statement cannot be processed.

User Response:

Examine the statement for missing apostrophes in the indicated
string constant.

sqlcode : -10

sqlstate : 42603

The sub query when I run separately runs perfect:

db2 => SELECT 'x' FROM ap_profile ac2, company co2 WHERE ac2.appl_id = 3 AND co2
.company_id = ac2.company_id AND co2.currentcy_interval > 0 AND co2.currentcy_in
terval is not null

1
-
x

1 record(s) selected.

I have difficulty putting this into query above.
Reply With Quote
  #2 (permalink)  
Old 10-30-03, 12:50
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Re: Outer Join problem

Quote:
Originally posted by sunitasorathia
(SELECT 'x'
FROM ap_profile ac2, company co2
Try putting "FROM" on the same line with "SELECT" in the file. I think I had a similar problem before; CLP sometimes has difficulties with special characters being at the end of the line...
Reply With Quote
  #3 (permalink)  
Old 10-30-03, 13:09
sunitasorathia sunitasorathia is offline
Registered User
 
Join Date: Oct 2003
Posts: 7
Thank you very much, I indeed tried that but it gives me the same error.
Really appreciate your valuable time.
Reply With Quote
  #4 (permalink)  
Old 10-30-03, 18:20
chuzhoi chuzhoi is offline
Registered User
 
Join Date: Dec 2002
Posts: 134
Re: Outer Join problem

Hi,

It seems strange to me that you have following :

RIGHT OUTER JOIN currentcy_review ac
RIGHT OUTER JOIN
ON ac.applID = 3
ON ac1.cy_section_link_id = crs.cy_section_link_id

It should be something like:
RIGHT OUTER JOIN currentcy_review ac
ON ac.applID = 3
RIGHT OUTER JOIN some_table_name ac1
ON ac1.cy_section_link_id = crs.cy_section_link_id

regards,
dmitri
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On