Hello,
I have SAS 9.4 M2 and a database on a server with PostgreSQL 12.
We are using a libname with odbc to connect to the server. I can SELECT but I cannot DELETE datat from a table.
options nofmterr; libname db_schema odbc user=**** password=**** datasrc=[database alias in odbc.ini] schema=[schema name] direct_exe=delete; proc sql; /* SELECT WORKS */ select * from db_schema.tbl_blah_error where blah_error_comment LIKE "TEST-1234%"; /* ERROR - CANNOT DELETE */ delete from db_schema.tbl_blah_error where blah_error_id=104680; quit;
Thanks Ksharp! I used a connection and executed the query on the remote server.
However, I had to rewrite some of the queries, because they have correlations to local sas datasets.
SAS does not mandate any ODBC driver.
Ask the PostgreSQL admins which driver they recommend for your needs and install it on the SAS server.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.