    indexing
    	status: "See notice at end of class."
    	date: "$Date: 2006-01-22 18:25:44 -0800 (Sun, 22 Jan 2006) $"
    	revision: "$Revision: 56675 $"
    	product: "EiffelStore"
    	database: "All bases"

    class interface
    	DB_PROC

    create
    	make (a_name: STRING_8)
    			-- Create an interface object to create
    			-- and execute stored procedure.
    		require
    			a_name_not_void: a_name /= Void
    		ensure
    			name_equal: name.is_equal (a_name)

    feature -- Initialization

    	make (a_name: STRING_8)
    			-- Create an interface object to create
    			-- and execute stored procedure.
    		require
    			a_name_not_void: a_name /= Void
    		ensure
    			name_equal: name.is_equal (a_name)

    feature -- Access

    	generating_type: STRING_8
    			-- Name of current object's generating type
    			-- (type of which it is a direct instance)
    			-- (from ANY)

    	generator: STRING_8
    			-- Name of current object's generating class
    			-- (base class of the type of which it is a direct instance)
    			-- (from ANY)

    feature -- Comparison

    	frozen deep_equal (some: ANY; other: like arg #1): BOOLEAN
    			-- Are `some' and `other' either both void
    			-- or attached to isomorphic object structures?
    			-- (from ANY)
    		ensure -- from ANY
    			shallow_implies_deep: standard_equal (some, other) implies Result
    			both_or_none_void: (some = Void) implies (Result = (other = Void))
    			same_type: (Result and (some /= Void)) implies some.same_type (other)
    			symmetric: Result implies deep_equal (other, some)

    	frozen equal (some: ANY; other: like arg #1): BOOLEAN
    			-- Are `some' and `other' either both void or attached
    			-- to objects considered equal?
    			-- (from ANY)
    		ensure -- from ANY
    			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.is_equal (other))

    	is_equal (other: like Current): BOOLEAN
    			-- Is `other' attached to an object considered
    			-- equal to current object?
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    		ensure -- from ANY
    			symmetric: Result implies other.is_equal (Current)
    			consistent: standard_is_equal (other) implies Result

    	frozen standard_equal (some: ANY; other: like arg #1): BOOLEAN
    			-- Are `some' and `other' either both void or attached to
    			-- field-by-field identical objects of the same type?
    			-- Always uses default object comparison criterion.
    			-- (from ANY)
    		ensure -- from ANY
    			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.standard_is_equal (other))

    	frozen standard_is_equal (other: like Current): BOOLEAN
    			-- Is `other' attached to an object of the same type
    			-- as current object, and field-by-field identical to it?
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    		ensure -- from ANY
    			same_type: Result implies same_type (other)
    			symmetric: Result implies other.standard_is_equal (Current)

    feature -- Status report

    	arguments_name: ARRAY [STRING_8]
    			-- Argument names

    	arguments_set: BOOLEAN
    			-- Have arguments been set?
    		ensure
    			Result = (arguments_name /= Void and arguments_type /= Void)

    	arguments_type: ARRAY [ANY]
    			-- Argument types

    	conforms_to (other: ANY): BOOLEAN
    			-- Does type of current object conform to type
    			-- of `other' (as per Eiffel: The Language, chapter 13)?
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void

    	exists: BOOLEAN
    			-- Does current procedure exist in server?
    		require
    			loaded: loaded

    	immediate_execution: BOOLEAN
    			-- Are requests immediately executed?
    			-- (default is `no').
    			-- (from DB_EXEC_USE)

    	is_tracing: BOOLEAN
    			-- Is trace option for SQL queries on?
    			-- (from DB_EXEC_USE)

    	loaded: BOOLEAN
    			-- Is current procedure loaded?

    	name: STRING_8
    			-- Procedure name

    	same_type (other: ANY): BOOLEAN
    			-- Is type of current object identical to type of `other'?
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    		ensure -- from ANY
    			definition: Result = (conforms_to (other) and other.conforms_to (Current))

    	text: STRING_8
    			-- SQL text of current procedure
    		require
    			exists: exists
    		ensure
    			result_not_void: Result /= Void

    	trace_output: FILE
    			-- Trace destination file
    			-- (from DB_EXEC_USE)

    feature {ANY} -- Status report

    	is_connected: BOOLEAN
    			-- Has connection to the database server succeeded?
    			-- (from DB_STATUS_USE)

    	is_ok: BOOLEAN
    			-- Is last SQL statement ok ?
    			-- (from DB_STATUS_USE)

    feature -- Status setting

    	change_name (new_name: STRING_8)
    			-- Change procedure name with `new_name'.
    		require
    			new_name_not_void: new_name /= Void
    		ensure
    			new_name.is_equal (name)
    			not_loaded: not loaded

    	set_arguments (args_name: like arguments_name; args_type: like arguments_type)
    			-- Set arguments_name of current
    			-- as a variable list of argument names.
    		require
    			args_name_not_void: args_name /= Void
    			args_type_not_void: args_type /= Void
    			same_count: args_name.count = args_type.count
    		ensure
    			arguments_name = args_name
    			arguments_type = args_type
    			arguments_set

    	set_immediate
    			-- Set queries to be executed with a
    			-- `EXECUTE IMMEDIATE' SQL  statement.
    			-- (from DB_EXEC_USE)
    		ensure -- from DB_EXEC_USE
    			execution_status: immediate_execution

    	set_no_arguments
    			-- No arguments for the current procedure
    		ensure
    			arguments_name = Void
    			arguments_type = Void
    			no_arguments: not arguments_set

    	set_trace
    			-- Trace queries sent to database server.
    			-- (from DB_EXEC_USE)
    		ensure -- from DB_EXEC_USE
    			trace_status: is_tracing

    	unset_immediate
    			-- Set queries to be executed with a
    			-- `PREPARE' followed by a execute SQL statement.
    			-- (from DB_EXEC_USE)
    		ensure -- from DB_EXEC_USE
    			execution_status: not immediate_execution

    	unset_trace
    			-- Do not trace queries sent to database server.
    			-- (from DB_EXEC_USE)
    		ensure -- from DB_EXEC_USE
    			trace_status: not is_tracing

    feature -- Duplication

    	copy (other: like Current)
    			-- Update current object using fields of object attached
    			-- to `other', so as to yield equal objects.
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    			type_identity: same_type (other)
    		ensure -- from ANY
    			is_equal: is_equal (other)

    	frozen deep_copy (other: like Current)
    			-- Effect equivalent to that of:
    			--		copy (`other' . deep_twin)
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    		ensure -- from ANY
    			deep_equal: deep_equal (Current, other)

    	frozen deep_twin: like Current
    			-- New object structure recursively duplicated from Current.
    			-- (from ANY)
    		ensure -- from ANY
    			deep_equal: deep_equal (Current, Result)

    	frozen standard_copy (other: like Current)
    			-- Copy every field of `other' onto corresponding field
    			-- of current object.
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    			type_identity: same_type (other)
    		ensure -- from ANY
    			is_standard_equal: standard_is_equal (other)

    	frozen standard_twin: like Current
    			-- New object field-by-field identical to `other'.
    			-- Always uses default copying semantics.
    			-- (from ANY)
    		ensure -- from ANY
    			standard_twin_not_void: Result /= Void
    			equal: standard_equal (Result, Current)

    	frozen twin: like Current
    			-- New object equal to `Current'
    			-- twin calls copy; to change copying/twining semantics, redefine copy.
    			-- (from ANY)
    		ensure -- from ANY
    			twin_not_void: Result /= Void
    			is_equal: Result.is_equal (Current)

    feature -- Basic operations

    	frozen default: like Current
    			-- Default value of object's type
    			-- (from ANY)

    	frozen default_pointer: POINTER
    			-- Default value of type `POINTER'
    			-- (Avoid the need to write `p'.default for
    			-- some `p' of type `POINTER'.)
    			-- (from ANY)

    	default_rescue
    			-- Process exception for routines with no Rescue clause.
    			-- (Default: do nothing.)
    			-- (from ANY)

    	frozen do_nothing
    			-- Execute a null action.
    			-- (from ANY)

    	drop
    			-- Drop current procedure from server.
    		require
    			exists: exists
    		ensure
    			not_loaded: not loaded

    	execute (destination: DB_EXPRESSION)
    			-- Execute current procedure with `destination'
    			-- be a DB_SELECTION or DB_CHANGE object mapping
    			-- entity values with procedure parameter names
    			-- if any.
    		require
    			destination_not_void: destination /= Void
    			exists: exists

    	execute_string (destination: DB_EXPRESSION; sql: STRING_8)
    			-- Execute using `sql' statement current procedure with `destination'
    			-- be a DB_SELECTION or DB_CHANGE object mapping
    			-- entity values with procedure parameter names
    			-- if any.
    		require
    			destination_not_void: destination /= Void
    			exists: exists

    	load
    			-- Load stored procedure name
    		require
    			is_connected: is_connected
    		ensure
    			loaded: loaded

    	store (sql: STRING_8)
    			-- Store current procedure with `sql' expression.
    		require
    			sql_not_void: sql /= Void
    			not_exists: not exists

    feature -- Output

    	io: STD_FILES
    			-- Handle to standard file setup
    			-- (from ANY)

    	out: STRING_8
    			-- New string containing terse printable representation
    			-- of current object
    			-- Was declared in ANY as synonym of tagged_out.
    			-- (from ANY)

    	print (some: ANY)
    			-- Write terse external representation of `some'
    			-- on standard output.
    			-- (from ANY)

    	frozen tagged_out: STRING_8
    			-- New string containing terse printable representation
    			-- of current object
    			-- Was declared in ANY as synonym of out.
    			-- (from ANY)

    feature -- Platform

    	operating_environment: OPERATING_ENVIRONMENT
    			-- Objects available from the operating system
    			-- (from ANY)

    invariant
    	implementation_not_void: implementation /= Void
    	load_and_exists: loaded implies (exists or not exists)

    		-- from ANY
    	reflexive_equality: standard_is_equal (Current)
    	reflexive_conformance: conforms_to (Current)

    indexing
    	copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
    	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
    	source: "[
    		Eiffel Software
    		356 Storke Road, Goleta, CA 93117 USA
    		Telephone 805-685-1006, Fax 805-685-6869
    		Website http://www.eiffel.com
    		Customer support http://support.eiffel.com
    	]"

    end -- class DB_PROC