1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_sdbc_XOutParameters_idl__
24#define __com_sun_star_sdbc_XOutParameters_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_sdbc_SQLException_idl__
31#include <com/sun/star/sdbc/SQLException.idl>
32#endif
33
34 module com {  module sun {  module star {  module sdbc {
35
36
37/** is used to register Out-Parameters for stored procedures.
38
39
40	<p>
41	SDBC provides a stored procedure SQL escape that allows stored procedures
42	to be called in a standard way for all RDBMSs. This escape syntax has one
43	form that includes a result parameter and one that does not. If used, the
44	result parameter must be registered as an OUT parameter. The other parameters
45	can be used for input, output, or both. Parameters are referred to sequentially,
46	by number. The first parameter is 1.
47	</p>
48 */
49published interface XOutParameters: com::sun::star::uno::XInterface
50{
51
52	/** registers the designated output parameter.  This version of
53		the method
54		<member scope="com::sun::star::sdbc">XOutParameters::registerOutParameter()</member>
55		should be used for a user-named or REF output parameter. Examples
56		of user-named types include: STRUCT, DISTINCT, OBJECT, and named array
57		types.
58
59
60		<p>
61		Before executing a stored procedure call, you must explicitly
62		call
63		<member scope="com::sun::star::sdbc">XOutParameters::registerOutParameter()</member>
64		to register the type from
65		<type scope="com::sun::star::sdbc">DataType</type>
66		for each OUT parameter.
67		<br/>
68		For a user-named parameter the fully-qualified SQL type name of the
69		parameter should also be given, while a REF parameter requires that the
70		fully-qualified type name of the referenced type be given.
71		An SDBC driver that does not need the type code and type name information
72		may ignore it. To be portable, however, applications should always provide
73		these values for user-named and REF parameters.
74		</p>
75		<p>Although it is intended for user-named and REF parameters,
76		this method may be used to register a parameter of any SDBC type.
77		If the parameter does not have a user-named or REF type, the
78		typeName parameter is ignored.
79		</p>
80		<p>
81		<b>Note:</b> When reading the value of an out parameter, you
82		must use the
83		<code>getXXX</code>
84		method whose type XXX corresponds to the
85		parameter's registered SQL type.
86		</p>
87		@param parameterIndex
88			the first parameter is 1, the second is 2, ...
89		@param sqlType
90			the type of the column to register
91		@param typeName
92			the name of the type
93		@throws SQLException
94			if a database access error occurs.
95	 */
96	void registerOutParameter([in]long parameterIndex, [in]long sqlType,
97							  [in]string typeName)
98        raises (SQLException);
99	//-------------------------------------------------------------------------
100
101	/** registers the OUT parameter in ordinal position
102		<code>parameterIndex</code>
103		to the SDBC type
104		<code>sqlType</code>
105		. All
106		OUT parameters must be registered before a stored procedure is executed.
107
108
109		<p>
110		The SDBC type specified by
111		<code>sqlType</code>
112		for an OUT parameter determines the type that must be used in the
113		<code>get</code>
114		method to read the value of that parameter.
115		This version of
116		<member scope="com::sun::star::sdbc">XOutParameters::registerOutParameter()</member>
117		should be
118		used when the parameter is of SDBC type
119		<member scope="com::sun::star::sdbc">DataType::NUMERIC</member>
120		or
121		<member scope="com::sun::star::sdbc">DataType::DECIMAL</member>
122		.
123		@param parameterIndex
124			the first parameter is 1, the second is 2, ...
125		@param sqlType
126			the type of the column to register
127		@param scale
128			the scale of the type
129		@throws SQLException
130			if a database access error occurs.
131		</p>
132	 */
133	void registerNumericOutParameter([in]long parameterIndex, [in]long sqlType,
134							  		 [in]long scale)
135		raises (SQLException);
136};
137
138//=============================================================================
139
140}; }; }; };
141
142/*===========================================================================
143===========================================================================*/
144#endif
145