ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Installation/Configuration Support » Help me for Select inside select

Post new topic  Reply to topic
 Help me for Select inside select « View previous topic :: View next topic » 
Author Message
bhaski
PostPosted: Tue Oct 02, 2007 12:34 pm    Post subject: Help me for Select inside select Reply with quote

Voyager

Joined: 13 Sep 2006
Posts: 78
Location: USA

Hi friends

How to use selet query insdie the select query. Like
Quote:
select a,b, (select a from db1 as somevariable)

Not able to submit the full query, due to some issue on this server


Even with / without PASSTHRU I am not able pass this query.


Thanks and Regards
Bhaski.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Oct 02, 2007 2:37 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

You mean:
Select a, b from C where a in (Select a from D where x = :y) ?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
bhaski
PostPosted: Wed Oct 03, 2007 5:42 am    Post subject: Here it is Pls help me Reply with quote

Voyager

Joined: 13 Sep 2006
Posts: 78
Location: USA

(SELECT RC.RESERVE_TYPE_CODE ,RXC.RESERVE_CATEGORY_CODE,
PASSTHRU( THE (SELECT ITEM CD.SHORT_CODE FROM Database.{Source2}.{Schema2}.CODES AS CD WHERE CD.CODE_ID = RC.RESERVE_TYPE_CODE)) AS RESTYPECODE ,
PASSTHRU( THE (SELECT ITEM CD.SHORT_CODE FROM Database.{Source2}.{Schema2}.CODES AS CD WHERE CD.CODE_ID = RXC.RESERVE_CATEGORY_CODE)) AS RESCATEGORYCODE


This is the query
Back to top
View user's profile Send private message
bhaski
PostPosted: Wed Oct 03, 2007 5:44 am    Post subject: continue... Reply with quote

Voyager

Joined: 13 Sep 2006
Posts: 78
Location: USA

FROM
Database.{Source2}.{Schema2}.RESERVE_CURRENT AS RC,
Database.{Source2}.{Schema2}.RESERVE_X_COVERAGE AS RXC,
Database.{Source2}.{Schema2}.CLAIM AS C
WHERE
RC.RSRV_X_COV_ROW_ID = RXC.RSRV_X_COV_ROW_ID
and RC.CLAIM_ID = C.CLAIM_ID
and C.CLAIM_NUMBER = tempCLNo);



Even with / without PASSTHRU I am not able pass this query.
Back to top
View user's profile Send private message
bhaski
PostPosted: Wed Oct 03, 2007 5:45 am    Post subject: Reply with quote

Voyager

Joined: 13 Sep 2006
Posts: 78
Location: USA

MY environment is MQ 6.x.x. WMB is 6.x.x.x DB is SQL 2005. All latest version.

Pls hlep me to come out from this.

With Passthru i am getting


Quote:
SQL State ''42000''; Native Error Code '2812'; Error Text ''[Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored procedure 'MED'.''.

The error has the following diagnostic information: SQL State ''42000'' SQL Native Error Code '2812' SQL Error Text ''[Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored procedure 'MED'.''


The MED is the output of the second select in the whole select query
Quote:
(SELECT ITEM CD.SHORT_CODE FROM Database.{Source2}.{Schema2}.CODES AS CD WHERE CD.CODE_ID = RC.RESERVE_TYPE_CODE))


Without PASSTHRU

Implementation error
Back to top
View user's profile Send private message
bhaski
PostPosted: Wed Oct 03, 2007 5:46 am    Post subject: Reply with quote

Voyager

Joined: 13 Sep 2006
Posts: 78
Location: USA

Hi Friends
I think you can help me now,

Pls help me to come out

Thanks and Regards
Bhaski.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Oct 03, 2007 6:13 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Of course, if you are using PASSTHRU you have to use SQL Syntax that is correct for the database you are talking to.

If you are not using PASSTHRU, you have to use ESQL syntax that is correct.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
bhaski
PostPosted: Wed Oct 03, 2007 10:31 am    Post subject: Reply with quote

Voyager

Joined: 13 Sep 2006
Posts: 78
Location: USA

Hi Friends

It is solved.

Thanks and Regards
Bhaskar Rajamani.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Installation/Configuration Support » Help me for Select inside select
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.