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