1/************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27#ifndef __com_sun_star_sdbc_XOutParameters_idl__ 28#define __com_sun_star_sdbc_XOutParameters_idl__ 29 30#ifndef __com_sun_star_uno_XInterface_idl__ 31#include <com/sun/star/uno/XInterface.idl> 32#endif 33 34#ifndef __com_sun_star_sdbc_SQLException_idl__ 35#include <com/sun/star/sdbc/SQLException.idl> 36#endif 37 38 module com { module sun { module star { module sdbc { 39 40 41/** is used to register Out-Parameters for stored procedures. 42 43 44 <p> 45 SDBC provides a stored procedure SQL escape that allows stored procedures 46 to be called in a standard way for all RDBMSs. This escape syntax has one 47 form that includes a result parameter and one that does not. If used, the 48 result parameter must be registered as an OUT parameter. The other parameters 49 can be used for input, output, or both. Parameters are referred to sequentially, 50 by number. The first parameter is 1. 51 </p> 52 */ 53published interface XOutParameters: com::sun::star::uno::XInterface 54{ 55 56 /** registers the designated output parameter. This version of 57 the method 58 <member scope="com::sun::star::sdbc">XOutParameters::registerOutParameter()</member> 59 should be used for a user-named or REF output parameter. Examples 60 of user-named types include: STRUCT, DISTINCT, OBJECT, and named array 61 types. 62 63 64 <p> 65 Before executing a stored procedure call, you must explicitly 66 call 67 <member scope="com::sun::star::sdbc">XOutParameters::registerOutParameter()</member> 68 to register the type from 69 <type scope="com::sun::star::sdbc">DataType</type> 70 for each OUT parameter. 71 <br/> 72 For a user-named parameter the fully-qualified SQL type name of the 73 parameter should also be given, while a REF parameter requires that the 74 fully-qualified type name of the referenced type be given. 75 An SDBC driver that does not need the type code and type name information 76 may ignore it. To be portable, however, applications should always provide 77 these values for user-named and REF parameters. 78 </p> 79 <p>Although it is intended for user-named and REF parameters, 80 this method may be used to register a parameter of any SDBC type. 81 If the parameter does not have a user-named or REF type, the 82 typeName parameter is ignored. 83 </p> 84 <p> 85 <b>Note:</b> When reading the value of an out parameter, you 86 must use the 87 <code>getXXX</code> 88 method whose type XXX corresponds to the 89 parameter's registered SQL type. 90 </p> 91 @param parameterIndex 92 the first parameter is 1, the second is 2, ... 93 @param sqlType 94 the type of the column to register 95 @param typeName 96 the name of the type 97 @throws SQLException 98 if a database access error occurs. 99 */ 100 void registerOutParameter([in]long parameterIndex, [in]long sqlType, 101 [in]string typeName) 102 raises (SQLException); 103 //------------------------------------------------------------------------- 104 105 /** registers the OUT parameter in ordinal position 106 <code>parameterIndex</code> 107 to the SDBC type 108 <code>sqlType</code> 109 . All 110 OUT parameters must be registered before a stored procedure is executed. 111 112 113 <p> 114 The SDBC type specified by 115 <code>sqlType</code> 116 for an OUT parameter determines the type that must be used in the 117 <code>get</code> 118 method to read the value of that parameter. 119 This version of 120 <member scope="com::sun::star::sdbc">XOutParameters::registerOutParameter()</member> 121 should be 122 used when the parameter is of SDBC type 123 <member scope="com::sun::star::sdbc">DataType::NUMERIC</member> 124 or 125 <member scope="com::sun::star::sdbc">DataType::DECIMAL</member> 126 . 127 @param parameterIndex 128 the first parameter is 1, the second is 2, ... 129 @param sqlType 130 the type of the column to register 131 @param scale 132 the scale of the type 133 @throws SQLException 134 if a database access error occurs. 135 </p> 136 */ 137 void registerNumericOutParameter([in]long parameterIndex, [in]long sqlType, 138 [in]long scale) 139 raises (SQLException); 140}; 141 142//============================================================================= 143 144}; }; }; }; 145 146/*=========================================================================== 147===========================================================================*/ 148#endif 149