Roopesh Majeti
Roopesh Majeti

Reputation: 554

Informix - Tools to export and import triggers and stored procedures

Folks : If this is a repetitive question, please raise the flag so that i will delete the question.

I am currently looking for some Informix tools which can be used for exporting the triggers and stored procedures from one database and importing the same into an another database. Requesting help & pointers on the same.

Upvotes: 2

Views: 2089

Answers (1)

Jonathan Leffler
Jonathan Leffler

Reputation: 753695

DB-Schema (dbschema) is the standard answer:

  • dbschema -d dbname -f stored_procedure to export a specific stored procedure.
  • Use all to specify all stored procedures.

Triggers are on a specific table: getting the schema for that table will include the triggers. There isn't a way to get the triggers alone.

USAGE:

  dbschema { [-q] [-t tabname] [-s user] [-p user] [-r rolename] [-f procname]
           [-hd tabname] -d dbname [-w passwd] [-seq sequence] [-l [num]]
           [-u [ia] udtname [all]] [-it [Type]] [-ss [-si]] [filename]
           [-sl length] [-nw] }
           { [-q] -c [-ns] [filename] }


  -q      Suppress the db version from header

  -t      table name or "all" for all tables

  -s      synonyms created by user name
          or "all" for all users

  -p      permissions granted to user name
          or "all" for all users

  -r      create and grant of the role
          or "all" for all roles :Not a valid option for SE

  -f      SPL routine name
          or "all" for all SPL routines


  -hd     Histograms of the distribution for columns of
          of a specified table, a specific table column,
          or "all" for all tables.

  -d      database name

  -w      database password

  -seq    generate sequence specific syntax

  -u      Prints the definitions of user-defined data types

  -ui     Prints the definitions of user-defined data types,
          including type inheritance

  -ua     Prints the definitions of user-defined data types,
          including all functions and casts defined over a type

  -u all  Directs dbschema to include all the tables
          in the display of distributions

  -it     Type of isolation can be DR, CR, CS, RR or LC

  -l      set lock mode to wait [number] optional

  -ss     generate server specific syntax

  -si     excludes the generation of index storage clauses for
          non-fragmented tables

  -sl     the maximum length (in bytes) of unformatted CREATE TABLE and ALTER FRAGMENT statements.

          filename is the name
          of file that the SQL
          script goes in.

  -c      generate storage space and logical log definitions


  -ns     generate commands in non-sql format

  -nw     generate file with no specified owner 

Upvotes: 2

Related Questions