var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Stored Procedure Question
In a stored procedure, how can I pip the result of a select statement to a text or ascii file? How can I append to an existing file?
SELECT * FROM Employee WHERE EmployeeType = 'Active' ># @filePath
but it does not work properly. The same statement works fine in dbisqlc!!!
I appreciate if someone could help me on this.
You can use isql for these.
isql -Uuser -SServer -Ppassword -iinput.sql -ooutput.out
Thanks for the post but how do I use the isql in a stored procedure?
You can't do that directly.
You may be able to get something to work via the XP server (look up Extended Stored procedures), or maybe via the XFS extension (which maps a directory as a Sybase table).
An alternative would be to write the output you want to a table, and have an outside job read the table and write that output to the text file.
U can use fsql like this :
fsql -D<DB Name> -U<user_id> -P<password> -S<Server> -c"exec <SP Name> " -I $SYBASE/interfaces > /tmp/sp_mig_insert_user.csv