ladiesman1792
ladiesman1792

Reputation: 283

How to remove unnecessary line breaks in SQL Plus Spooling?

I am spooling a package from a database and this is what I get:

CREATE OR REPLACE PACKAGE BODY "CPI"."GIPI_WBOND_BASIC_PKG"                   
    AS                                                                              
       FUNCTION get_gipi_wbond_basic (p_par_id gipi_wbond_basic.par_id%TYPE)        
          RETURN gipi_wbond_basic_tab PIPELINED                                     
       IS                                                                           
          v_wbond   gipi_wbond_basic_type;                                          
       BEGIN                                                                        
          FOR i IN (SELECT a.par_id,        a.obligee_no,    a.bond_dtl,      a.inde
    mnity_text,                                                                     
                           a.clause_type,   a.waiver_limit,  a.contract_date, a.cont
    ract_dtl,                                                                       
                           a.prin_id,       a.co_prin_sw,    a.np_no,         a.coll
    _flag,                                                                          
                           a.plaintiff_dtl, a.defendant_dtl, a.civil_case_no        
                      FROM gipi_wbond_basic a                                       
                     WHERE a.par_id = p_par_id)  

And I am expecting it to be something like this:

CREATE OR REPLACE PACKAGE BODY cpi.gipi_wbond_basic_pkg
AS
   FUNCTION get_gipi_wbond_basic (p_par_id gipi_wbond_basic.par_id%TYPE)
      RETURN gipi_wbond_basic_tab PIPELINED
   IS
      v_wbond   gipi_wbond_basic_type;
   BEGIN
      FOR i IN (SELECT a.par_id, a.obligee_no, a.bond_dtl, a.indemnity_text,
                       a.clause_type, a.waiver_limit, a.contract_date,
                       a.contract_dtl, a.prin_id, a.co_prin_sw, a.np_no,
                       a.coll_flag, a.plaintiff_dtl, a.defendant_dtl,
                       a.civil_case_no
                  FROM gipi_wbond_basic a
                 WHERE a.par_id = p_par_id)

Please help me on how can I get rid of those new lines and ugly format. Thanks!

Upvotes: 2

Views: 26829

Answers (4)

Amit Saini
Amit Saini

Reputation: 11

TO remove extra Line breaks Try :- SET FEED OFF

Upvotes: 1

Clark
Clark

Reputation: 42

Additionally (to ladiesman1792's own answers, which were below this post when I posted!):

column text format a120 --<< will wrap at 120 chars (maybe bytes, not sure on that)

This is an Oracle sqlplus directive, as per the other answers.

Upvotes: 0

Nilesh Umaretiya
Nilesh Umaretiya

Reputation: 35

You can do it using the regular expression in SSMS:

1) Ctrl-H to bring up the Find And Replace window 2) Select USE -> Regular Expressions 3) Put ^\n in the Find What 4) Keep Replace With empty 5) Click Replace (All)

Good luck -- Nilesh Umaretiya (India)

Upvotes: -1

ladiesman1792
ladiesman1792

Reputation: 283

Ok this one solved my problem.

From this,

SET HEADING OFF;
SET ECHO OFF;
SET PAGES 999;
SET LONG 999999;

I added this:

SET LONGCHUNKSIZE 999999;
SET PAGESIZE 0;
SET LINESIZE 500;

Upvotes: 10

Related Questions