• Publicity: Public Only All

01-database-procs.tcl

An API for managing database queries.

Location:
packages/acs-tcl/tcl/01-database-procs.tcl
Created:
15 Apr 2000
Author:
Jon Salz <jsalz@arsdigita.com>
CVS Identification:
$Id: 01-database-procs.tcl,v 1.1.2.41 2022/08/29 09:06:15 gustafn Exp $

Procedures in this file

Detailed information

ad_column_type (public)

 ad_column_type [ -dbn dbn ] table_name column_name
Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Parameters:
table_name
column_name
Returns:
'numeric' for number type columns, 'text' otherwise Throws an error if no such column exists.
Author:
Yon Feldman <yon@arsdigita.com>

Partial Call Graph (max 5 caller/called nodes):
%3 db_column_type db_column_type (public) ad_column_type ad_column_type ad_column_type->db_column_type

Testcases:
No testcase defined.

db_0or1row (public)

 db_0or1row [ -dbn dbn ] [ -cache_key cache_key ] \
    [ -cache_pool cache_pool ] [ -subst subst ] statement_name sql \
    [ -bind bind ] [ -column_array column_array ] \
    [ -column_set column_set ]

Performs the SQL query sql. If a row is returned, sets variables to column values (or a set or array populated if -column_array or column_set is specified) and returns 1. If no rows are returned, returns 0.

Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
-cache_key
(optional)
Cache the result using given value as the key. Default is to not cache.
-cache_pool
(defaults to "db_cache_pool") (optional)
Override the default db_cache_pool
-subst
(defaults to "all") (optional)
Perform Tcl substitution in xql-files. Possible values: all, none, vars, commands
-bind
(optional)
bind variables, passed either as an ns_set id, or via bind value list
-column_array
(optional)
array to be populated with values
-column_set
(optional)
ns_set to tbe populated with values
Parameters:
statement_name
sql
Returns:
1 if variables are set, 0 if no rows are returned. If more than one row is returned, throws an error.

Partial Call Graph (max 5 caller/called nodes):
%3 test_db__0or1row db__0or1row (test acs-tcl) db_0or1row db_0or1row test_db__0or1row->db_0or1row test_db__1row db__1row (test acs-tcl) test_db__1row->db_0or1row test_db__caching db__caching (test acs-tcl) test_db__caching->db_0or1row db_exec db_exec (public) db_0or1row->db_exec db_qd_get_fullname db_qd_get_fullname (public) db_0or1row->db_qd_get_fullname db_with_handle db_with_handle (public) db_0or1row->db_with_handle

Testcases:
db__caching, db__0or1row, db__1row

db_1row (public)

 db_1row [ -subst subst ] [ args... ]

A wrapper for db_0or1row, which produces an error if no rows are returned.

Switches:
-subst
(defaults to "all") (optional)
Returns:
1 if variables are set.
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_object_procs_test acs_object_procs_test (test acs-tcl) db_1row db_1row test_acs_object_procs_test->db_1row test_acs_user__ban_approve acs_user__ban_approve (test acs-tcl) test_acs_user__ban_approve->db_1row test_acs_user__registered_user_p acs_user__registered_user_p (test acs-tcl) test_acs_user__registered_user_p->db_1row test_ad_context_bar_multirow ad_context_bar_multirow (test acs-tcl) test_ad_context_bar_multirow->db_1row test_ad_proc_permission_permission_p ad_proc_permission_permission_p (test acs-tcl) test_ad_proc_permission_permission_p->db_1row

Testcases:
test_apm_parameter__register, test_apm_package_instance__new, apm_version_names_compare, apm__test_info_file, site_node_get_children, acs_user__registered_user_p, acs_user__ban_approve, parameter_register_test, parameter__check_procs, community_cc_procs, person_procs_test, party_procs_test, db__1row, util_http_json_encoding, ad_context_bar_multirow, acs_object_procs_test, ad_proc_permission_permission_p

db_abort_transaction (public)

 db_abort_transaction [ -dbn dbn ]

Aborts all levels of a transaction. That is if this is called within several nested transactions, all of them are terminated. Use this instead of db_dml "abort" "abort transaction".

Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.

Partial Call Graph (max 5 caller/called nodes):
%3 test_db__transaction db__transaction (test acs-tcl) db_abort_transaction db_abort_transaction test_db__transaction->db_abort_transaction db_state_array_name_is db_state_array_name_is (private) db_abort_transaction->db_state_array_name_is db_with_handle db_with_handle (public) db_abort_transaction->db_with_handle

Testcases:
db__transaction

db_bind_var_substitution (public)

 db_bind_var_substitution sql [ bind ]

This proc emulates the bind variable substitution in the PostgreSQL driver. Since this is a temporary hack, we do it in Tcl instead of hacking up the driver to support plsql calls. This is only used for the db_exec_plpgsql function.

Parameters:
sql
bind (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_db_bind_var_substitution db_bind_var_substitution (test acs-tcl) db_bind_var_substitution db_bind_var_substitution test_db_bind_var_substitution->db_bind_var_substitution db_bind_var_quoted_p db_bind_var_quoted_p (private) db_bind_var_substitution->db_bind_var_quoted_p ns_dbquotevalue ns_dbquotevalue db_bind_var_substitution->ns_dbquotevalue

Testcases:
db_bind_var_substitution

db_blob_get (public)

 db_blob_get [ -dbn dbn ] [ -subst subst ] statement_name sql \
    [ args... ]

PostgreSQL only.

Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
-subst
(defaults to "all") (optional)
Perform Tcl substitution in xql-files. Possible values: all, none, vars, commands
Parameters:
statement_name
sql

Partial Call Graph (max 5 caller/called nodes):
%3 ad_arg_parser ad_arg_parser (public) db_driverkey db_driverkey (public) db_exec_lob db_exec_lob (private) db_qd_get_fullname db_qd_get_fullname (public) db_qd_replace_sql db_qd_replace_sql (public) db_blob_get db_blob_get db_blob_get->ad_arg_parser db_blob_get->db_driverkey db_blob_get->db_exec_lob db_blob_get->db_qd_get_fullname db_blob_get->db_qd_replace_sql

Testcases:
No testcase defined.

db_blob_get_file (public)

 db_blob_get_file [ -dbn dbn ] statement_name sql [ args... ]
Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.

TODO: This proc should probably be changed to take a final file argument, only, rather than the current args variable length argument list. Currently, it is called only 4 places in OpenACS, and each place args, if used at all, is always "-file $file". However, such a change might break custom code... I'm not sure. --atp@piskorski.com, 2003/04/09 11:39 EDT

Parameters:
statement_name
sql

Partial Call Graph (max 5 caller/called nodes):
%3 ad_arg_parser ad_arg_parser (public) db_driverkey db_driverkey (public) db_exec_lob db_exec_lob (private) db_qd_get_fullname db_qd_get_fullname (public) db_with_handle db_with_handle (public) db_blob_get_file db_blob_get_file db_blob_get_file->ad_arg_parser db_blob_get_file->db_driverkey db_blob_get_file->db_exec_lob db_blob_get_file->db_qd_get_fullname db_blob_get_file->db_with_handle

Testcases:
No testcase defined.

db_boolean (public)

 db_boolean bool

Converts a Tcl boolean (1/0) into a SQL boolean (t/f)

Parameters:
bool
Returns:
t or f

Partial Call Graph (max 5 caller/called nodes):
%3 test_db_boolean db_boolean (test acs-tcl) db_boolean db_boolean test_db_boolean->db_boolean

Testcases:
db_boolean

db_bounce_pools (public)

 db_bounce_pools [ -dbn dbn ]
Switches:
-dbn
(optional)
The database name to use. Uses the default database if not supplied.
Returns:
Call ns_db bouncepool on all pools for the named database.

Partial Call Graph (max 5 caller/called nodes):
%3 db_available_pools db_available_pools (public) db_bounce_pools db_bounce_pools db_bounce_pools->db_available_pools

Testcases:
No testcase defined.

db_column_exists (public)

 db_column_exists [ -dbn dbn ] table_name column_name
Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Parameters:
table_name
column_name
Returns:
1 if the row exists in the table, 0 if not.
Author:
Lars Pind <lars@pinds.com>

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_subsite_attributes acs_subsite_attributes (test acs-subsite) db_column_exists db_column_exists test_acs_subsite_attributes->db_column_exists db_string db_string (public) db_column_exists->db_string

Testcases:
acs_subsite_attributes

db_column_type (public)

 db_column_type [ -dbn dbn ] [ -complain ] table_name column_name
Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
-complain
(boolean) (optional)
throw an error when datatype is not found
Parameters:
table_name
column_name
Returns:
the Oracle Data Type for the specified column.
-1 if the table or column doesn't exist.
an error if table or column doesn't exist and -complain flag was specified
Author:
Yon Feldman <yon@arsdigita.com>

Partial Call Graph (max 5 caller/called nodes):
%3 test_datamodel__acs_attribute_check datamodel__acs_attribute_check (test acs-tcl) db_column_type db_column_type test_datamodel__acs_attribute_check->db_column_type db_string db_string (public) db_column_type->db_string

Testcases:
datamodel__acs_attribute_check

db_columns (public)

 db_columns [ -dbn dbn ] table_name
Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Parameters:
table_name
Returns:
a Tcl list of all the columns in the table with the given name.
Author:
Lars Pind <lars@pinds.com>
Changelog:
yon@arsdigita.com 20000711 changed to return lowercase column names

Partial Call Graph (max 5 caller/called nodes):
%3 test_datamodel__acs_attribute_check datamodel__acs_attribute_check (test acs-tcl) db_columns db_columns test_datamodel__acs_attribute_check->db_columns db_foreach db_foreach (public) db_columns->db_foreach

Testcases:
datamodel__acs_attribute_check

db_compatible_rdbms_p (public)

 db_compatible_rdbms_p db_type
Parameters:
db_type
Returns:
1 if the given db_type is compatible with the current RDBMS.

Partial Call Graph (max 5 caller/called nodes):
%3 db_type db_type (public) db_compatible_rdbms_p db_compatible_rdbms_p db_compatible_rdbms_p->db_type

Testcases:
No testcase defined.

db_dml (public)

 db_dml [ -dbn dbn ] [ -subst subst ] statement_name sql [ args... ]

Do a DML statement.

args can be one of: -clobs, -blobs, -clob_files or -blob_files. See the db-api doc referenced below for more information.

Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
-subst
(defaults to "all") (optional)
Perform Tcl substitution in xql-files. Possible values: all, none, vars, commands
Parameters:
statement_name
sql
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_apm__test_info_file apm__test_info_file (test acs-tcl) db_dml db_dml test_apm__test_info_file->db_dml test_db__transaction db__transaction (test acs-tcl) test_db__transaction->db_dml test_db__transaction_bug_3440 db__transaction_bug_3440 (test acs-tcl) test_db__transaction_bug_3440->db_dml ad_arg_parser ad_arg_parser (public) db_dml->ad_arg_parser db_driverkey db_driverkey (public) db_dml->db_driverkey db_exec db_exec (public) db_dml->db_exec db_qd_get_fullname db_qd_get_fullname (public) db_dml->db_qd_get_fullname db_with_handle db_with_handle (public) db_dml->db_with_handle

Testcases:
apm__test_info_file, db__transaction, db__transaction_bug_3440

db_driverkey (public)

 db_driverkey [ -handle_p handle_p ] dbn

Normally, a dbn is passed to this proc. Unfortunately, there are one or two cases where a proc that needs to call this one has only a db handle, not the dbn that handle came from. Therefore, they instead use -handle_p 1 and pass the db handle. Hmm, as of 2018, it seems that in most cases, db_driverkey is called with a handle.

Switches:
-handle_p
(defaults to "0") (optional)
Parameters:
dbn
Returns:
The driverkey for use in db_* API switch statements.
Author:
Andrew Piskorski <atp@piskorski.com>
Created:
2003/04/08

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_form_with_form_instance create_form_with_form_instance (test xowiki) db_driverkey db_driverkey test_create_form_with_form_instance->db_driverkey db_with_handle db_with_handle (public) db_driverkey->db_with_handle

Testcases:
create_form_with_form_instance

db_exec (public)

 db_exec [ -subst subst ] type db statement_name pre_sql [ ulevel ] \
    [ args... ]

A helper procedure to execute a SQL statement, potentially binding depending on the value of the $bind variable in the calling environment (if set).

Switches:
-subst
(defaults to "all") (optional)
Parameters:
type
db
statement_name
pre_sql
ulevel (defaults to "2")

Partial Call Graph (max 5 caller/called nodes):
%3 test_db__0or1row db__0or1row (test acs-tcl) db_exec db_exec test_db__0or1row->db_exec test_db__1row db__1row (test acs-tcl) test_db__1row->db_exec test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->db_exec db_driverkey db_driverkey (public) db_exec->db_driverkey db_qd_replace_sql db_qd_replace_sql (public) db_exec->db_qd_replace_sql ds_collect_db_call ds_collect_db_call (public) db_exec->ds_collect_db_call

Testcases:
db__0or1row, db__1row, xowiki_test_cases

db_exec_plsql (public)

 db_exec_plsql [ -dbn dbn ] statement_name sql [ -bind bind ]

Oracle: Executes a PL/SQL statement, and returns the variable of bind variable :1.

PostgreSQL: Performs a pl/pgsql function or procedure call. The caller must perform a select query that returns the value of the function.

Examples:

    # Oracle:
    db_exec_plsql delete_note {
        begin  note.del(:note_id);  end;
    }

    # PostgreSQL:
    db_exec_plsql delete_note {
        select note__delete(:note_id);
    }
    

If you need the return value, then do something like this:

    # Oracle:
    set new_note_id [db_exec_plsql create_note {
        begin
        :1 := note.new(
                       owner_id => :user_id,
                       title    => :title,
                       body     => :body,
                       creation_user => :user_id,
                       creation_ip   => :peeraddr,
                       context_id    => :package_id
                       );
        end;
    }]

    # PostgreSQL:
    set new_note_id [db_exec_plsql create_note {
        select note__new(
                         null,
                         :user_id,
                         :title,
                         :body,
                         'note',
                         now(),
                         :user_id,
                         :peeraddr,
                         :package_id
                         );
    }]
    

You can call several pl/SQL statements at once, like this:

    # Oracle:
    db_exec_plsql delete_note {
        begin
        note.del(:note_id);
        note.del(:another_note_id);
        note.del(:yet_another_note_id);
        end;
    }

    # PostgreSQL:
    db_exec_plsql delete_note {
        select note__delete(:note_id);
        select note__delete(:another_note_id);
        select note__delete(:yet_another_note_id);
    }
    
If you are using xql files then put the body of the query in a yourfilename-oracle.xql or yourfilename-postgresql.xql file, as appropriate. E.g. the first example transformed to use xql files looks like this:

yourfilename.tcl:

    db_exec_plsql delete_note {}

yourfilename-oracle.xql:

    <fullquery name="delete_note">
    <querytext>
    begin
    note.del(:note_id);
    end;
    </querytext>
    </fullquery>

yourfilename-postgresql.xql:

    <fullquery name="delete_note">
    <querytext>
    select note__delete(:note_id);
    </querytext>
    </fullquery>

Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
-bind
(optional)
Parameters:
statement_name
sql
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_db_bind_var_substitution db_bind_var_substitution (test acs-tcl) db_exec_plsql db_exec_plsql test_db_bind_var_substitution->db_exec_plsql db_driverkey db_driverkey (public) db_exec_plsql->db_driverkey db_exec db_exec (public) db_exec_plsql->db_exec db_exec_plpgsql db_exec_plpgsql (private) db_exec_plsql->db_exec_plpgsql db_qd_get_fullname db_qd_get_fullname (public) db_exec_plsql->db_qd_get_fullname db_qd_replace_sql db_qd_replace_sql (public) db_exec_plsql->db_qd_replace_sql

Testcases:
db_bind_var_substitution

db_flush_cache (public)

 db_flush_cache [ -cache_key_pattern cache_key_pattern ] \
    [ -cache_pool cache_pool ]

Flush the given cache of entries with keys that match the given pattern.

Switches:
-cache_key_pattern
(defaults to "*") (optional)
The "string match" pattern used to flush keys (default is to flush all entries)
-cache_pool
(defaults to "db_cache_pool") (optional)
The pool to flush (default is to flush db_cache_pool)
Author:
Don Baccus <dhogasa@pacifier.com>

Partial Call Graph (max 5 caller/called nodes):
%3 test_db__caching db__caching (test acs-tcl) db_flush_cache db_flush_cache test_db__caching->db_flush_cache

Testcases:
db__caching

db_foreach (public)

 db_foreach [ -dbn dbn ] [ -subst subst ] statement_name sql \
    [ args... ]

Usage:

db_foreach statement-name sql [ -bind bind_set_id | -bind bind_value_list ] [ -column_array array_name | -column_set set_name ] code_block [ if_no_rows if_no_rows_block ]

Performs the SQL query sql, executing code_block once for each row with variables set to column values (or a set or array populated if -column_array or column_set is specified). If the query returns no rows, executes if_no_rows_block (if provided). In place of 'if_no_rows' also the 'else' keyword can be used.

Example:

db_foreach greeble_query "select foo, bar from greeble" {
        ns_write "<li>foo=$foo; bar=$bar\n"
    } if_no_rows {
        # This block is optional.
        ns_write "<li>No greebles!\n"
    }

Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
-subst
(defaults to "all") (optional)
Parameters:
statement_name
sql

Partial Call Graph (max 5 caller/called nodes):
%3 test_db__db_foreach db__db_foreach (test acs-tcl) db_foreach db_foreach test_db__db_foreach->db_foreach test_db__transaction_bug_3440 db__transaction_bug_3440 (test acs-tcl) test_db__transaction_bug_3440->db_foreach ad_arg_parser ad_arg_parser (public) db_foreach->ad_arg_parser

Testcases:
db__db_foreach, db__transaction_bug_3440

db_get_database (public)

 db_get_database [ -dbn dbn ]

PostgreSQL only.

Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Returns:
the database name from the first database pool. It assumes the datasource is properly formatted since we've already verified that we can connect to the pool.

Partial Call Graph (max 5 caller/called nodes):
%3 db_available_pools db_available_pools (public) db_get_database db_get_database db_get_database->db_available_pools

Testcases:
No testcase defined.

db_get_dbhost (public)

 db_get_dbhost [ -dbn dbn ]

PostgreSQL only.

Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Returns:
the name of the database host from the first database pool. It assumes the datasource is properly formatted since we've already verified that we can connect to the pool.

Partial Call Graph (max 5 caller/called nodes):
%3 db_available_pools db_available_pools (public) db_get_dbhost db_get_dbhost db_get_dbhost->db_available_pools

Testcases:
No testcase defined.

db_get_password (public)

 db_get_password [ -dbn dbn ]
Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Returns:
the password parameter from the driver section of the first database pool for the dbn.

Partial Call Graph (max 5 caller/called nodes):
%3 db_available_pools db_available_pools (public) db_get_password db_get_password db_get_password->db_available_pools

Testcases:
No testcase defined.

db_get_pgbin (public)

 db_get_pgbin [ -dbn dbn ]

PostgreSQL only.

Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Returns:
the pgbin parameter from the driver section of the first database pool.

Partial Call Graph (max 5 caller/called nodes):
%3 db_available_pools db_available_pools (public) db_get_pgbin db_get_pgbin db_get_pgbin->db_available_pools

Testcases:
No testcase defined.

db_get_port (public)

 db_get_port [ -dbn dbn ]

PostgreSQL only.

Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Returns:
the port number from the first database pool. It assumes the datasource is properly formatted since we've already verified that we can connect to the pool. It returns an empty string for an empty port value.

Partial Call Graph (max 5 caller/called nodes):
%3 db_available_pools db_available_pools (public) db_get_port db_get_port db_get_port->db_available_pools

Testcases:
No testcase defined.

db_get_sql_user (public)

 db_get_sql_user [ -dbn dbn ]

Oracle only.

Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Returns:
a valid Oracle user@database/password string to access a database through sqlplus.

This proc may well work for databases other than Oracle, but its return value won't really be of any use.

Partial Call Graph (max 5 caller/called nodes):
%3 db_available_pools db_available_pools (public) db_get_sql_user db_get_sql_user db_get_sql_user->db_available_pools

Testcases:
No testcase defined.

db_get_username (public)

 db_get_username [ -dbn dbn ]
Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Returns:
the username parameter from the driver section of the first database pool for the dbn.

Partial Call Graph (max 5 caller/called nodes):
%3 db_available_pools db_available_pools (public) db_get_username db_get_username db_get_username->db_available_pools

Testcases:
No testcase defined.

db_known_database_types (public)

 db_known_database_types
Returns:
a list of three-element lists describing the database engines known to OpenACS. Each sublist contains the internal database name (used in file paths, etc), the driver name, and a "pretty name" to be used in selection forms displayed to the user. The nsv containing the list is initialized by the bootstrap script and should never be referenced directly by user code.

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

db_list (public)

 db_list [ -dbn dbn ] [ -cache_key cache_key ] \
    [ -cache_pool cache_pool ] [ -subst subst ] statement_name sql \
    [ -bind bind ]
Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
-cache_key
(optional)
Cache the result using given value as the key. Default is to not cache.
-cache_pool
(defaults to "db_cache_pool") (optional)
Override the default db_cache_pool
-subst
(defaults to "all") (optional)
Perform Tcl substitution in xql-files. Possible values: all, none, vars, commands
-bind
(optional)
bind variables, passed either as an ns_set id, or via bind value list
Parameters:
statement_name
sql
Returns:
a Tcl list of the values in the first column of the result of SQL query sql. If sql doesn't return any rows, returns an empty list.

Partial Call Graph (max 5 caller/called nodes):
%3 test_db__caching db__caching (test acs-tcl) db_list db_list test_db__caching->db_list test_db__list_variants db__list_variants (test acs-tcl) test_db__list_variants->db_list db_exec db_exec (public) db_list->db_exec db_getrow db_getrow (private) db_list->db_getrow db_qd_get_fullname db_qd_get_fullname (public) db_list->db_qd_get_fullname db_with_handle db_with_handle (public) db_list->db_with_handle

Testcases:
db__caching, db__list_variants

db_list_of_lists (public)

 db_list_of_lists [ -dbn dbn ] [ -cache_key cache_key ] \
    [ -cache_pool cache_pool ] [ -with_headers ] [ -subst subst ] \
    [ -columns_var columns_var ] statement_name sql [ -bind bind ]
Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
-cache_key
(optional)
Cache the result using given value as the key. Default is to not cache.
-cache_pool
(defaults to "db_cache_pool") (optional)
Override the default db_cache_pool
-with_headers
(boolean) (optional)
when specified, first line of returned list of lists will always be the list of column names as reported by the database. Useful when you want to dynamically assign variables to values returned in the list of lists.
-subst
(defaults to "all") (optional)
Perform Tcl substitution in xql-files. Possible values: all, none, vars, commands
-columns_var
(optional)
-bind
(optional)
bind variables, passed either as an ns_set id, or via bind value list
Parameters:
statement_name
sql
Returns:
a Tcl list, each element of which is a list of all column values in a row of the result of the SQL querysql. If sql doesn't return any rows, returns an empty list, unless with_headers flag was specified and in this case the only element in the list will be the list of headers. It checks if the element is I18N and replaces it, thereby reducing the need to do this with every single package

Partial Call Graph (max 5 caller/called nodes):
%3 test_auth_authority_api auth_authority_api (test acs-authentication) db_list_of_lists db_list_of_lists test_auth_authority_api->db_list_of_lists test_db__caching db__caching (test acs-tcl) test_db__caching->db_list_of_lists test_db__list_variants db__list_variants (test acs-tcl) test_db__list_variants->db_list_of_lists test_parameter__check_procs parameter__check_procs (test acs-tcl) test_parameter__check_procs->db_list_of_lists acs::icanuse acs::icanuse (public) db_list_of_lists->acs::icanuse db_exec db_exec (public) db_list_of_lists->db_exec db_getrow db_getrow (private) db_list_of_lists->db_getrow db_qd_get_fullname db_qd_get_fullname (public) db_list_of_lists->db_qd_get_fullname db_with_handle db_with_handle (public) db_list_of_lists->db_with_handle

Testcases:
auth_authority_api, parameter__check_procs, db__caching, db__list_variants

db_list_of_ns_sets (public)

 db_list_of_ns_sets [ -dbn dbn ] [ -subst subst ] \
    [ -columns_var columns_var ] statement_name sql [ -bind bind ]
Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
-subst
(defaults to "all") (optional)
-columns_var
(optional)
-bind
(optional)
bind variables, passed either as an ns_set id, or via bind value list
Parameters:
statement_name - The name of the query.
sql - The SQL to be executed.
Returns:
a list of ns_sets with the values of each column of each row returned by the SQL query specified.
list of ns_sets, one per each row return by the SQL query

Partial Call Graph (max 5 caller/called nodes):
%3 test_db__caching db__caching (test acs-tcl) db_list_of_ns_sets db_list_of_ns_sets test_db__caching->db_list_of_ns_sets test_db__db_foreach db__db_foreach (test acs-tcl) test_db__db_foreach->db_list_of_ns_sets test_db__list_variants db__list_variants (test acs-tcl) test_db__list_variants->db_list_of_ns_sets test_db__transaction_bug_3440 db__transaction_bug_3440 (test acs-tcl) test_db__transaction_bug_3440->db_list_of_ns_sets acs::icanuse acs::icanuse (public) db_list_of_ns_sets->acs::icanuse db_exec db_exec (public) db_list_of_ns_sets->db_exec db_getrow db_getrow (private) db_list_of_ns_sets->db_getrow db_qd_get_fullname db_qd_get_fullname (public) db_list_of_ns_sets->db_qd_get_fullname db_with_handle db_with_handle (public) db_list_of_ns_sets->db_with_handle

Testcases:
db__db_foreach, db__caching, db__transaction_bug_3440, db__list_variants

db_load_sql_data (public)

 db_load_sql_data [ -dbn dbn ] [ -callback callback ] file

Loads a CSV formatted file into a table using PostgreSQL's COPY command or Oracle's SQL*Loader utility. The filename format consists of a sequence number used to control the order in which tables are loaded, and the table name with "-" replacing "_". This is a bit of a kludge but greatly speeds the loading of large amounts of data, such as is done when various "ref-*" packages are installed.

Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
-callback
(defaults to "apm_ns_write_callback") (optional)
Parameters:
file - Filename in the format dd-table-name.ctl where 'dd' is a sequence number used to control the order in which data is loaded. This file is an RDBMS-specific data loader control file.

Partial Call Graph (max 5 caller/called nodes):
%3 ad_file ad_file (public) ad_tmpdir ad_tmpdir (public) apm_callback_and_log apm_callback_and_log (public) db_driverkey db_driverkey (public) db_get_database db_get_database (public) db_load_sql_data db_load_sql_data db_load_sql_data->ad_file db_load_sql_data->ad_tmpdir db_load_sql_data->apm_callback_and_log db_load_sql_data->db_driverkey db_load_sql_data->db_get_database

Testcases:
No testcase defined.

db_multirow (public)

 db_multirow [ -local ] [ -append ] [ -upvar_level upvar_level ] \
    [ -unclobber ] [ -extend extend ] [ -dbn dbn ] \
    [ -cache_key cache_key ] [ -cache_pool cache_pool ] \
    [ -subst subst ] var_name statement_name sql [ args... ]
Switches:
-local
(boolean) (optional)
-append
(boolean) (optional)
-upvar_level
(defaults to "1") (optional)
-unclobber
(boolean) (optional)
If set, will cause the proc to not overwrite local variables. Actually, what happens is that the local variables will be overwritten, so you can access them within the code block. However, if you specify -unclobber, we will revert them to their original state after execution of this proc. Usage:
db_multirow [ -local ] [ -upvar_level n_levels_up ] [ -append ] [ -extend column_list ] var-name statement-name sql [ -bind bind_set_id | -bind bind_value_list ] code_block [ if_no_rows if_no_rows_block ]

Performs the SQL query sql, saving results in variables of the form var_name:1, var_name:2, etc, setting var_name:rowcount to the total number of rows, and setting var_name:columns to a list of column names.

If "cache_key" is set, cache the array that results from the query *and* any code block for future use. When this result is returned from cache, THE CODE BLOCK IS NOT EXECUTED. Therefore, any values calculated by the code block that aren't listed as arguments to "extend" will not be created. In practice this impacts relatively few queries, but do take care.

You can not simultaneously append to and cache a nonempty multirow.

Each row also has a column, rownum, automatically added and set to the row number, starting with 1. Note that this will override any column in the SQL statement named 'rownum', also if you're using the Oracle rownum pseudo-column.

If the -local is passed, the variables defined by db_multirow will be set locally (useful if you're compiling dynamic templates in a function or similar situations). Use the -upvar_level switch to specify how many levels up the variable should be set.

You may supply a code block, which will be executed for each row in the loop. This is very useful if you need to make computations that are better done in Tcl than in SQL, for example using ns_urlencode or ns_quotehtml, etc. When the Tcl code is executed, all the columns from the SQL query will be set as local variables in that code. Any changes made to these local variables will be copied back into the multirow.

You may also add additional, computed columns to the multirow, using the -extend { col_1 col_2 ... } switch. This is useful for things like constructing a URL for the object retrieved by the query.

If you're constructing your multirow through multiple queries with the same set of columns, but with different rows, you can use the -append switch. This causes the rows returned by this query to be appended to the rows already in the multirow, instead of starting a clean multirow, as is the normal behavior. The columns must match the columns in the original multirow, or an error will be thrown.

Your code block may call continue in order to skip a row and not include it in the multirow. Or you can call break to skip this row and quit looping.

Notice the nonstandard numbering (everything else in Tcl starts at 0); the reason is that the graphics designer, a non programmer, may wish to work with row numbers.

Example:

db_multirow -extend { user_url } users users_query {
        select user_id first_names, last_name, email from cc_users
    } {
        set user_url [acs_community_member_url -user_id $user_id]
    }
-extend
(optional)
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
-cache_key
(optional)
Cache the result using given value as the key. Default is to not cache.
-cache_pool
(defaults to "db_cache_pool") (optional)
Override the default db_cache_pool
-subst
(defaults to "all") (optional)
Perform Tcl substitution in xql-files. Possible values: all, none, vars, commands
Parameters:
var_name
statement_name
sql
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_db__caching db__caching (test acs-tcl) db_multirow db_multirow test_db__caching->db_multirow test_db__transaction_bug_3440 db__transaction_bug_3440 (test acs-tcl) test_db__transaction_bug_3440->db_multirow ad_arg_parser ad_arg_parser (public) db_multirow->ad_arg_parser db_multirow_helper db_multirow_helper (private) db_multirow->db_multirow_helper db_qd_get_fullname db_qd_get_fullname (public) db_multirow->db_qd_get_fullname template::adp_level template::adp_level (public) db_multirow->template::adp_level

Testcases:
db__caching, db__transaction_bug_3440

db_multirow_group_last_row_p (public)

 db_multirow_group_last_row_p -column column

Used inside the code_block to db_multirow to ask whether this row is the last row before the value of 'column' changes, or the last row of the result set.

This is useful when you want to build up a multirow for a master/slave table pair, where you only want one row per row in the master table, but you want to include data from the slave table in a column of the multirow.

Here's an example:

    # Initialize the lines variable to hold a list of order line summaries
    set lines [list]

    # Start building the multirow. We add the dynamic column 'lines_pretty', which will
    # contain the pretty summary of the order lines.
    db_multirow -extend { lines_pretty } orders select_orders_and_lines {
        select o.order_id,
        o.customer_name,
        l.item_name,
        l.quantity
        from   orders o,
        order_lines l
        where  l.order_id = o.order_id
        order  by o.order_id, l.item_name
    } {
        lappend lines "$quantity $item_name"
        if { [db_multirow_group_last_row_p -column order_id] } {
            # Last row of this order, prepare the pretty version of the order lines
            set lines_pretty [join $lines ", "]

            # Reset the lines list, so we start from a fresh with the next row
            set lines [list]
        } else {
            # There are yet more order lines to come for this order,
            # continue until we've collected all the order lines
            # The 'continue' keyword means this line will not be added to the resulting multirow
            continue
        }
    }
    

Switches:
-column
(required)
The name of the column defining the groups.
Returns:
1 if this is the last row before the column value changes, 0 otherwise.
Author:
Lars Pind <lars@collaboraid.biz>

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

db_name (public)

 db_name [ -dbn dbn ]
Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Returns:
the name of the database as reported by the driver.

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_object_procs_test acs_object_procs_test (test acs-tcl) db_name db_name test_acs_object_procs_test->db_name test_cr_item_search_triggers cr_item_search_triggers (test acs-content-repository) test_cr_item_search_triggers->db_name test_datamodel__named_constraints datamodel__named_constraints (test acs-tcl) test_datamodel__named_constraints->db_name db_with_handle db_with_handle (public) db_name->db_with_handle

Testcases:
cr_item_search_triggers, datamodel__named_constraints, acs_object_procs_test

db_nextval (public)

 db_nextval [ -dbn dbn ] sequence

Example:

    set new_object_id [db_nextval acs_object_id_seq]
    

Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Parameters:
sequence - the name of an SQL sequence
Returns:
the next value for a sequence. This can utilize a pool of sequence values.
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_object_procs_test acs_object_procs_test (test acs-tcl) db_nextval db_nextval test_acs_object_procs_test->db_nextval test_ad_proc_permission_grant_and_revoke ad_proc_permission_grant_and_revoke (test acs-tcl) test_ad_proc_permission_grant_and_revoke->db_nextval test_ad_proc_permission_permission_p ad_proc_permission_permission_p (test acs-tcl) test_ad_proc_permission_permission_p->db_nextval ad_log ad_log (public) db_nextval->ad_log db_0or1row db_0or1row (public) db_nextval->db_0or1row db_driverkey db_driverkey (public) db_nextval->db_driverkey db_list db_list (public) db_nextval->db_list db_string db_string (public) db_nextval->db_string

Testcases:
acs_object_procs_test, ad_proc_permission_grant_and_revoke, ad_proc_permission_permission_p

db_nth_pool_name (public)

 db_nth_pool_name [ -dbn dbn ] n
Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Parameters:
n
Returns:
the name of the pool used for the nth-nested selection (0-relative).

Partial Call Graph (max 5 caller/called nodes):
%3 db_available_pools db_available_pools (public) db_nth_pool_name db_nth_pool_name db_nth_pool_name->db_available_pools

Testcases:
No testcase defined.

db_null (public, deprecated)

 db_null
Deprecated. Invoking this procedure generates a warning.

Returns:
an empty string, which Oracle thinks is null. Deprecated: This routine was invented to provide an RDBMS-specific null value but doesn't actually work. I (DRB) left it in to speed porting - we should really clean up the code and pull out the calls instead, though.
See Also:
  • ""

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) db_null db_null db_null->ad_log_deprecated

Testcases:
No testcase defined.

db_nullify_empty_string (public, deprecated)

 db_nullify_empty_string string
Deprecated. Invoking this procedure generates a warning.

A convenience function that returns [db_null] if $string is the empty string. Deprecated: essentially just returns the passed string.

Parameters:
string
See Also:
  • db_null

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) db_nullify_empty_string db_nullify_empty_string db_nullify_empty_string->ad_log_deprecated

Testcases:
No testcase defined.

db_quote (public, deprecated)

 db_quote string
Deprecated. Invoking this procedure generates a warning.

Quotes a string value to be placed in a SQL statement. Use the built-in ns_dbquotevalue instead, which cares also about the surrounding quotes.

Parameters:
string
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) db_quote db_quote db_quote->ad_log_deprecated

Testcases:
No testcase defined.

db_release_unused_handles (public)

 db_release_unused_handles [ -dbn dbn ]

Releases any database handles that are presently unused.

Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.

Partial Call Graph (max 5 caller/called nodes):
%3 test_db__caching db__caching (test acs-tcl) db_release_unused_handles db_release_unused_handles test_db__caching->db_release_unused_handles test_db__db_foreach db__db_foreach (test acs-tcl) test_db__db_foreach->db_release_unused_handles test_db__transaction_bug_3440 db__transaction_bug_3440 (test acs-tcl) test_db__transaction_bug_3440->db_release_unused_handles db_available_pools db_available_pools (public) db_release_unused_handles->db_available_pools db_state_array_name_is db_state_array_name_is (private) db_release_unused_handles->db_state_array_name_is ds_collect_db_call ds_collect_db_call (public) db_release_unused_handles->ds_collect_db_call

Testcases:
db__db_foreach, db__caching, db__transaction_bug_3440

db_resultrows (public)

 db_resultrows [ -dbn dbn ]
Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Returns:
the number of rows affected by the last DML command.

Partial Call Graph (max 5 caller/called nodes):
%3 test_xowiki_test_cases xowiki_test_cases (test xowiki) db_resultrows db_resultrows test_xowiki_test_cases->db_resultrows db_driverkey db_driverkey (public) db_resultrows->db_driverkey db_last_used_handle db_last_used_handle (private) db_resultrows->db_last_used_handle

Testcases:
xowiki_test_cases

db_source_sql_file (public)

 db_source_sql_file [ -dbn dbn ] [ -callback callback ] file

Sources a SQL file into Oracle (SQL*Plus format file) or PostgreSQL (psql format file).

Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
-callback
(defaults to "apm_ns_write_callback") (optional)
Parameters:
file

Partial Call Graph (max 5 caller/called nodes):
%3 ad_file ad_file (public) apm_callback_and_log apm_callback_and_log (public) db_driverkey db_driverkey (public) db_get_database db_get_database (public) db_get_dbhost db_get_dbhost (public) db_source_sql_file db_source_sql_file db_source_sql_file->ad_file db_source_sql_file->apm_callback_and_log db_source_sql_file->db_driverkey db_source_sql_file->db_get_database db_source_sql_file->db_get_dbhost

Testcases:
No testcase defined.

db_source_sqlj_file (public)

 db_source_sqlj_file [ -dbn dbn ] [ -callback callback ] file

Oracle only.

Sources a SQLJ file using loadjava.

Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
-callback
(defaults to "apm_ns_write_callback") (optional)
Parameters:
file

Partial Call Graph (max 5 caller/called nodes):
%3 ad_file ad_file (public) apm_callback_and_log apm_callback_and_log (public) db_get_sql_user db_get_sql_user (public) db_source_sqlj_file db_source_sqlj_file db_source_sqlj_file->ad_file db_source_sqlj_file->apm_callback_and_log db_source_sqlj_file->db_get_sql_user

Testcases:
No testcase defined.

db_string (public)

 db_string [ -dbn dbn ] [ -cache_key cache_key ] \
    [ -cache_pool cache_pool ] [ -subst subst ] statement_name sql \
    [ -default default ] [ -bind bind ]
Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
-cache_key
(optional)
Cache the result using given value as the key. Default is to not cache.
-cache_pool
(defaults to "db_cache_pool") (optional)
Override the default db_cache_pool
-subst
(defaults to "all") (optional)
Perform Tcl substitution in xql-files. Possible values: all, none, vars, commands
-default
(optional)
Return value in case the SQL query returns no value
-bind
(optional)
bind variables, passed either as an ns_set id, or via bind value list
Parameters:
statement_name
sql
Returns:
the first column of the result of the SQL query sql. If the query doesn't return a row, returns default or raises an error if no default is provided.

Partial Call Graph (max 5 caller/called nodes):
%3 test_db__caching db__caching (test acs-tcl) db_string db_string test_db__caching->db_string test_db__string db__string (test acs-tcl) test_db__string->db_string test_db__transaction db__transaction (test acs-tcl) test_db__transaction->db_string test_db__transaction_bug_3440 db__transaction_bug_3440 (test acs-tcl) test_db__transaction_bug_3440->db_string test_nullchar nullchar (test acs-tcl) test_nullchar->db_string db_exec db_exec (public) db_string->db_exec db_qd_get_fullname db_qd_get_fullname (public) db_string->db_qd_get_fullname db_with_handle db_with_handle (public) db_string->db_with_handle

Testcases:
db__caching, db__transaction, db__transaction_bug_3440, nullchar, db__string

db_table_exists (public)

 db_table_exists [ -dbn dbn ] table_name
Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Parameters:
table_name
Returns:
1 if a table with the specified name exists in the database, otherwise 0.
Authors:
Don Baccus <dhogaza@pacifier.com>
Lars Pind <lars@pinds.com>

Partial Call Graph (max 5 caller/called nodes):
%3 test_datamodel__acs_object_type_check datamodel__acs_object_type_check (test acs-tcl) db_table_exists db_table_exists test_datamodel__acs_object_type_check->db_table_exists db_driverkey db_driverkey (public) db_table_exists->db_driverkey db_string db_string (public) db_table_exists->db_string

Testcases:
datamodel__acs_object_type_check

db_tables (public)

 db_tables [ -pattern pattern ] [ -dbn dbn ]
Switches:
-pattern
(optional)
Will be used as LIKE 'pattern%' to limit the number of tables returned.
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Returns:
a Tcl list of all the tables owned by the connected user.
Authors:
Don Baccus <dhogaza@pacifier.com>
Lars Pind <lars@pinds.com>
Changelog:
yon@arsdigita.com 20000711 changed to return lowercase table names

Partial Call Graph (max 5 caller/called nodes):
%3 db_driverkey db_driverkey (public) db_foreach db_foreach (public) db_tables db_tables db_tables->db_driverkey db_tables->db_foreach

Testcases:
No testcase defined.

db_transaction (public)

 db_transaction [ -dbn dbn ] transaction_code [ args... ]

Usage: db_transaction transaction_code [ on_error { error_code_block } ] Executes transaction_code with transactional semantics. This means that either all of the database commands within transaction_code are committed to the database or none of them are. Multiple db_transactions may be nested (end transaction is transparently ns_db dml'ed when the outermost transaction completes).

To handle errors, use db_transaction {transaction_code} on_error {error_code_block}. Any error generated in transaction_code will be caught automatically and process control will transfer to error_code_block with a variable errmsg set. The error_code block can then clean up after the error, such as presenting a usable error message to the user. Following the execution of error_code_block the transaction will be aborted. If you want to explicitly abort the transaction, call db_abort_transaction from within the transaction_code block or the error_code block.

Example 1:
In this example, db_dml triggers an error, so control passes to the on_error block which prints a readable error.

    db_transaction {
        db_dml test "nonsense"
    } on_error {
        ad_return_error "Error in blah/foo/bar" "The error was: $errmsg"
    }
    
Example 2:
In this example, the second command, "nonsense" triggers an error. There is no on_error block, so the transaction is immediately halted and aborted.
    db_transaction {
        db_dml test {insert into footest values(1)}
        nonsense
        db_dml test {insert into footest values(2)}
    }
    

Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Parameters:
transaction_code

Partial Call Graph (max 5 caller/called nodes):
%3 test_db__transaction db__transaction (test acs-tcl) db_transaction db_transaction test_db__transaction->db_transaction test_db__transaction_bug_3440 db__transaction_bug_3440 (test acs-tcl) test_db__transaction_bug_3440->db_transaction db_abort_transaction db_abort_transaction (public) db_transaction->db_abort_transaction db_abort_transaction_p db_abort_transaction_p (private) db_transaction->db_abort_transaction_p db_release_unused_handles db_release_unused_handles (public) db_transaction->db_release_unused_handles db_state_array_name_is db_state_array_name_is (private) db_transaction->db_state_array_name_is db_type db_type (public) db_transaction->db_type

Testcases:
db__transaction, db__transaction_bug_3440

db_type (public)

 db_type
Returns:
the RDBMS type (i.e. oracle, postgresql) this OpenACS installation is using. The nsv ad_database_type is set up during the bootstrap process.

Partial Call Graph (max 5 caller/called nodes):
%3 test_db_bind_var_substitution db_bind_var_substitution (test acs-tcl) db_type db_type test_db_bind_var_substitution->db_type test_nullchar nullchar (test acs-tcl) test_nullchar->db_type test_sql_date sql_date (test acs-templating) test_sql_date->db_type

Testcases:
db_bind_var_substitution, nullchar, sql_date

db_version (public)

 db_version
Returns:
the RDBMS version (i.e. 8.1.6 is a recent Oracle version; 7.1 a recent PostgreSQL version)

Partial Call Graph (max 5 caller/called nodes):
%3 test_sql_date sql_date (test acs-templating) db_version db_version test_sql_date->db_version

Testcases:
sql_date

db_with_handle (public)

 db_with_handle [ -dbn dbn ] db code_block

Place a usable database handle in db and executes code_block.

Switches:
-dbn
(optional)
Database name to use. If empty_string, use the default database
Parameters:
db - Name of the handle variable used in the code block
code_block - code block to be executed with handle

Partial Call Graph (max 5 caller/called nodes):
%3 test_db__0or1row db__0or1row (test acs-tcl) db_with_handle db_with_handle test_db__0or1row->db_with_handle test_db__1row db__1row (test acs-tcl) test_db__1row->db_with_handle test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->db_with_handle ad_log ad_log (public) db_with_handle->ad_log db_available_pools db_available_pools (public) db_with_handle->db_available_pools ds_collect_db_call ds_collect_db_call (public) db_with_handle->ds_collect_db_call

Testcases:
db__0or1row, db__1row, xowiki_test_cases

db_write_blob (public)

 db_write_blob [ -dbn dbn ] statement_name sql [ args... ]
Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Parameters:
statement_name
sql

Partial Call Graph (max 5 caller/called nodes):
%3 ad_arg_parser ad_arg_parser (public) db_exec_lob db_exec_lob (private) db_qd_get_fullname db_qd_get_fullname (public) db_with_handle db_with_handle (public) db_write_blob db_write_blob db_write_blob->ad_arg_parser db_write_blob->db_exec_lob db_write_blob->db_qd_get_fullname db_write_blob->db_with_handle

Testcases:
No testcase defined.

db_write_clob (public)

 db_write_clob [ -dbn dbn ] statement_name sql [ args... ]
Switches:
-dbn
(optional)
The database name to use. If empty_string, uses the default database.
Parameters:
statement_name
sql

Partial Call Graph (max 5 caller/called nodes):
%3 ad_arg_parser ad_arg_parser (public) db_driverkey db_driverkey (public) db_exec db_exec (public) db_qd_get_fullname db_qd_get_fullname (public) db_with_handle db_with_handle (public) db_write_clob db_write_clob db_write_clob->ad_arg_parser db_write_clob->db_driverkey db_write_clob->db_exec db_write_clob->db_qd_get_fullname db_write_clob->db_with_handle

Testcases:
No testcase defined.
[ show source ]