Catch bugs: "System. Data. OracleClient. OracleException: ORA-06550: 1st rows, 7th columns: \ nPLS-00306: number of parameters or type when 'Meeting _ NOTICE_CREATE 'is called
This error took me a long time (several hours) and threw it aside. Today, one parameter is excluded and the cause is finally known. T.T
The attribute of the object class does not have an initial value. This error occurs when the null value is inserted. So remember to assign a value. Set string to string. empty.
Codesmith for throwing an object class:
<% @ CodeTemplate Language = "C #" TargetLanguage = "Text" Src = "" Inherits = "" Debug = "False" Description = "Template description here." %>
<% @ Assembly Name = "SchemaExplorer" %>
<% @ Assembly Name = "System. Design" %>
<% @ Assembly Name = "System. Data. OracleClient" %>
<% @ Import Namespace = "System. Data. OracleClient" %>
<% @ Import Namespace = "SchemaExplorer" %>
<% @ Property Name = "SourceTables" Type = "SchemaExplorer. TableSchemaCollection" Category = "Connection" Description = "Tables of the sytem." %>
<% @ Assembly Name = "System. Data" %>
<% @ Import Namespace = "System. Data" %>
<% WriteData (); %>
<SCRIPT runat = "template">
// My methods here.
Public void writedata (){
Response. Write (@ "Private const int int_init = 0;
Private const string int_string = string. empty;
Private const datetime ini_date = system. datetime. maxvalue ;");
Response. Write ("\ r \ n ");
Foreach (tableschema table in sourcetables ){
// Response. Write ("public class" + Table. Name + "\ r \ n {\ r \ n ");
Foreach (columnschema column in table. columns ){
Response. write ("private" + getdbtype (column. datatype) [0] + "_" + column. name. tolower () + getdbtype (column. datatype) [1] + "; \ r \ n ");
Response. write ("// <summary> \ r \ N //" + column. description + "\ r \ N // </Summary> \ r \ n ");
Response. Write ("public" + getdbtype (column. datatype) [0] + "" + column. Name + "\ r \ n {\ r \ n ");
Response. Write ("Get {return _" + column. Name. tolower () + ";}\ r \ n ");
Response. Write ("set {_" + column. Name. tolower () + "= value;} \ r \ n ");
}
// Response. Write ("\ r \ n} \ r \ n ");
}
}
Public string GetDbTypeStr (System. Data. DbType type ){
Return type. ToString ();
}
Public string [] GetDbType (System. Data. DbType type ){
String ret = string. Empty;
String iv = string. Empty;
Switch (type ){
Case DbType. String:
Ret = "string ";
Iv = "= INI_STRING ";
Break;
Case (dbtype) system. Data. oracleclient. oracletype. Number:
Case dbtype. int32:
Ret = "int ";
IV = "= ini_int ";
Break;
Case dbtype. int16:
Ret = "short ";
IV = "= ini_int ";
Break;
Case DbType. Int64:
Ret = "int ";
Iv = "= INI_INT ";
Break;
Case DbType. DateTime:
Ret = "DateTime ";
Iv = "= INI_DATE ";
Break;
Case DbType. Boolean:
Ret = "bool ";
Break;
Case DbType. Decimal:
Ret = "decimal ";
Break;
Case DbType. Double:
Ret = "double ";
Break;
}
Return new string [] {ret, iv };
}
</Script>