- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xo::db::DB-oracle
::xo::db::DB-oracle create ...
Class Relations
::xotcl::Class create ::xo::db::DB-oracle \ -superclass {::xo::db::DB ::xo::db::oracle}Methods (to be applied on instances)
generate_psql (scripted)
# # in Oracle, we have to distinguish between functions and procs # set is_function [::xo::dc 0or1row is_function { select 1 from dual where exists (select 1 from user_arguments where package_name = upper(:package_name) and object_name = upper(:object_name) and position = 0) }] set function_args [:get_function_args $package_name $object_name] set function_args [:fix_function_args $function_args $package_name $object_name] set sql_info [:sql_arg_info $function_args $package_name $object_name] if {$is_function} { set sql [subst {BEGIN :1 := ${package_name}.${object_name}(\$sql_args); END;}] set sql_cmd {ns_ora exec_plsql_bind $db $sql 1 ""} } else { set sql [subst {BEGIN ${package_name}.${object_name}(\$sql_args); END;}] set sql_cmd {ns_ora dml $db $sql} } dict set sql_info body [subst { #function_args: $function_args set sql_args \[list\] foreach var \[list [dict get $sql_info arg_order]\] { set varname \[string tolower \$var\] if {\[info exists \$varname\]} { lappend sql_args "\$varname => :\$varname" } } set sql_args \[join \$sql_args ,\] set sql "$sql" db_with_handle -dbn \$dbn db { #:log "sql=$sql, sql_command=$sql_cmd" return \[ $sql_cmd \] } }] return $sql_infoget_all_package_functions (scripted)
# # Get all package functions (package name, object name) from Oracle # system catalogs. # return [::xo::dc list_of_lists [self proc] { select distinct package_name, object_name from user_arguments args where args.position > 0 and package_name is not null }]get_function_args (scripted)
# # In Oracle, args.default_value appears to be defunct and useless. # for now, we simply return a constant "unknown", otherwise the # argument would be required return [::xo::dc list_of_lists get_function_params { select args.argument_name, 'NULL' from user_arguments args where args.position > 0 and args.object_name = upper(:object_name) and args.package_name = upper(:package_name) order by args.position }]sets (scripted)
if {$sql eq ""} {set sql [:get_sql $qn]} if {$bind ne ""} {set bindOpt [list -bind $bind]} {set bindOpt ""} return [uplevel [list db_list_of_ns_sets -dbn $dbn $qn $sql {*}$bindOpt]]
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables