错误提示:Parameter 'l_ReStatus': No size set for variable length data type: String
背景: cmd.Parameters.Add("l_ReStatus", OracleType.VarChar).Direction = ParameterDirection.Output;
执行完cmd.ExecuteNonQuery();后直接进入catch语句
public bool RunProcZX(string User_Id,out string ReStatus)
{
OracleConnection conn = new OracleConnection(connStr);
conn.Open();
OracleCommand cmd = new OracleCommand("存储过程名", conn);
cmd.CommandType = CommandType.StoredProcedure;
//定义传入参数的类型。类型为OracleType.VarChar
cmd.Parameters.Add("l_User_Id", OracleType.VarChar).Direction = ParameterDirection.Input;
//传值
cmd.Parameters["l_User_Id"].Value = User_Id;
//传出参数,类似于c#中的out
cmd.Parameters.Add("l_ReStatus", OracleType.VarChar).Direction = ParameterDirection.Output;
try
{
cmd.ExecuteNonQuery();
ReStatus = cmd.Parameters["l_ReStatus"].Value.ToString();
return true;
}
catch
{
return false;
}
finally
{
conn.Close();
}
}
解决办法:cmd.Parameters.Add("l_ReStatus", OracleType.VarChar, 20).Direction = ParameterDirection.Output;
小注:
Parameter的参数设置长度(size属性)
实例化Parameter时,如果是字符型,一定要指定size属性(请使用截图显示的方法)
分享到:
相关推荐
table now includes all variable-length data fields at the end of some of the subtables. The disassembler now emits a comment if a buffer appears to be a ResourceTemplate, but cannot be disassembled ...
Even faster Key/Value store nosql embedded database engine utilizing the new MGIndex data structure with MurMur2 Hashing and WAH Bitmap indexes for duplicates. See Also More like this More by this...
which uses the methods GetPropValue/SetPropValue for reading/writing data. - FIX: The method TCustomProp.GetPropNames moved to the public section and returns the list of published-property names of ...
previously set variable or directive (e.g. ${foo}) ; Expressions in the INI file are limited to bitwise operators and parentheses: ; | bitwise OR ; ^ bitwise XOR ; & bitwise AND ; ~ bitwise NOT ; ! ...
'Chr() string encode' Tested with: AutoIT : v3. 3. 0.0 and AutoIT : v2.64. 0.0 and AutoHotKey: v1.0.48.5 The options: =========== 'Force Old Script Type' Grey means auto detect and is the ...
Other C++ Features Reference Arguments Function Overloading Default Arguments Variable-Length Arrays and alloca() Friends Exceptions Run-Time Type Information (RTTI) Casting Streams Preincrement and ...
Suppose if we have a declare an array of type String, then it will store only the String value not any other data type. When we have a closely related data of the same type and scope, it is better to...
active filter state and no filter state, as an alternative for 'Clear All Filters', which doesn't allow you to return back the filters. * Version 1.70: o Added /sort command-line option for ...
8.5.1 Create a New Data Type Using a Built-in Data Type 154 8.6 MAKING OUR CODE PRIVATE 154 8.7 ADDITIONAL RESOURCES 155 8.8 SELF-EVALUATION 156 Chapter 9 Introduction to Biopython 157 9.1 WHAT IS ...
String identifier for Client Certificate authentication. clone() - Method in class javax.servlet.http.Cookie Overrides the standard java.lang.Object.clone method to return a copy of this cookie. ...
framework adds support for typing arbitrary blocks of data and handling it accordingly. This doesn't sound like much, but it is your basic MIME-type support found in many browsers and mail tools ...
* TClientDataSet doesn‘t save data to file when FileName is set and there is no existing file on disk (Quality Central 2307). * Using the Delphi 7 version of midas.dll to open an XML file that was ...
This toolbox provides support for these normalization techniques, although no tool for feature extraction or SAD is provided. The Auditory Toolbox (Malcolm Slaney) and VOICEBOX (Mike Brooks) which ...
All of these delays are fixed, except for the queuing delays, which are variable. 17. a) 1000 km, 1 Mbps, 100 bytes b) 100 km, 1 Mbps, 100 bytes 18. 10msec; d/s; no; no 19. a) 500 kbps b) 64 ...
Syntax for CONVERT: CONVERT ( data_type [ ( length ) ] , expression [ , style ] ) 不带世纪数位 (yy) (1) 带世纪数位 (yyyy) 标准 输入/输出 (3) - 0 或 100 (1, 2) 默认设置 mon dd yyyy hh:miAM(或 PM...
Data Sources for Data Binding 333 Using the Data Form Wizard 334 Using the Windows Forms Class Viewer 338 Using the Windows Forms ActiveX Control Importer 338 Summary 340 Solutions Fast Track ...
.- Reduced the line sleep to 30 (tell me if this value doesn‘t work for you).27/4/981.7.0- Fixed a memory leak, thanks to Don Higgins.- Moved the string esErrorInFormatOfMsg to a property of SakPOP.-...
QWORD, and TBYTE Variables 5.3.5 - Declaring Floating Point Variables with REAL4, REAL8, and REAL10 5.4 - Creating Your Own Type Names with TYPEDEF 5.5 - Pointer Data Types 5.6 - ...
Hungarian Notation........................55 Variable Naming ..............................................................................56 Function Naming........................................