Click here to Skip to main content
14,029,438 members
Rate this:
 
Please Sign up or sign in to vote.
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web03 | 2.8.190419.4 | Last Updated 22 Mar 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100