Re: bind variable
- From: DA Morgan <damorgan@xxxxxxxxx>
- Date: Mon, 30 Jul 2007 13:15:40 -0700
cptkirkh wrote:
On Jul 29, 2:44 pm, DA Morgan <damor...@xxxxxxxxx> wrote:cptkirkhwrote:I have a visual basic application that uses a sql query that uses bindEither concatenate the column in or use DBMS_SQL.
variables to extract a result. I have noticed that i can't use bind
variables in a from clause. Is there anyway to pull the max of one
column and then another column in the table that corrsponds to that
row? Here is my sql query.
"select ec.ec_export_number,ec_date from event_campaign ec, " &_
" (select max(ec_export_number) as maxexport from
event_campaign" & _
" where EC_PURPOSE = :event_purpose AND EC_ITEM_SENT
= :item_sent" & _
" and EC_SQL = :sql_totalcount ) maxresults where " & _
" ec.ec_export_number = maxresults.maxexport and EC_PURPOSE
= :aevent_purpose AND EC_ITEM_SENT = :aitem_sent " & _
" and EC_SQL = :asql_totalcount"
--
Daniel A. Morgan
University of Washington
damor...@xxxxxxxxxxxxxxxx (replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org- Hide quoted text -
- Show quoted text -
So you are saying do the following?
select max(ec_export_number)||ec_date from event_campaign
where EC_PURPOSE = :event_purpose AND EC_ITEM_SENT
= :item_sent
and EC_SQL = :sql_totalcount
concatenation refers to strings not dates and number.
--
Daniel A. Morgan
University of Washington
damorgan@xxxxxxxxxxxxxxxx (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
.
- References:
- bind variable
- From: cptkirkh
- Re: bind variable
- From: DA Morgan
- Re: bind variable
- From: cptkirkh
- bind variable
- Prev by Date: Re: 1Z0-020 Exam Materials Requested
- Next by Date: Re: HELP - Oracle Schema Import problem
- Previous by thread: Re: bind variable
- Next by thread: Oracle performance tuning question
- Index(es):
Relevant Pages
|