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

Handling variables in sql*plus

Status
Not open for further replies.

omerdurdu

Programmer
Joined
Jul 21, 2001
Messages
72
Location
TR
In my ColdFusion codes I have a query something like this:
<cfquery name=&quot;nrid&quot; datasource=&quot;ndata&quot;>
select *
from tabel1, table2
where table1.name = table2.name
and table1.lastname = talbe2.lastname
and table1.ID = #data1.ID#
</cfquery>

data1 is a query. Is someone has any idea how am I gonna pust that in SQL*plus format. Especially this part:

table1.ID = #data1.ID#
 
It depends on what that data1 query is. You could rewrite this statement using either a subselect:

WHERE table1.ID = (select id from tblSample)

if subselects are allowed (I'm not familiar with SQL*plus), or depending on the query you could implement whatever selection is being done by the data1 query as part of the join in the query you have. If you provide the data1 query, I'll try to help you write it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top