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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Using LEFT within openquery

Author  Topic 

tariq2
Posting Yak Master

125 Posts

Posted - 2011-03-11 : 05:52:59

Many thanks in advance
The query below:

select * from openquery(symprod_etldev,'select left(esmcu,2) from proddta.F595130S WHERE ESMCU = ''100018370117''')

created the following error:

OLE DB provider "OraOLEDB.Oracle" for linked server "symprod_etldev" returned message "ORA-00904: "LEFT": invalid identifier".

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2011-03-11 : 06:18:14
have you tried using substr(ing) instead?

select * from openquery(symprod_etldev,'select substr(esmcu,0, 2) from proddta.F595130S WHERE ESMCU = ''100018370117''')

- Lumbago
My blog-> http://thefirstsql.com/2011/02/07/regular-expressions-advanced-string-matching-and-new-split-function-sql-server-2008-r2/
Go to Top of Page

tariq2
Posting Yak Master

125 Posts

Posted - 2011-03-11 : 08:11:05
Thats great.
Out of interest, why doesnt LEFT work?
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2011-03-11 : 08:19:33
Seemingly, LEFT is not a system function in Oracle.

- Lumbago
My blog-> http://thefirstsql.com/2011/02/07/regular-expressions-advanced-string-matching-and-new-split-function-sql-server-2008-r2/
Go to Top of Page

tariq2
Posting Yak Master

125 Posts

Posted - 2011-03-11 : 09:49:36
Thanks Lumbago
Go to Top of Page
   

- Advertisement -