Asked 3 years, 7 months ago. Active 3 years, 7 months ago. Viewed times. Help with the syntax would be appreciated. D 25 5 5 bronze badges. Please provide the error. Add a comment. Active Oldest Votes.
I3rutt I3rutt 4 4 silver badges 18 18 bronze badges. Sign up or log in Sign up using Google. I'm working on a pl sql stored procedure. What I need is to do a select, use a cursor and for every record build a string using values. At the end I need to write this into a file. I call my procedure from a unix ksh. I'm thinking at something like using "spool on" on the ksh side to dump the result of my procedure, but I don' know how to do it if this is possible.
If you call the script using SQL Plus, just put the following into your test. Performance could suffer, but it should work. Make sure, that what you try can't be done in pure SQL , though. Reading your comment I think that Analytic Function Lag is what you need. If every line of your output is the result of an operation on one row in the table, then a stored function, combined with Peter Lang's answer, can do what you need.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 11 years, 9 months ago. Active 9 years, 2 months ago. Viewed 30k times. I'm thinking at something like using "spool on" on the ksh side to dump the result of my procedure, but I don' know how to do it if this is possible Anyone has any idea?
Out of curiosity, did you try my solution? I allready answered. I cannot afford doing more that one time the query. Your solution the Analytic Function need the query to be executed more than one. Copyright Information. Open topic with navigation. The results window will display the query results.
Note that SQL export files have the. If the exported SQL file is to be used in a database other than Oracle, you must manually modify that file to replace the field types with the types that work with the non-Oracle database. For example, you can run the following statement for an Oracle database:.
0コメント