Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
khalik
Constraint Violating Yak Guru
443 Posts |
Posted - 2002-01-24 : 20:48:20
|
| hi i am accessing oracle data from sql server 2000 the query isselect * from openquery(pmbs,"SELECT t6.OWNER_ID ,t6.DEVICE_ID,SM.PRIMARY_TALKGROUP_ID PRIMARY_TALKGROUP_ID FROM T022_AVAILABLE_MODE AM,T122_SCAN_MODE SM,T123_SECONDARY_TALKGROUP ST,T005_TALKGROUP TG, T006_SUBSCRIBER t6 WHERE AM.FLEET_ID = SM.FLEET_ID AND AM.MODE_ID = SM.MODE_ID AND AM.FLEET_ID = SM.FLEET_ID AND AM.URBAN_ID = SM.URBAN_ID AND AM.NETWORK_ID = SM.NETWORK_ID AND SM.PRIMARY_TALKGROUP_ID = TG.TALKGROUP_ID and Am.dap_status='O' AND SM.FLEET_ID = TG.FLEET_ID AND SM.URBAN_ID = TG.URBAN_ID AND SM.NETWORK_ID = TG.NETWORK_ID AND SM.FLEET_ID =ST.FLEET_ID (+) and AM.NETWORK_ID =t6.NETWORK_ID and AM.MSIN=t6.MSIN order by t6.OWNER_ID , t6.DEVICE_IDSM.PRIMARY_TALKGROUP_ID ")the error it gives...Server: Msg 103, Level 15, State 7, Line 2The identifier that starts with 'SELECT t6.OWNER_ID ,t6.DEVICE_ID, SM.PRIMARY_TALKGROUP_ID PRIMARY_TALKGROUP_ID FROM 022_AVAILABLE_MODE AM, T122_SCAN_MODE SM,' is too long. Maximum length is 128.can any one help me out in passing more than 128... to linked servers..thanks======================================Ask to your self before u ask someone |
|
|
izaltsman
A custom title
1139 Posts |
Posted - 2002-01-24 : 20:59:34
|
| You have to turn quoted identifiers off (SET QUOTED_IDENTIFIER OFF) before you run that statement. Or use single quotes instead of double. |
 |
|
|
khalik
Constraint Violating Yak Guru
443 Posts |
Posted - 2002-01-24 : 21:06:03
|
| thanks for the info..but it gives the length more 128 what does SET QUOTED_IDENTIFIER OFF do....======================================Ask to your self before u ask someone |
 |
|
|
izaltsman
A custom title
1139 Posts |
Posted - 2002-01-24 : 21:42:19
|
| Right now you are using double quotes around your SELECT statement. When the QUOTED IDENTIFIER option is on, SQL Server treats everything that is surrounded by double quotes as an identifier (as an object or column name)... So when SQL Server sees that your whole SELECT is in double quotes it throws an error, basically telling you that an object name can not exceed 128 characters. If you use single quotes, or set QUOTED IDENTIFIER option off, SQL Server will realize that you aren't trying to refer to any of the database objects, but instead just passing in a string value. |
 |
|
|
khalik
Constraint Violating Yak Guru
443 Posts |
Posted - 2002-01-24 : 22:07:06
|
| i tried it and i get one more error..the query is select * from openquery(pmbs,'SELECT t6.OWNER_ID ,t6.DEVICE_ID,SM.PRIMARY_TALKGROUP_ID PRIMARY_TALKGROUP_ID FROM T022_AVAILABLE_MODE AM,T122_SCAN_MODE SM,T123_SECONDARY_TALKGROUP ST,T005_TALKGROUP TG, T006_SUBSCRIBER t6 WHERE AM.FLEET_ID = SM.FLEET_ID AND AM.MODE_ID = SM.MODE_ID AND AM.FLEET_ID = SM.FLEET_ID AND AM.URBAN_ID = SM.URBAN_ID AND AM.NETWORK_ID = SM.NETWORK_ID AND SM.PRIMARY_TALKGROUP_ID = TG.TALKGROUP_ID and Am.dap_status='O' AND SM.FLEET_ID = TG.FLEET_ID AND SM.URBAN_ID = TG.URBAN_ID AND SM.NETWORK_ID = TG.NETWORK_IDAND SM.FLEET_ID =ST.FLEET_ID (+) and AM.NETWORK_ID =t6.NETWORK_ID and AM.MSIN=t6.MSIN order by t6.OWNER_ID , t6.DEVICE_IDSM.PRIMARY_TALKGROUP_ID ') i am using Am.dap_status='O' might be this be a problem how should i======================================Ask to your self before u ask someone |
 |
|
|
izaltsman
A custom title
1139 Posts |
Posted - 2002-01-24 : 22:13:28
|
| Try using two single quotes on either side of O: Am.dap_status=''O'' Be sure to use two single quotes on each side -- do not use double quotes! |
 |
|
|
khalik
Constraint Violating Yak Guru
443 Posts |
Posted - 2002-01-24 : 23:31:04
|
| thanks for the info...bye======================================Ask to your self before u ask someone |
 |
|
|
|
|
|
|
|