Hi
I have a CLOB column and I need to use C++ builder to pass a very long string to a stored proc.The stored proc takes in the long string and should store it to the clob column.
It works without raising any errors but only stores about 4000 characters of my 30000 or so.
I am not allowed to use direct access from C++ using a stream and TBlobField->LoadFromStream, even though this works okay, due to access violations to the table.
C++ Builder Code
String Clobfunction = **Large amount of text from memo **
//stores the data to table
m_pStoredProcedure->CallProcedure
("sp_UpdateTaskFunction", OPENARRAY(Variant,
(taskName, Clobfunction ,description,
taskkey)));
// to access the data from the table
String& function =
m_pTaskDataSet->Fields->FieldByName("FUNCTION")->AsString;
PL/SQL stored proc code
CREATE OR REPLACE PROCEDURE sp_UpdateTaskFunction
(vTaskName IN TASKS.TASKNAME%TYPE,
vFunction IN TASKS.FUNCTION%TYPE,
vDescription IN TASKS.DESCRIPTION%TYPE,
vTaskkey IN TASKS.TASKKEY%TYPE)
IS
v_taskkey NUMBER;
BEGIN
SELECT COUNT(*) INTO v_taskkey FROM TASKS WHERE TASKKEY = vTaskkey;
IF v_taskkey > 0 THEN
UPDATE TASKS SET
-- "function" is the clob column to update
FUNCTION = vFunction,
TASKNAME = vTaskName,
DESCRIPTION = vDescription
WHERE TASKKEY = vTaskkey;
COMMIT;
END IF;
END;
/
Do I need to change my stored proc and how?
Or do I need to change the way I pass the large string to the stored proc?
Thanks in advance.
I have a CLOB column and I need to use C++ builder to pass a very long string to a stored proc.The stored proc takes in the long string and should store it to the clob column.
It works without raising any errors but only stores about 4000 characters of my 30000 or so.
I am not allowed to use direct access from C++ using a stream and TBlobField->LoadFromStream, even though this works okay, due to access violations to the table.
C++ Builder Code
String Clobfunction = **Large amount of text from memo **
//stores the data to table
m_pStoredProcedure->CallProcedure
("sp_UpdateTaskFunction", OPENARRAY(Variant,
(taskName, Clobfunction ,description,
taskkey)));
// to access the data from the table
String& function =
m_pTaskDataSet->Fields->FieldByName("FUNCTION")->AsString;
PL/SQL stored proc code
CREATE OR REPLACE PROCEDURE sp_UpdateTaskFunction
(vTaskName IN TASKS.TASKNAME%TYPE,
vFunction IN TASKS.FUNCTION%TYPE,
vDescription IN TASKS.DESCRIPTION%TYPE,
vTaskkey IN TASKS.TASKKEY%TYPE)
IS
v_taskkey NUMBER;
BEGIN
SELECT COUNT(*) INTO v_taskkey FROM TASKS WHERE TASKKEY = vTaskkey;
IF v_taskkey > 0 THEN
UPDATE TASKS SET
-- "function" is the clob column to update
FUNCTION = vFunction,
TASKNAME = vTaskName,
DESCRIPTION = vDescription
WHERE TASKKEY = vTaskkey;
COMMIT;
END IF;
END;
/
Do I need to change my stored proc and how?
Or do I need to change the way I pass the large string to the stored proc?
Thanks in advance.