0

I have a sql server that connect to an oracle db via ODBC.

On the sql box I run a query to pull data using:

EXEC ('SELECT * FROM dbName.tableName') AT [LinkedServer];

This returns the full table with column names etc

I am now trying to update the table with values using:

EXEC ('INSERT INTO dbName.tableName (VALUE_ID, VALUE_NAME, VALUE_SITE, ACTIVE) VALUES ("18", "TEST", "3", "Y")') AT [LinkedServer];

With this I get the following:

OLE DB provider "MSDASQL" for linked server "LinkedServer" returned message "[Oracle][ODBC][Ora]ORA-00984: column not allowed here".

With selecting all from the table I can confirm that it exists and values exist under those column names.

I have read that this issue may be caused by using a column name as a value but this is nit teh case here.

Any ideas?

jarlh
  • 42,561
  • 8
  • 45
  • 63
TJ15
  • 353
  • 2
  • 10
  • 22

1 Answers1

0

As suggested, becasue the EXEC was wrapped in single quotations I incorrectly wrapped the value in double quotes. I tested with 2 single quotes and this resolved issue.

TJ15
  • 353
  • 2
  • 10
  • 22