GENERATE_DDL_FOR_SERVER

<< Click to Display Table of Contents >>

Navigation:  Streaming SQL Reference Guide > Basic Building Blocks > Functions > Built-in Functions > General Management Functions >

GENERATE_DDL_FOR_SERVER

Previous pageReturn to chapter overviewNext page

Returns a create statement for a named server.

Syntax

SYS_BOOT.MGMT.GENERATE_DDL_FOR_SERVER(server_name);

 

where server_name is the name of the server.

5_2_indicator

Version 5.2 Feature

As of version 5.2, you no longer need to use the preface SYS_BOOT.MGMT.

Example

SELECT STATEMENT FROM TABLE(SYS_BOOT.MGMT.GENERATE_DDL_FOR_SERVER('FileReaderServer'));

'STATEMENT'

CREATE OR REPLACE SERVER "FileReaderServer"'

FOREIGN DATA WRAPPER ECDA'

'OPTIONS ('

'  CHARACTER_ENCODING 'UTF-8','

'  CLASSNAME 'com.sqlstream.aspen.namespace.common.FileSetColumnSet','

'  DIRECTORY '/tmp','

'  FILENAME_PATTERN 'buses\.log','

'  PARSER 'CSV','

'  SEPARATOR ',','

'  SKIP_HEADER 'false''

');'

 

In a case when a server was created with the following code:

CREATE OR REPLACE SERVER "FileReaderServer"

FOREIGN DATA WRAPPER ECDA

OPTIONS (classname 'com.sqlstream.aspen.namespace.common.FileSetColumnSet',

 parser 'CSV',

       character_encoding 'UTF-8',

       separator ',',

       skip_header 'false',

       directory '/tmp',

       filename_pattern 'buses\.log'