Hi,
I am trying to insert a pdf into a sql database but having some trouble.
The pdf is a report created in SAS 9.4 using ods.
I am connecting to the sql database using odbc connection. On the sql server there is a sql stored procedure that is expecting the pdf as a binary object. However, I don't know how to deliver a binary pdf in SAS.
Any suggestions? Or information I need to add to make my question more clear?
Here is the sas code I am using.
proc sql;
connect to odbc ("driver={&driver};server=tcp:&server,1433;database=&database;uid=&userid@&server_name;pwd={&pwd};encrypt=yes;trustservercertificate=no;connection timeout=30;");
execute (
declare @result bit
declare @statusmessage varchar(100)
exec [dbo].[report_transfer_deliverfile]
1,
"&filepathf\test.pdf", --how do we pass binary input here?
'test.pdf',
@result output,
@statusmessage output
) by odbc ;
%put &sqlxrc. &sqlxmsg.;
disconnect from odbc;
quit;
I get the following error:
ERROR: CLI execute error: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near 'C:'.
I am connecting to database fine. And the sql stored process is running. But it needs the binary file of the pdf, not the file path I included.
Thanks for your help.
... View more