NCLOB problem
Posted: Fri 02 Mar 2012 13:41
Hi,
If I call the SP Oracle
CREATE OR REPLACE PROCEDURE "TESTCLOB" (
v_PARAMETER IN NCLOB ,
v_Out OUT NCLOB
)
AS
V_P NCLOB := v_PARAMETER;
BEGIN
v_Out := REPLACE(V_P, '@', TO_NCLOB(10));
END TESTCLOB;
with the code
UniConnection conn = new UniConnection("Data Source=RISDB;User ID=IMARKDB;Password=IMUser;");
// Prepara la query
UniCommand cmd = new UniCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "TESTCLOB";
UniParameter par = cmd.Parameters.Add(new UniParameter("v_PARAMETER", UniDbType.NClob, 8000));
par.Value = "Pippo@Pluto";
UniParameter par1 = cmd.Parameters.Add(new UniParameter("v_Out", OracleDbType.NClob, 8000));
par1.Direction = ParameterDirection.Output;
conn.Open();
UniDataReader reader = null;
try
{
reader = cmd.ExecuteReader();
}
finally
{
reader.Close();
conn.Close();
}
then I have the error
ORA-22921 length of input buffer is smaller than amount requested
ORA-06512: a "IMARKDB.TESTCLOB", line 9
ORA-06512: a line 2
If I run the script with sql-developer there are no problems.
Best Regards
Marco
If I call the SP Oracle
CREATE OR REPLACE PROCEDURE "TESTCLOB" (
v_PARAMETER IN NCLOB ,
v_Out OUT NCLOB
)
AS
V_P NCLOB := v_PARAMETER;
BEGIN
v_Out := REPLACE(V_P, '@', TO_NCLOB(10));
END TESTCLOB;
with the code
UniConnection conn = new UniConnection("Data Source=RISDB;User ID=IMARKDB;Password=IMUser;");
// Prepara la query
UniCommand cmd = new UniCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "TESTCLOB";
UniParameter par = cmd.Parameters.Add(new UniParameter("v_PARAMETER", UniDbType.NClob, 8000));
par.Value = "Pippo@Pluto";
UniParameter par1 = cmd.Parameters.Add(new UniParameter("v_Out", OracleDbType.NClob, 8000));
par1.Direction = ParameterDirection.Output;
conn.Open();
UniDataReader reader = null;
try
{
reader = cmd.ExecuteReader();
}
finally
{
reader.Close();
conn.Close();
}
then I have the error
ORA-22921 length of input buffer is smaller than amount requested
ORA-06512: a "IMARKDB.TESTCLOB", line 9
ORA-06512: a line 2
If I run the script with sql-developer there are no problems.
Best Regards
Marco