| ORACLE - SYS.DBMS_JOB causes error "ORA-01461 can bind a LONG value only for insert into a LONG colu [message #576171] |
Fri, 01 February 2013 02:33  |
 |
amitms
Messages: 3 Registered: February 2013 Location: kathmandu
|
Junior Member |
|
|
QUESTION2
-------------
query1 VARCHAR2(4000);
query2 CLOB;
vSQLString CLOB;
query1 := 'query statement';
query2 := 'query statement2';
query1=TO_CLOB(QUERY1);
vSQLString :='
DECLARE
...
BEGIN
EXECUTE IMMEDIATE'''||REPLACE(query1||query2,'''','''''')||''';
....
EXCEPTION WHEN OTHERS THEN
.....
END;';
DBMS_JOB.SUBMIT( JOB=>VJOBNUM2, WHAT=>vSQLString, INSTANCE=>1 );
---------------------------------------------------------------------
ERROR IS :
"ORA-01461 can bind a LONG value only for insert into a LONG column"
---------------------------------------------------------------------
This error also occurs when when vQLString in VARCHAR2 exceeds 4000;
Please someboady HELP on How to pass vSQLString in CLOB TO => WHAT
|
|
|
|
|
|
|
|
|
|
| Re: ORACLE - SYS.DBMS_JOB causes error "ORA-01461 can bind a LONG value only for insert into a LONG colu [message #576379 is a reply to message #576370] |
Mon, 04 February 2013 05:05   |
flyboy
Messages: 1673 Registered: November 2006
|
Senior Member |
|
|
amitms wrote on Mon, 04 February 2013 10:20yes there is reason.. you can place multiple EXECUTE IMMEDIATE statements in WHAT jobs
So that you and place multiple jobs and execute statements in parallel
If you are answering to the second paragraph, you probably missed my point. Why not simply run the statement(s) in block directly?
vSQLString :='
DECLARE
...
BEGIN
'||query1||query2||'
....
END;';
If there are multiple statements in one PL/SQL block, they are run in serial regardless of static/dynamic call. For parallel execution, you would have to SUBMIT multiple jobs, which would probably help you as each WHAT statement could be reduced to less than 4000 characters.
|
|
|
|
|
|
|
|