Home
The Toolkit for Online Communities
17103 Community Members, 1 member online, 2363 visitors today
Log In Register
OpenACS Home : ACS API Browser : ds_get_db_command_info

ds_get_db_command_info (public)

ds_get_db_command_info
Defined in packages/acs-developer-support/tcl/acs-developer-support-procs.tcl

Get a Tcl list with { num_commands total_ms } for the database commands for the request. Returns the empty string if the information is not available.

Source code:
 
     set result {}
     if { [ds_enabled_p] && [ds_collection_enabled_p] } {
         if { [nsv_exists ds_request $::ad_conn(request).db] } {
             set total 0
             set counter 0
             foreach { handle command statement_name sql start end errno error } [nsv_get ds_request $::ad_conn(request).db] {
                 set total [expr { $total + ($end - $start) }]
                 if { [lindex $command 0] in { dml exec 1row 0or1row select } } {
                     incr counter
                 }
             }
             set result [list $counter $total]
         }
     }
     return $result
 

Generic XQL file:
<?xml version="1.0"?>
<queryset>

<fullquery name="ds_user_select_widget.users">      
      <querytext>
       
	select u.user_id as user_id_from_db, 
	       acs_object.name(user_id) as name, 
	       p.email 
	from   users u, 
	       parties p 
	where  u.user_id = p.party_id 
	order by name    
      </querytext>
</fullquery>

 
</queryset>

Postgresql XQL file:
<?xml version="1.0"?>

<queryset>
   <rdbms><type>postgresql</type><version>7.1</version></rdbms>

<fullquery name="ds_instance_id.acs_kernel_id_get">      
      <querytext>

	select package_id from apm_packages
	where package_key = 'acs-developer-support'
	limit 1
    
      </querytext>
</fullquery>

 
<fullquery name="ds_require_permission.name">      
      <querytext>
      select acs_object__name(:object_id) 
      </querytext>
</fullquery>

 
<fullquery name="ds_support_url.ds_support_url">      
      <querytext>

	select site_node__url(node_id) 
	from site_nodes s, apm_packages p
	where p.package_id = s.object_id
	and p.package_key ='acs-developer-support'
	limit 1
    
      </querytext>
</fullquery>

 
<fullquery name="ds_user_select_widget.users">      
      <querytext>
       
	select u.user_id as user_id_from_db, 
	       acs_object__name(user_id) as name, 
	       p.email 
	from   users u, 
	       parties p 
	where  u.user_id = p.party_id 
	order by name
    
      </querytext>
</fullquery>

 
</queryset>

Oracle XQL file:
<?xml version="1.0"?>

<queryset>
   <rdbms><type>oracle</type><version>8.1.6</version></rdbms>

<fullquery name="ds_instance_id.acs_kernel_id_get">      
      <querytext>
      
	select package_id from apm_packages
	where package_key = 'acs-developer-support'
	and rownum=1
    
      </querytext>
</fullquery>

 
<fullquery name="ds_require_permission.name">      
      <querytext>
      select acs_object.name(:object_id) from dual
      </querytext>
</fullquery>

 
<fullquery name="ds_support_url.ds_support_url">      
      <querytext>
      
	select site_node.url(node_id) 
	from site_nodes s, apm_packages p
	where p.package_id = s.object_id
	and p.package_key ='acs-developer-support'
	and rownum = 1
    
      </querytext>
</fullquery>

 
<fullquery name="ds_user_select_widget.users">      
      <querytext>
       
	select u.user_id as user_id_from_db, 
	       acs_object.name(user_id) as name, 
	       p.email 
	from   users u, 
	       parties p 
	where  u.user_id = p.party_id 
    
      </querytext>
</fullquery>

 
</queryset>

[ hide source ] | [ make this the default ]
Show another procedure: