on 04-11-2019 8:10 PM
I am trying to put an output statement in a stored procedure so that I can export data to a text file easily whenever I need to.
My syntax looks something like this:
create procedure TestExportInventoryMaster ()
begin
select *
from TestTable;
output to 'FileLocation\\ExportData.txt';
end
When I run the output statement, it exports all of the data that I want. However, when I try to create a stored procedure with an OUTPUT statement, I get an error message. "Syntax error near "OUTPUT"...SQL Code -131 ODBC 3 State 42000
Why is this happening?
These SELECT and OUTPUT can be replaced by UNLOAD statement.
e.g.
UNLOAD TABLE TestTable TO 'FileLocation\\ExportData.txt'
For detailed, see the below.
UNLOAD statementhttp://dcx.sap.com/index.html#sqla170/en/html/817fd0fd6ce21014a58ff727fbb7b4e2.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OUTPUT is only valid in Interactive SQL. In a procedure, you can use the UNLOAD statement.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.