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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Statment not working

Status
Not open for further replies.

JetRamsey

Technical User
Oct 22, 2010
49
US
I haven't touch ASP's in awhile. This code use to work when the database was in Oracle 8. Now that were on a different version of Oracle, 10g I think, I'm guessing that the (+) seen below needs to be written a different way to view the details of an old legacy database.

I also had to change the connect statement to establish a connection also. When I did, I was able to connect, but ran into this problem.

Should the (+) be written differently? Tried a google search but you can't search "(+)" and oracle since it doesn't really search for "(+)" in the search.

SQLA = "SELECT *"
SQLA = SQLA & " FROM EVENTS_VW, LOCATION_BLOCKS"
SQLA = SQLA & " WHERE INCD_EVENT_NUM = '" & eventnum & "' AND"
SQLA = SQLA & " EVENTS_VW.BLOCK_ID = LOCATION_BLOCKS.BLOCK_ID(+)"
set rs2 = my_conn.Execute(SQLA)
 
The (+) syntax really means "outer join". Take a look here:
I *think* the correct code would be:

Code:
SQLA = "SELECT *"
SQLA = SQLA & " FROM EVENTS_VW LEFT OUTER JOIN LOCATION_BLOCKS"
SQLA = SQLA & " On EVENTS_VW.BLOCK_ID = LOCATION_BLOCKS.BLOCK_ID"
SQLA = SQLA & " WHERE INCD_EVENT_NUM = '" & eventnum & "'"

I'm not an Oracle guy, so this may not be 100% correct, but I do encourage you to give it a try.

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top