HP c-tree-SQL ISQL and Tools manual Schema Export Utility dbschema, Dbschema, Import Begin, End

Models: c-tree-SQL ISQL and Tools

1 99
Download 99 pages 4.83 Kb
Page 89
Image 89

Schema Export Utility: dbschema

ADMIN@isis% dbschema -t dbp1,test_view rdsdb

DBSCHEMA

create table ADMIN.dbp1 (

c1 integer ) pctfree 20;

create view ADMIN.test_view ( fld

) as

select * from test_revoke1 ;

The following example uses the -p option with the % wildcard character to generate definitions for all stored procedures whose names begin with the characters foo:

ADMIN@isis% dbschema -p foo% rdsdb

DBSCHEMA

CREATE PROCEDURE ADMIN.foobar(in sno character (5), in sname character (20),

in sstatus smallint,

in scity character (15))

IMPORT

BEGIN

SQLIStatement stmt = new SQLIStatement("insert into s values ('foo', 'foo', 3, ' foo')"); stmt.execute();

END

The following example uses the -ooption to write all definitions for the rdsdb database to the file schema.sql:

dbschema -o schema.sql rdsdb

DBSCHEMA

/vol1/v70_rel_jsp/bin/dhserver <SQL SERVER 29100> -d rdsdb -h 394408 sqlnw_ks calling DDMJavaCache constructor

Creating loader object loader object created

Server 29100 done: Fri Jun 19 17:06:35 1998 ADMIN@isis%

ADMIN@isis% more schema.sql create table ADMIN.test_revoke1 (

fld

integer

) pctfree 20;

 

...

 

FairCom Corporation

6-3

Page 89
Image 89
HP c-tree-SQL ISQL and Tools manual Schema Export Utility dbschema, Dbschema, Import Begin, End