Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I HATE OpenQuery!
Message
From
11/07/2012 07:00:11
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01548093
Message ID:
01548156
Views:
61
Try creating just one string with the whole query (with embedded CR) and also you may want to use single quotes for string constants (but doubled when used in a string).

Also, why do you need to generate OPENQUERY dynamically? Have you tried it static?

Finally, do you have a direct access to that Oracle server and can you first try that query there?

Also, are you sure this is valid Oracle syntax

EXTRACT(YEAR FROM HT.TAP_DT), EXTRACT(MONTH FROM HT.TAP_DT),


yes I am sure that this is valid Oracle syntax. I have used OpenQuery like this many times before. The problem was that I was missing a beginning quote in this string:

HCT.SAMPLE_LOCATION IN ("SR", LF","LR")
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform