Click here to Skip to main content
15,880,427 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to create pl/sql script which will spool the output to a file. The catch is my script is also making use of bind variables and the spooled output is always 0 bytes

Here's my query:

T sqlformat csv
spool c:\users\99387\testspool.txt;
variable End_date varchar2(25);
variable START_Date varchar2(25);
with 

-- Standard_Presets         ------------------------------------------------------------------------------------ START
     Standard_Presets As (
                     Select
                              1                                          HANDLE
                             , Epic_Util.Efn_Din(:START_Date)           START_Date    -- SQL Dev
                              , Epic_Util.Efn_Din(:End_Date) + .99999    End_Date      -- SQL Dev
                     From Dual
                   )
-- Standard_Presets         ------------------------------------------------------------------------------------ end
select START_Date, End_Date   from Standard_Presets;
spool off;


What I have tried:

I have tried running this using using the run statement which prompts me for the Bind Variable values but I get to data in the outfile.
When I run this as a script, I lose the Enter Bind prompts and the spooled file also loses the bind variable values.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900