By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,226 Members | 1,032 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,226 IT Pros & Developers. It's quick & easy.

Handling Special character in openquery

P: n/a
Hi
I'm working on linked server which uses db2oledb. When I tried simple
select query it didn't ran because the queries condition was based on
column having special character. Query was like that

select * from openquery(as400prod,'SELECT * FROM RMSPROD.RTIUPF WHERE
IUDOC# = 2705')

I was getting SQLState: 42703, sqlcode: -206

Then I figured out that if I enclose column name in double quotes the
query is working fine. The final query statement was like

select * from openquery(as400prod,'SELECT * FROM RMSPROD.RTIUPF WHERE
"IUDOC#" = 2705')

Now I encountered the same problem when I'm dealing with DELETE
OPENQUERY, I tried using double quotes as well but this time its not
working for delete openquery

My delete SQL statement looks like

delete from openquery(as400prod,'SELECT * FROM RMSPROD.RTIUPF WHERE
"IUDOC#" = 2705')

Now I'm getting SQLSTATE:42703 ,SQLCODE:-206

I'm using SQL2k SP4 and Host integration server 2K SP1 on WIN 2K
machine.
Any hint or help will be highly appreciated.

Thanks
Noor

Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.