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

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.