The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

orac_Informix.pm - the Informix module to the Orac tool

DESCRIPTION

This code is a database object that can be created by the Orac tool. It inherits from orac_Base, which has all the basic data and methods. Some of those are called from here, some are overridden, most are inherited and used as is.

PUBLIC METHODS

 &new()
 &init1()
 &init2()

new

This method overrides orac_Base's; well, actually we call it to set ourselves up, but then we do set Informix specific variables. We return the new object instance, just like we're supose to do.

init1

This methode overrides the "do nothing" version in orac_Base. It's job is to do whatever we need to do just before trying to connect. We return nothing.

init1

This methode overrides the "do nothing" version in orac_Base. It's job is to do whatever we need to do just after successfully connecting to the database. In our case, we always ChopBlanks. We return nothing.

SEMI-PUBLIC METHODS

These should only be called by main:: functions, like the menu functions, or by ourselves, obviously. :-)

onstat_databases

Show the list of the databases, and info about them. No args, no return value.

onstat_dbspaces

Show the list of DBSpaces, and info about them. No args, no return value.

onstat_chunks

Show the list of DB chunks, and info about them. No args, no return value.

onstat_onconfig_params

Show the current $ONCONFIG file. No args, no return value.

dbschema_syns

Show the synonums for all tables. No args, no return value.

dbschema_grants

Show the grants on this database. No args, no return value.

NOT IMPLEMENTED YET!

dbschema_indices

Show the list of the indicies for all tables, and info about them. No args, no return value.

NOT IMPLEMENTED YET!

dbschema_schema

Show the schema for the databases. No args, no return value.

NOT IMPLEMENTED YET!

onstat_threads

Show the application threads running in the database. No args, no return value.

NOT IMPLEMENTED YET!

onstat_curr_sql

Show the current SQL statements running in the database. No args, no return value.

NOT IMPLEMENTED YET!

onstat_blobs

Show the list of blob fields, and info about them. No args, no return value.

onstat_io_profile

Show the I/O going on in the database. No args, no return value.

onstat_databases

Show the list of locks being held, and info about them. No args, no return value.

NOT IMPLEMENTED YET!

PRIVATE METHODS

These should only be called ourself, they are support functions. There are currently none, or at least none that care to tell anyone about. :-)

EXPERIMENTAL METHODS

These functions are ones that I'm developing and should not be called by anyone else, unless you like living dangerously. :-) It is hoped that one day, they'll be good enough to move into orac_Base.

 &generic_hlist()
 &sql_file_exists()

Andy, you can move this if you want. (i.e. feel brave :-)

generic_hlist

A function to produce a dialog screen, with HList widget to show data--all generic. It will go down as many levels as there are SQL files, which must be numbered sequentially.

The function executes the SQL, and expects either a set of rows with 1 column each, or 1 row with a set of columns. It takes the data, and makes each value an item in the HList widget. If it can find another level below this SQL script, it gives the item a "folder" looking icon, else just a "file" looking icon.

Clicking on closed folders executes the next level of SQL, and displays the results in the HList widget. Icons on the new level are assigned as above. The value clicked on is parsed, split by the separator char (ARG2) and those are the bind parameters to the SQL. It is assumed the SQL will take those and do the right thing. If there is a mismatch on number of bind parameters, an error will occurr. [Implementation question: should we search the SQL and get the number of placeholders and send only that number of parameters?]

Clicking on a file, or bottom level item, currently does nothing. [Implementation question: should we put a function to be called in orac_Base here, and let the various modules override that if they want to do more than just show items?]

 ARG1 = name of SQL, and title of dialog (e.g. Tables)
 ARG2 = separator character

There is no return value.

Note: this functoin calls orac_Show(), therefore, it does not really return until the dialog is dismissed.

show_or_hide

A support function of generic_hlist, DO NOT CALL DIRECTLY!!!

This is called when an entry is double-clicked. It decides what to do. Basically ripped off from the "Adv. Perl Prog." book. :-)

add_contents

A support function of generic_hlist, DO NOT CALL DIRECTLY!!!

show_or_hide calls this when it needs to add new items. Here is where the SQL is called.

sql_file_exists

Does the SQL file exist? This is normally used to find out if there is another level down.

 ARG1 = database type
 ARG2 = SQL subroutine name (e.g. Tables, Views, ...)
 ARG3 = level number

It returns TRUE (non-zero) if the file exists and is readable, FALSE otherwise.