Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Spool File Name from Select

user1849Apr 8 2019 — edited Apr 17 2019

Hi all

I need a help.

1) I want to spool Sql and save file from output

2) I want to remove SQL> in Spool

For Example

my spool file should be <Value of "Case_no"_ "F_P"> TBD092019_Fail or TBD092019_Pass.log

Set echo on

select       'TBD092019' as "Case_no",

                  case when count(*) > 1 then 'Fail'

                   when count(*) = 1 the 'Pass' End "F_P"

from(

select Employee_id, Employee_name , count(*)

From Emp

Group by  Employee_id, Employee_name)

Thanks for all your help

Comments
Post Details
Added on Apr 8 2019
18 comments
2,730 views