package_table_columns_for_type (private)
package_table_columns_for_type object_type
Defined in packages/acs-subsite/tcl/package-procs.tcl
Generates the list of tables and columns that are parameters of the object named
NEW
for PL/SQL package associated with this object type.Note we limit the argument list to only object_type to make it possible to use
util_memoize_flush
to clear any cached values for this procedure.
- Parameters:
- object_type - The object type for which we are generating the list
- Returns:
- a list of lists where each list element is a pair of table name, column name
- Author:
- Michael Bryzek <mbryzek@arsdigita.com>
- Created:
- 12/2000
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set object_name "NEW" acs_object_type::get -object_type $object_type -array acs_type set package_name $acs_type(package_name) # We need to hit the data dictionary to find the table and column names # for all the arguments to the object_types function/procedure # named "object_name." Note that we join against # acs_object_types to select out the tables and columns for the # object_type up the type tree starting from this object_type. # # NOTE: This query is tuned already, yet still slow (~1 # second on my box right now). Be careful modifying # it... It's slow because of the underlying data dictionary query # against user_arguments return [db_list_of_lists select_object_type_param_list {}]Generic XQL file: packages/acs-subsite/tcl/package-procs.xql
PostgreSQL XQL file: <fullquery name="package_table_columns_for_type.select_object_type_param_list"> <querytext> select cols.table_name, cols.column_name from user_tab_columns cols, (select upper(t2.table_name) as table_name from acs_object_types t1, acs_object_types t2 where t1.tree_sortkey between t2.tree_sortkey and tree_right(t2.tree_sortkey) and t1.object_type = :object_type) t where cols.column_name in (select args.arg_name from acs_function_args args where args.function = upper(:package_name) || '__' || upper(:object_name)) and cols.table_name = t.table_name </querytext> </fullquery>packages/acs-subsite/tcl/package-procs-postgresql.xql
Oracle XQL file: <fullquery name="package_table_columns_for_type.select_object_type_param_list"> <querytext> select cols.table_name, cols.column_name from user_tab_columns cols, (select upper(t.table_name) as table_name from acs_object_types t start with t.object_type = :object_type connect by prior t.supertype = t.object_type) t where cols.column_name in (select args.argument_name from user_arguments args where args.position > 0 and args.object_name = upper(:object_name) and args.package_name = upper(:package_name)) and cols.table_name = t.table_name </querytext> </fullquery>packages/acs-subsite/tcl/package-procs-oracle.xql