views::record_view (public)
views::record_view [ -object_id object_id ] [ -viewer_id viewer_id ] \ [ -type type ]
Defined in packages/views/tcl/views-procs.tcl
Record an object view by viewer_id
- Switches:
- -object_id (optional)
- -viewer_id (optional)
- -type (optional)
- Returns:
- the total view count for the user
- Author:
- Jeff Davis davis@xarg.net
- Created:
- 2004-01-30
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- view_api_test_without_type, view_api_test_with_type
Source code: if { $type ne "" } { if { $type in {views_count unique_views last_viewed} } { # if the type is on of the list it will conflict on the views::get procedure error "views::record_view type cannot be views_count, unique_views or last_viewed" } #TYPE is PL/SQL reserver word in ORACLE #set view_type $type set views_by_type [db_exec_plsql record_view_by_type {}] } if {[catch {set views [db_exec_plsql record_view {}]} views]} { set views 0 } return $viewsGeneric XQL file: packages/views/tcl/views-procs.xql
PostgreSQL XQL file: <fullquery name="views::record_view.record_view"> <querytext> select views__record_view(:object_id, :viewer_id) </querytext> </fullquery> <fullquery name="views::record_view.record_view_by_type"> <querytext> select views_by_type__record_view(:object_id, :viewer_id, :type) </querytext> </fullquery>packages/views/tcl/views-procs-postgresql.xql
Oracle XQL file: <fullquery name="views::record_view.record_view"> <querytext> begin :1 := views_view.record_view(p_object_id => :object_id, p_viewer_id => :viewer_id); end; </querytext> </fullquery> <fullquery name="views::record_view.record_view_by_type"> <querytext> begin :1 := views_view_by_type.record_view(p_object_id => :object_id, p_viewer_id => :viewer_id, p_view_type => :type); end; </querytext> </fullquery>packages/views/tcl/views-procs-oracle.xql