My Oracle Support Banner

How to use Back Slash '\' In Dbms_metadata.get_ddl Package (Doc ID 2395320.1)

Last updated on JULY 27, 2021

Applies to:

Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Oracle Database Cloud Service - Version N/A and later
Oracle Database - Enterprise Edition - Version 12.2.0.1 and later
Information in this document applies to any platform.

Goal

While using the dbms_metadata.get_ddl function to extract the creation DDL for an object,
like to get the commands splitted by '\' (slash) and not by ';' (semi-colon) using the following commands:

begin
dbms_metadata.set_transform_param ( dbms_metadata.SESSION_TRANSFORM, 'SQLTERMINATOR', true );
dbms_output.put_line(dbms_metadata.get_ddl ( 'TABLE','TANLE_NAME','SCHEMA_NAME'));
end;
 

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.