BookmarkSubscribeRSS Feed
shubham1
Calcite | Level 5

hello 

 

z='2019-10-23 00:00:00.000000'

 

I am trying to insert this value character value  2019-10-23 00:00:00.000000  by putting in a macro variable x in to a sql server table

 

call symput ('x',z)

 

the column that i am ineserting is OP_DATO which is defined as datetime2(6) in sql server 

 

when i am inserting through sas 9.4 i am getting this error 

 

Value 1 on the SELECT clause does not match the data type of the corresponding column listed after the INSERT table name

 

Is this a problem with SAS 9.4 because it was working with SAS 9.2 .what is the solution for sas 9.4

 

2 REPLIES 2
Amir
PROC Star

If it used to work before then check the order of the variables in your data set when compared with the order of the values in the insert statement, as described in:

 

https://communities.sas.com/t5/SAS-Procedures/SQL-insert-error/td-p/77278

 

If that is not the solution then please post the code you are using with some example data that can be inserted into an example data set.

 

 

Amir.

Amir
PROC Star

When I did a web search for the error message you posted, the 2nd link I found looks like it might be of help - "Problem Note 62503: An error is returned when you try to add datetime values to an SQL Server table using a libref with SAS/ACCESS® Interface to OLE DB":

 

http://support.sas.com/kb/62/503.html

 

 

Amir.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 426 views
  • 1 like
  • 2 in conversation