×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Blank Lines in SQLPLUS output.

Blank Lines in SQLPLUS output.

Blank Lines in SQLPLUS output.

(OP)
I have a report where it puts an empty line as below :

ALTER TABLE "C50CNT04_COLL"."CRA_CAISCOMM" ADD CONSTRAINT "CRA_CASPER" PRIMARY KEY ("AD_REF", "ACC_CD", "PARTITION_CODE")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 131072 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 1024
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)

TABLESPACE "USERS" ENABLE;

It generates this report based on :

SET LINESIZE 2000

SET TERMOUT OFF

SET FEEDBACK OFF

SET HEADING OFF

SET ECHO OFF

SET VERIFY OFF

SET TERMOUT OFF

SET LONG 100000

SET TRIMSPOOL ON

SET LONGCHUNKSIZE 90000

SPOOL gen_constraint.sql


SELECT
dbms_metadata.get_ddl('REF_CONSTRAINT',constraint_name,owner)
|| ';' AS sqltext
FROM
(
SELECT
owner,
constraint_name
FROM
dba_constraints c
WHERE
(owner,table_name) IN (SELECT DISTINCT SCHEMA_NAME,TABLE_NAME FROM DATA_TABLE WHERE MASKING_RULE = 'ADD') AND constraint_type = 'R'
) t1
UNION ALL
SELECT
dbms_metadata.get_ddl('CONSTRAINT',constraint_name,owner)
|| ';' AS sqltext
FROM
(
SELECT
owner,
constraint_name
FROM
dba_constraints c
WHERE
(owner,table_name) IN (SELECT DISTINCT SCHEMA_NAME,TABLE_NAME FROM DATA_TABLE WHERE MASKING_RULE = 'ADD') AND constraint_type <> 'R'
) t2;

SPOOL OFF



As the output contains blank lines, it skips the Alter table statement and the constraint is not created. I have been trying to figure out the issue, but no success.
Please help.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close