INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "Represents the notion of stored procedure"
project: "Visual Eiffel"
revision: "$Revision: 1.1 $"
copyright: "Copyright (C) 1996-2005 Object Tools Group"
license: "http://visual-eiffel.com/license"
cluster: dale
class DB_PROCEDURE
inherit

QUERY
rename
make as make_query
redefine
parameters,
sql_string
select
copy,
is_equal,
out
end

DB_CATALOG_ITEM
rename
copy as useless_copy,
is_equal as useless_is_equal,
out as useless_out
end
creation

attach,
open
creation {PROCEDURES}

make
feature -- Attributes:

name: STRING

proc_type: INTEGER

owner: STRING

qualifier: STRING

remarks: STRING
feature -- Commands:

open (db: DATABASE; s: STRING)
-- find this procedure in the list of procedures of the
-- specified database
require
valid_database: db /= void and then db.is_connected
supported: db.procedures /= void
valid_string: s /= void and then not s.is_empty

set_params_count (n: INTEGER)
-- set number of parameters for this stored procedure
require
valid_count: n > 0

use_return_value
-- treat this stored procedure as function and
-- assign the last parameter as return value
require
not_empty: parameters.count > 0
feature -- Queries:

parameters_list_available: BOOLEAN
-- returns True if and only if the parameters catalog
-- can be retrieved from server
require
attached: is_attached

parameters: PARAMETERS
-- query parameters

argument_count: INTEGER
-- total number of parameters except return value, if any
require
attached: is_attached
ensure
valid_result: Result >= 0

return_value: FIELD
-- return value
require
available: is_function
ensure
not_void: Result /= void

is_function, result_available: BOOLEAN
-- returns True only if there's result value for sure
require
attached: is_attached

is_procedure, result_not_available: BOOLEAN
-- returns True only if there's no result value for sure
require
attached: is_attached

sql_string: STRING
-- returns SQL string that can be prepared or executed
feature -- Validations:

valid_qualifier (q: STRING): BOOLEAN
-- table qualifier is Void if and only if it isn't used

valid_owner (o: STRING): BOOLEAN
-- table owner is Void if and only if it isn't used

valid_procedure_type (t: INTEGER): BOOLEAN
-- ...
feature {PROCEDURES}

make (db: DATABASE; q, o, n: STRING; pt: INTEGER; rem: STRING)
-- creation procedure; associates this procedure object with
-- the specified database and assigns all procedure's attributes
require
supported: db.procedures /= void
valid_database: db /= void and then db.is_connected
valid_qualifier: valid_qualifier (q)
valid_owner: valid_owner (o)
valid_name: n /= void and then not n.is_empty
valid_type: valid_procedure_type (pt)
end -- class DB_PROCEDURE

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES