Я хочу вставить записи в таблицу оракулов с моей ниже хранимой процедурой
Ниже приведена процедура
Также ниже приводится описание таблицы ..
ID NOT NULL NUMBER
CMP NVARCHAR2(100)
SAP_ID NVARCHAR2(100)
ID_OD_COUNTCHANGE NVARCHAR2(100)
ID_OD_CHANGEDDATE DATE
RRH_COUNTCHANGE NVARCHAR2(100)
RRH_CHANGEDDATE DATE
TENANCY_COUNTCHANGE NVARCHAR2(100)
TENANCY_CHANGEDDATE DATE
RFS_DATE DATE
RFE1_DATE DATE
INFRA_PROVIDER NVARCHAR2(100)
IP_COLO_SITEID NVARCHAR2(100)
SITE_NAME NVARCHAR2(500)
R4GSTATE NVARCHAR2(100)
MW_INSTALLED NVARCHAR2(100)
DG_NONDG NVARCHAR2(100)
EB_NONEB NVARCHAR2(100)
TOWER_TYPE NVARCHAR2(100)
VENDOR_CODE NVARCHAR2(100)
RFCDATE DATE
POLITICAL_STATE_NAME NVARCHAR2(100)
POLITICAL_STATE_CODE NVARCHAR2(100)
SITE_DROP_DATE DATE
CITY_NAME NVARCHAR2(100)
NEID NVARCHAR2(100)
FACILITY_LATITUDE NVARCHAR2(100)
FACILITY_LONGITUDE NVARCHAR2(100)
RJ_STRUCTURE_TYPE NVARCHAR2(100)
RJ_JC_NAME NVARCHAR2(100)
RJ_JC_CODE NVARCHAR2(100)
COMPANY_CODE NVARCHAR2(100)
BLCHAIN_RESP_MSG_MASTER NVARCHAR2(100)
BLCHAIN_RESP_CODE_MASTER NVARCHAR2(100)
SITE_ADDRESS CLOB
BLCHAIN_RESP_MSG_INCREMENTAL VARCHAR2(100)
BLCHAIN_RESP_CODE_INCREMENTAL VARCHAR2(100)
CREATED_BY NVARCHAR2(100)
CREATED_DATE DATE
SEL_CHANGED_VAL NVARCHAR2(100)
Пожалуйста, предложите, что здесь не так.
ОБНОВЛЕНИЕ
PROCEDURE INSERT_IPCOLO_DATA
(
P_SAPID IN NVARCHAR2,
P_R4GSTATE IN NVARCHAR2,
P_POLITICAL_STATE_NAME IN NVARCHAR2,
P_POLITICAL_STATE_CODE IN NVARCHAR2,
P_CMP IN NVARCHAR2,
P_SITE_NAME IN NVARCHAR2,
P_RFC_DATE IN DATE,
P_RFE1_DATE IN DATE,
P_SITE_DROP_DATE IN DATE,
P_INFRA_PROVIDER IN NVARCHAR2,
P_IPCOLO_SITEID IN NVARCHAR2,
P_IPSAP_VENDORCODE IN NVARCHAR2,
P_MW_INSTALLED IN NVARCHAR2,
P_DG_AVAILABLE IN NVARCHAR2,
P_EB_AVAILABLE IN NVARCHAR2,
P_TOWER_TYPE IN NVARCHAR2,
P_ID_OD_COUNTCHANGE IN NVARCHAR2,
P_ID_OD_CHANGEDDATE IN DATE,
P_RRH_COUNTCHANGE IN NVARCHAR2,
P_RRH_CHANGEDDATE IN DATE,
P_TENANCY_COUNTCHANGE IN NVARCHAR2,
P_TENANCY_CHANGEDDATE IN DATE,
P_CITY_NAME IN NVARCHAR2,
P_NEID IN NVARCHAR2,
P_FAC_LATITUDE IN NVARCHAR2,
P_FAC_LONGITUDE IN NVARCHAR2,
P_RJ_STRUC_TYPE IN NVARCHAR2,
P_RJ_JC_NAME IN NVARCHAR2,
P_RJ_JC_CODE IN NVARCHAR2,
P_COMPANY_CODE IN NVARCHAR2,
P_CREATED_BY IN NVARCHAR2,
P_CHANEDVALUE IN NVARCHAR2,
P_RFS_DATE IN DATE,
TBL_INSERT OUT NUMBER
)
AS
vr_RRH_COUNTCHANGE nvarchar2(100);
vr_RRH_CHANGEDDATE date;
vr_TENANCY_COUNTCHANGE nvarchar2(100);
vr_TENANCY_CHANGEDDATE date;
vr_ID_OD_COUNTCHANGE nvarchar2(100);
vr_ID_OD_CHANGEDDATE date;
BEGIN
IF P_CHANEDVALUE = 'IDOD'
THEN
BEGIN
vr_ID_OD_COUNTCHANGE:= P_ID_OD_COUNTCHANGE;
vr_ID_OD_CHANGEDDATE:=P_ID_OD_CHANGEDDATE;
/* P_RRH_COUNTCHANGE :='';
P_RRH_CHANGEDDATE :='';
P_TENANCY_COUNTCHANGE :='';
P_TENANCY_CHANGEDDATE :=''; */
vr_TENANCY_COUNTCHANGE:='';
vr_TENANCY_CHANGEDDATE:= null;
vr_RRH_COUNTCHANGE:='';
vr_RRH_CHANGEDDATE:=null;
END;
END IF;
IF P_CHANEDVALUE = 'RRH'
THEN
BEGIN
/* P_ID_OD_COUNTCHANGE :='';
P_ID_OD_CHANGEDDATE :='';
P_TENANCY_COUNTCHANGE :='';
P_TENANCY_CHANGEDDATE :=''; */
vr_RRH_COUNTCHANGE:=P_RRH_COUNTCHANGE;
vr_RRH_CHANGEDDATE:=P_RRH_CHANGEDDATE;
vr_TENANCY_COUNTCHANGE:='';
vr_TENANCY_CHANGEDDATE:= null;
vr_ID_OD_COUNTCHANGE:='';
vr_ID_OD_CHANGEDDATE:=null;
END;
END IF;
IF P_CHANEDVALUE = 'Tenancy'
THEN
BEGIN
/* P_ID_OD_COUNTCHANGE :='';
P_ID_OD_CHANGEDDATE :='';
P_RRH_COUNTCHANGE :='';
P_RRH_CHANGEDDATE :=''; */
vr_TENANCY_COUNTCHANGE:=P_TENANCY_COUNTCHANGE;
vr_TENANCY_CHANGEDDATE:= P_TENANCY_CHANGEDDATE;
vr_RRH_COUNTCHANGE:='';
vr_RRH_CHANGEDDATE:=null;
vr_ID_OD_COUNTCHANGE:='';
vr_ID_OD_CHANGEDDATE:=null;
END;
END IF;
INSERT INTO TBL_IPCOLO_BILLING_MST
(
SAP_ID,
R4GSTATE,
POLITICAL_STATE_NAME,
POLITICAL_STATE_CODE,
CMP,
SITE_NAME,
RFCDATE,
RFE1_DATE,
SITE_DROP_DATE,
INFRA_PROVIDER,
IP_COLO_SITEID,
VENDOR_CODE,
MW_INSTALLED,
DG_NONDG,
EB_NONEB,
TOWER_TYPE,
ID_OD_COUNTCHANGE,
ID_OD_CHANGEDDATE,
RRH_COUNTCHANGE,
RRH_CHANGEDDATE,
TENANCY_COUNTCHANGE,
TENANCY_CHANGEDDATE,
CITY_NAME,
NEID,
FACILITY_LATITUDE,
FACILITY_LONGITUDE,
RJ_STRUCTURE_TYPE,
RJ_JC_NAME,
RJ_JC_CODE,
COMPANY_CODE,
CREATED_BY,
CREATED_DATE,
SEL_CHANGED_VAL,
RFS_DATE
)
VALUES (
P_SAPID,
P_R4GSTATE,
P_POLITICAL_STATE_NAME,
P_POLITICAL_STATE_CODE,
P_CMP,
P_SITE_NAME,
P_RFC_DATE,
P_RFE1_DATE,
P_SITE_DROP_DATE,
P_INFRA_PROVIDER,
P_IPCOLO_SITEID,
P_IPSAP_VENDORCODE,
P_MW_INSTALLED,
P_DG_AVAILABLE,
P_EB_AVAILABLE,
P_TOWER_TYPE,
vr_ID_OD_COUNTCHANGE,
vr_ID_OD_CHANGEDDATE,
vr_RRH_COUNTCHANGE,
vr_RRH_CHANGEDDATE,
vr_TENANCY_COUNTCHANGE,
vr_TENANCY_CHANGEDDATE,
P_CITY_NAME,
P_NEID,
P_FAC_LATITUDE,
P_FAC_LONGITUDE,
P_RJ_STRUC_TYPE,
P_RJ_JC_NAME,
P_RJ_JC_CODE,
P_COMPANY_CODE,
P_CREATED_BY,
SYSDATE,
P_CHANEDVALUE,
P_RFS_DATE
);
TBL_INSERT := 0;
END INSERT_IPCOLO_DATA;
КОД
public static string INSERT_IPCOLO_DATA(IPColoFields IPColoFields)
{
OracleConnection conn = new OracleConnection(ConfigurationManager.ConnectionStrings["ConnectionString_IPCOLO"].ConnectionString);
string intRetId = "";
try
{
OracleCommand cmd = new OracleCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = ConfigurationManager.AppSettings["PackageName"].ToString() + ".INSERT_IPCOLO_DATA";
cmd.Connection = conn;
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_SAPID", Value = IPColoFields.SAP_ID, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_R4GSTATE", Value = IPColoFields.R4GSTATE, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_POLITICAL_STATE_NAME", Value = IPColoFields.POLITICAL_STATE_NAME, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_POLITICAL_STATE_CODE", Value = IPColoFields.POLITICAL_STATE_CODE, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_CMP", Value = IPColoFields.CMP, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_SITE_NAME", Value = IPColoFields.SITE_NAME, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_RFC_DATE", Value = IPColoFields.RFC_DATE, OracleDbType = OracleDbType.Date, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_RFE1_DATE", Value = IPColoFields.RFE1_DATE, OracleDbType = OracleDbType.Date, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_SITE_DROP_DATE", Value = IPColoFields.SITE_DROP_DATE, OracleDbType = OracleDbType.Date, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_INFRA_PROVIDER", Value = IPColoFields.INFRA_PROVIDER, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_IPCOLO_SITEID", Value = IPColoFields.IPCOLO_SITEID, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_IPSAP_VENDORCODE", Value = IPColoFields.IPSAP_VENDORCODE, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_MW_INSTALLED", Value = IPColoFields.MW_INSTALLED, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_DG_AVAILABLE", Value = IPColoFields.DG_AVAILABLE, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_EB_AVAILABLE", Value = IPColoFields.EB_AVAILABLE, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_TOWER_TYPE", Value = IPColoFields.TOWER_TYPE, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_ID_OD_COUNTCHANGE", Value = IPColoFields.ID_OD_COUNTCHANGE, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_ID_OD_CHANGEDDATE", Value = IPColoFields.ID_OD_CHANGEDDATE, OracleDbType = OracleDbType.Date, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_RRH_COUNTCHANGE", Value = IPColoFields.RRH_COUNTCHANGE, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_RRH_CHANGEDDATE", Value = IPColoFields.ID_OD_CHANGEDDATE, OracleDbType = OracleDbType.Date, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_TENANCY_COUNTCHANGE", Value = IPColoFields.TENANCY_COUNTCHANGE, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_TENANCY_CHANGEDDATE", Value = IPColoFields.TENANCY_CHANGEDDATE, OracleDbType = OracleDbType.Date, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_CITY_NAME", Value = IPColoFields.CITY_NAME, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_NEID", Value = IPColoFields.NEID, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_FAC_LATITUDE", Value = IPColoFields.FAC_LATITUDE, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_FAC_LONGITUDE", Value = IPColoFields.FAC_LONGITUDE, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_RJ_STRUC_TYPE", Value = IPColoFields.RJ_STRUC_TYPE, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_RJ_JC_NAME", Value = IPColoFields.RJ_JC_NAME, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_RJ_JC_CODE", Value = IPColoFields.RJ_JC_CODE, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_COMPANY_CODE", Value = IPColoFields.COMPANY_CODE, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_CREATED_BY", Value = IPColoFields.CREATED_BY, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_CHANEDVALUE", Value = IPColoFields.CHANGED_FIELDS, OracleDbType = OracleDbType.NVarchar2, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter { ParameterName = "P_RFS_DATE", Value = IPColoFields.RFS_DATE, OracleDbType = OracleDbType.Date, Direction = ParameterDirection.Input });
cmd.Parameters.Add(new OracleParameter
{
ParameterName = "TBL_INSERT",
OracleDbType = OracleDbType.Decimal,
Direction = ParameterDirection.Output
});
if (conn.State != ConnectionState.Open) conn.Open();
cmd.ExecuteNonQuery();
intRetId = cmd.Parameters["TBL_INSERT"].Value.ToString();
}
catch (Exception)
{
throw;
}
finally
{
if (conn.State == ConnectionState.Open) conn.Close();
}
return intRetId;
}