Question:
how to store the output of query/stored procedure in text file?
Saravanan R
2006-12-19 04:50:22 UTC
to store query output in text file (.txt)
Five answers:
anuj_kr_nspl
2006-12-19 05:39:39 UTC
Before executing in the Query Analyzer, select "Execution Mode" as "Results to file".



now as soon as you will press F5 or click to execute the sp or query, Query Analyzer will prompt to give you the file name and location to save the result.



hope it solves ur problem, if you mean some other thing, please reply back or call me on +91 9313499294



happy coding,

-anuj
Sudha P
2006-12-20 09:57:16 UTC
I have tried this in MS-SQL . I doesnt know about oracle.



this is the command,

osql.exe -S server_name -U user_name -P password -Q "procedure_name/query" -O "E:\file_name.extension"



eg:-

osql.exe -S pubs -U sa -P sa -Q "sp_getEmp"

-O "E:\myoutput.txt"



Hope this will help u.
rkveeram
2006-12-19 04:53:11 UTC
just select what u want to be stored and then click copy(ctrl+c) and then open a new notepap and then press(ctrl+v) r paste. and save the file
romeo_20m_delhi
2006-12-19 04:53:19 UTC
cant tell u exactlly but if you are using cpp then rite clik on blank screnn and go for file.open/save etc... thats all there are examples in there
evert
2016-11-28 00:47:14 UTC
tail enter.txt > output.txt # overwrite tail enter.txt > output.txt # append tail enter.txt | tee output.txt # overwrite, and exhibit on exhibit tail enter.txt | tee -a output.txt # append, and exhibit on exhibit


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...