ORA-01461: can bind a LONG value only for insert into a LONG column in 11.2

Hello,
We have been getting the following exception when we try to save an XML (>5k).
SQL state [72000]; error code [1461]; ORA-01461: can bind a LONG value only for insert into a LONG column
This is occurring only for Oracle 11g (11.2.0.1.0)
Our column is CLOB type, not LONG type.
Could anyone please suggest what could be the reason and fix?
Thanks in advance
--Cheers
paruvid

Thanks for quick response!!
Inserting throw JDBC (Spring jdbcTemplate)
using the ojdbc6.jar as driver
here is the stask strace
Caused by: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO tabl1(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15,c16(CLOBCOL),c17, c18, c19) SELECT c1,c2, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? FROM table2 S JOIN table1 D ON S.c1 = D.c1 WHERE S.c2 = ? AND D.c5 = ? GROUP BY S.c1];
SQL state [72000]; error code [1461]; ORA-01461: can bind a LONG value only for insert into a LONG column
; nested exception is java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:602)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:786)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:842)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:846)
at com.smartstream.cms.message.dao.SSIMessageDao.editSSIInstance(SSIMessageDao.java:522)
... 52 more
Caused by: java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
Edited by: paruvid on Aug 9, 2011 5:07 AM
Edited by: paruvid on Aug 9, 2011 5:17 AM
Edited by: paruvid on Aug 9, 2011 5:23 AM

Similar Messages

  • ORA-01461: can bind a LONG value only for insert into a LONG colu

    Hello - I have a variable defined in a package as VARCHAR2(32720). This is not a table column. I am building a string inside the vairable, loading in invoice data in sections one at a time. It seems that once I get a larger number of invoices (say 100+) to load in, I get the "ORA-01461: can bind a LONG value only for insert into a LONG column" error. I am not trying to insert into a table column; just stringing together data in this large variable.
    Why would I be getting this error ? And is there a workaround ? The variable is read back out iin 80 byte strings which are then loaded to a table column that is varchar2(80).
    Thanks !!
    Jim Ernst
    Invacare Corporation

    Here is the definition of the field:
    l_EDI820_Data VARCHAR2(32720);
    And here is the loop used to populate the field. As i mentioned, it seems that once the process gets over 100 invoices coming in that the field hits the error; seems as if we are hitting say 4000 characters or near it at that point...
    FOR r_INVOICE_DETAIL IN cr_INVOICE_DETAILS LOOP
    l_EDI820_Data := l_EDI820_Data
    ||l_RMR_Statement
    ||r_INVOICE_DETAIL.INVOICE_NUM
    ||'*PI*'
    ||LTRIM(TO_CHAR(NVL(r_INVOICE_DETAIL.PAYMENT_AMOUNT,0))) -- Net Amount to be applied
    ||'*'
    ||LTRIM(TO_CHAR(r_INVOICE_DETAIL.INVOICE_AMOUNT,'999999.99')) -- Gross Amount
    ||l_Delimiter;
    l_TOTAL_SEGMENTS := l_TOTAL_SEGMENTS + 1;
    END LOOP; -- r_INVOICE_DETAIL
    There are some other statements that are adding additional data onto l_EDI820_Data ; this one is the loop that is basedon the invoices coming in.
    This code writes it to the table (field EDI820_DATA in the table is VARCHAR2(94)):
    l_EDI820_String_Length := LENGTH(RTRIM(l_EDI820_Data));
    l_EDI820_SUBSTR_START := 1;
    l_RECORD_SEQ_NO := 1;
    WHILE SUBSTR(l_EDI820_Data, l_EDI820_SUBSTR_START, 80) <> ' ' LOOP
    INSERT INTO XXAP_NACHA_EDI820_GTEMP_TBL
    SELECTED_CHECK_ID
    ,EDI820_SEQ
    ,EDI820_DATA
    VALUES (
    r_CHECK_IDS.SELECTED_CHECK_ID
    ,l_RECORD_SEQ_NO
    ,'705'||SUBSTR(l_EDI820_Data, l_EDI820_SUBSTR_START, 80)
    -- * Increment starting point for substring and also record sequence number
    l_EDI820_SUBSTR_START := l_EDI820_SUBSTR_START + 80;
    l_RECORD_SEQ_NO := l_RECORD_SEQ_NO + 1;
    END LOOP; -- WHILE Loop

  • ORA-01461: can bind a LONG value only for insert into a LONG Classic Report

    I am trying to create a report but get a ORA-01461: can bind a LONG value only for insert into a LONG column error. I am a fairley new to Apex and my SQL skills are far from expert level. I have 3 groups we will call 'A' 'B' 'C'. 'A' is the best group 'B' is the next best and 'C' is the lowest group. Let say there are 5 people they all want to be in group A but where they are placed is based on their audition score and the users selection.
    Joe score is 50
    Beth 40
    John 30
    Ken 20
    Sally 10
    The user selects that he wants 2 people in group 'A' and 1 in group 'B' and 2 in group C. The SQL needs to rank Joe and Beth in Group A. John in group 'B' and Ken and Sally in group 'C'. The user does this type of selection for about 15 different instrument groups to make up group (band) for 'A', 'B', and 'C'.
    Here is what I have come up with that gives me the error mention above when creating a report but works in SQL developer. There is probably a far better way to write this than what I have. I am open to suggestions. Band 'A' SQL example is for all instruments. SQL's for 'B' and 'C' are just a samples of the whole thing.
    SQL for Band 'A'
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    ( ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Piccolo'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_piccolo from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Flute'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Flute from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Oboe'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Oboe from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'English_Horn'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Englishhorn from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'English_Horn'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Englishhorn from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Clarinet_Eflat'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Clarineteflat from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Clarinet'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Clarinet from festival_years where year = ':P6_YEAR')
    UNION ALL SELECT lname,fname,instrument,total FROM(SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank FROM band_students, festival_records A JOIN festival_records B on a.ID = b.ID where band_students.id = a.ID and a.instrument = 'Clarinet Bass' and a.festival_year = ':P6_YEAR' ORDER BY total, a.ID DESC NULLS LAST) WHERE Stu_Rank <= (select hb_Clarinetbass from festival_years where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Clarinet Contrabass'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Clarinetcontrabass from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Saxophone Alto'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Saxophonealto from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Saxophone Tenor'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Saxophonetenor from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Saxophone Bari'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Saxophonebari from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Bassoon'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Bassoon from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Bassoon Contra'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Bassooncontra from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Horn'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Horn from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Trumpet'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Trumpet from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Trombone'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Trombone from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Trombone Bass'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Trombonebass from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Euphonium'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Trombonebass from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Tuba'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Tuba from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Percussion'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Percussion from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Piano'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Piano from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Violin'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Violin from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Viola'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Viola from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Cello'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Cello from festival_years
    where year = ':P6_YEAR')
    UNION ALL
    SELECT lname,fname,instrument,total
    FROM
    (SELECT lname, fname, a.instrument, a.total, DENSE_RANK() OVER
    (ORDER BY a.total DESC,a.ID NULLS LAST) AS Stu_Rank
    FROM band_students, festival_records A
    JOIN festival_records B on a.ID = b.ID
    where band_students.id = a.ID
    and a.instrument = 'Bass'
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank <= (select hb_Cello from festival_years
    where year = ':P6_YEAR'
    SQL for band 'B'
    SELECT lname,fname,instrument, total
    FROM
    (SELECT lname, fname, instrument, total, RANK() OVER
    ( ORDER BY instrument,total ASC NULLS LAST) AS Stu_Rank
    FROM festival_records, band_students
    where band_students.id = festival_records.id
    and instrument = 'Piccolo'
    and festival_year = '2014'
    ORDER BY instrument, total ASC NULLS LAST)
    WHERE Stu_Rank < (select hb_piccolo from festival_years
    where year = :P6_YEAR)
    SQL for band 'C'
    SELECT lname,fname,instrument, total
    FROM festival_records, band_students
    where band_students.id = festival_records.student_id
    and instrument = 'Piccolo'
    and festival_year = ':P6_YEAR'
    minus
    SELECT lname,fname,instrument, total
    FROM
    (SELECT lname, fname, instrument, total, RANK() OVER
    ( ORDER BY instrument,total DESC NULLS LAST) AS Stu_Rank
    FROM festival_records, band_students
    where band_students.id = festival_records.student_id
    and instrument = 'Piccolo'
    and festival_year = ':P6_YEAR'
    ORDER BY instrument, total DESC NULLS LAST)
    WHERE Stu_Rank < (select hb_piccolo from festival_years
    where year = ':P6_YEAR')
    SQL

    >
    Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already).
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    You should also always post code wrapped in <tt>\...\</tt> tags.
    I am trying to create a reportWhen asking a question about "reports" it's firstly essential to differentiate between standard and interactive reports. Which is it?
    but get a ORA-01461: can bind a LONG value only for insert into a LONG column error.Where and when do you get this error? When creating the report? Or running it?
    There's also an obvious bug (repeated many times):
    and a.festival_year = ':P6_YEAR'
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank &lt;= (select hb_piccolo from festival_years
                   where year = ':P6_YEAR')
    ...<tt>':P6_YEAR'</tt> is a literal string, not a bind variable reference. <tt>':P6_YEAR'</tt> seems an unlikely value for <tt>festival_year</tt> and <tt>year</tt> values. It should be:
    and a.festival_year = :P6_YEAR
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank &lt;= (select hb_piccolo from festival_years
                   where year = :P6_YEAR)
    ...or even better:
    and a.festival_year = to_number(:P6_YEAR)
    ORDER BY total, a.ID DESC NULLS LAST)
    WHERE Stu_Rank &lt;= (select hb_piccolo from festival_years
                   where year = to_number(:P6_YEAR))
    ...if the <tt>festival_year</tt> and <tt>year</tt> columns are of type NUMBER. There's a possibility that this bug is in fact the source of your error...
    Furthermore, this is a long piece of SQL. It may be that APEX can't cope with the length. However it's also very repetitive: we see the same SQL pattern repeated many times and UNIONed together. One way to reduce the length of the query would be to replace some (or all) of those repeating patterns. This will not only make the query more APEX-friendly, but it will probably be more efficient and easier to maintain too.
    I recommend that you Re: 2. How do I ask a question on the forums? that will enable others to have a go at this. Reproducing the app on apex.oracle.com and posting guest developer credentials would also be helpful.

  • Weird exception in 12c (ORA-01461: can bind a LONG value only for insert into a LONG column)

    I have a Windows app that accesses an Oracle 12c database via ODBC (the driver version is 12.01.00.01).
    I have a table that has a key column named REGION_ID (NVARCHAR2(9)), and about a dozen other columns, three of which are named REGION1, REGION2, and REGION3, all of type NVARCHAR2(40).
    When I try to insert a string into the REGION1 field that's greater than 9 characters (the length of REGION_ID), I get an ORA-01461 error ('Can bind a LONG value only for insert into a LONG column). If I define the length of REGION_ID to be NVARCHAR2(15), then I can add strings to the REGION1 field with a length up to 15 before I get the ORA-01461 exception again. Oddly, if I change the REGION1 column name to REGIONONE, I do not get any errors, and everything works fine. It's almost as if the column name REGION1 is being confused with REGION_ID behind the scenes.
    Any ideas? I’m using SQLBindParameter to bind the columns, and all of the calls succeed. I get the exception when I execute the insert statement. This same code worked for previous versions of Oracle (11g, 10g, and 9i). And if I use an 11g client driver against the 12c server, I do not get the exception.
    Thanks!

    Sorry, I was just now able to install the patch for bug 18232462, and it did indeed solve the issue I described above. Thanks!

  • APEX 4.0.1 ORA-01461: can bind a LONG value only for insert into a LONG col

    Hello,
    I tried to use the "Database Object Dependencies" in the "Utilties"-section to get an idea of what objects are used in a application. But I got the following error:
    ORA-01461: can bind a LONG value only for insert into a LONG column
    The application consists of 100+ pages and uses abt. 10 schemas. I'm using APEX 4.0.1 on a 10.2.0.4 DB.
    Doing this on a small application there are no errors.
    Any hint would be welcome to solve this error.

    Any Thoughts?

  • ORA-01461 can bind a LONG value only for insert into a LONG

    I Use ODP.net Insert and update Image files to Oralce blob columns(Oracle8i Server,ora92 client),
    When the files larger than 4000 characters,It doesn't work.error:ORA-01461 can bind a LONG value only for insert into a LONG
    My Vb.net code:
    Dim dlg As OpenFileDialog
    Dim strFileName() As String
    Dim fsBLOB As System.IO.FileStream
    Dim Adapter As OracleDataAdapter
    Dim ds As New DataSet
    Dim row As DataRow
    Dim cb As OracleCommandBuilder
    Dim bytes() As Byte
    dlg = New OpenFileDialog
    dlg.Filter = "Import File (*.*)|*.*"
    Adapter = New OracleDataAdapter("select * from a_blob_contents where 1=0", Me.OraConnection)
    Adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey
    Adapter.FillSchema(ds, SchemaType.Source, "BLOB")
    cb = New OracleCommandBuilder(Adapter)
    If dlg.ShowDialog() = DialogResult.OK Then
    strFileName = dlg.FileNames()
    Dim loopCount As Integer
    For loopCount = 0 To strFileName.GetLength(0) - 1
    row = ds.Tables("BLOB").NewRow()
    row("BLOB_ID") = GetMaxBh("A_BLOB_CONTENTS", "BLOB_ID")
    row("FILE_ID") = FileID
    row("FILE_TYPE") = FileType
    Dim file_name As String
    file_name = strFileName(loopCount)
    file_name = file_name.Substring(file_name.LastIndexOf("\") + 1, file_name.Length - file_name.LastIndexOf("\") - 1)
    row("BLOB_NAME") = file_name
    fsBLOB = New FileStream(strFileName(loopCount), FileMode.Open, FileAccess.Read)
    ReDim bytes(fsBLOB.Length)
    fsBLOB.Read(bytes, 0, System.Convert.ToInt32(fsBLOB.Length))
    fsBLOB.Close()
    row("blob_contents") = bytes
    row("user_code") = Global.user_code
    row("Operate_date") = Now
    ds.Tables("BLOB").Rows.Add(row)
    Next
    Try
    Adapter.Update(ds, "BLOB")
    Catch ex As Exception
    MessageBox.Show(ex.Message)
    End Try
    End If
    I'll appreciate for anyone who can help me solve this problem.

    Hi Zhenquan,
    The issue is that you can not direct insert more than 4K (as you have discovered). Two methods I use in this situation are:
    1) sql statement or procedure that returns a lob locator into an ODP.NET OracleBlob parameter such as:
    insert into the_table (primary_key, blob_column) values (pk_value, empty_blob()) returning blob_column into :blob_parameter.
    Once you have the OracleBlob you should be able to write/update the data.
    2) use an anonymous pl/sql block or package that uses the dbms_lob supplied package to work with the LOB.
    Here is a simple console example...
    SQL> create table blob_test
    2 (
    3 blob_id number,
    4 blob_data blob,
    5 constraint blob_test_pk primary key (blob_id)
    6 )
    7 tablespace users;
    Table created.
    Sub Main()
    Dim strFileName As String = "c:\temp\testimage.jpg"
    Dim fsBlob As FileStream = New FileStream(strFileName, FileMode.Open)
    Dim bytes(fsBlob.Length) As Byte
    fsBlob.Read(bytes, 0, fsBlob.Length)
    fsBlob.Close()
    Dim con As OracleConnection = New OracleConnection("User Id=/; Data Source=lt8i")
    con.Open()
    Dim trans As OracleTransaction = con.BeginTransaction()
    Dim sql As String = "insert into blob_test (blob_id, blob_data) values (1,empty_blob()) returning blob_data into :blob_parameter"
    Dim blob_parameter As OracleParameter = New OracleParameter
    blob_parameter.OracleDbType = OracleDbType.Blob
    blob_parameter.Direction = ParameterDirection.InputOutput
    Dim cmd As OracleCommand = New OracleCommand(sql, con)
    cmd.Parameters.Add(blob_parameter)
    cmd.ExecuteNonQuery()
    Dim blob As OracleBlob = blob_parameter.Value
    blob.Write(bytes, 0, bytes.Length)
    sql = "update blob_test set blob_data = :blob_parameter where blob_id = 1"
    cmd.CommandText = sql
    blob_parameter.Value = blob
    cmd.ExecuteNonQuery()
    trans.Commit()
    End Sub
    This sample was tossed together pretty quickly, so it is not a complete, bullet-proof sample, but hopefully it will give you what you need to get started. The 'testimage.jpg' file is just over 5MB in size.
    Hope that helps,
    Mark
    =======================================
    Mark A. Williams
    Oracle DBA
    Author, Professional .NET Oracle Programming
    http://www.apress.com/book/bookDisplay.html?bID=378

  • ORA-01461: can bind a LONG value only for insert into a LONG column ORA-020

    Getting error --
    ORA-01461: can bind a LONG value only for insert into a LONG column ORA-02063: preceding line from APPS
    A page has 3 fields and a Add button
    (1) first field is a LOV "select with submit"
    (2) second field is getting its value from select statement with where clause = ID selected from field1
    (3) field 3 is the value of field1
    In After submit Process , I write simple insert as follows in the
    BEGIn
    INSERT INTO TABLE_NAME (ELEMENT_NAME,ELEMENT_TYPE_ID )
    VALUES (:P3_NAME ,to_number(:P3_ELEMENT_TYPE_ID));
    COMMIT;
    END;
    when i click on Add i get the error above

    try doing the bind locally before executing the remote dml...
    declare
    l_long long := :P3_NAME;
    begin
    insert into table_name (ELEMENT_NAME,ELEMENT_TYPE_ID )
    values (l_long ,to_number(:P3_ELEMENT_TYPE_ID));
    end;
    ...and if that doesn't work, please let us know the definition of you TABLE_NAME table.
    thanks,
    raj

  • ORA-01461: can bind a LONG value only for insert into a LONG column - Issue

    We are getting an error from Oracle DB --- Cause: java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
    The application was working fine with Oracle 10.2.0.4 and ojbc14 driver 10.2.0.1 Error occurs only after an upgrade to Oracle 10g 10.2.0.5. So after some googling, we found that a driver upgrade would eliminate this error. So the 10.2.0.5 version of the driver was used. But the ORA error still occurs. The readme of ojdb14.jar specified this - BUG 8847022 - ORA-01461: CAN BIND A LONG VALUE ONLY FOR INSERT INTO A LONG COLUMN
    The problem is that we are not able to reproduce this using a sample program however it is happening consistently in the client environment.
    we get the error ORA-01461, when the oracle version is upgraded to 10.2.0.5. This error occurs when we try to insert a file(BLOB) data with the file length greater than 4KB to a table.
    Exception trace
    uncategorized SQLException for SQL []; SQL state [72000]; error code [1461];
    --- The error occurred in nl/sss/gict/mcb/data/dao/config/StateQueries.xml.
    --- The error occurred while applying a parameter map.
    --- Check the setReceivedFile-InlineParameterMap.
    --- Check the statement (update failed).
    --- Cause: java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
    ; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
    --- The error occurred in nl/sss/gict/mcb/data/dao/config/StateQueries.xml.
    --- The error occurred while applying a parameter map.
    --- Check the setReceivedFile-InlineParameterMap.
    --- Check the statement (update failed).
    --- Cause: java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
    Oracle version installed in acceptance:
    1 Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    2 PL/SQL Release 10.2.0.5.0 - Production
    3 CORE 10.2.0.5.0 Production
    4 TNS for Linux: Version 10.2.0.5.0 - Production
    5 NLSRTL Version 10.2.0.5.0 - Production

    Is the server running Java 1.4? If it is Java 5 or higher there is no need to keep using OJDBC14, you can upgrade to OJDBC5.
    If you cannot do that, then I ask you: why make this post? What are you expecting someone to do? Your problem is with the OJDBC driver, you are not going to get tech support for it in this Java programming forum.

  • ORA-01461: can bind a LONG value only for insert into a LONG column error

    Oracle 11g R1 RHEL 5 64bit (Apex 3.1)
    Hi all,
    I am having a tough time with this error:
    ORA-01461: can bind a LONG value only for insert into a LONG column
    ORA-06512: at "FPRCHR.PKG_TRIGGER_EMAIL", line 39
    ORA-06512: at "ISWRNEW.PKG_NOTIFICATION", line 310
    ORA-06512: at "ISWRNEW.PKG_NOTIFICATION", line 1745
    ORA-06512: at line 1
    The FPRCHR.PKG_TRIGGER_EMAIL looks like follows:
    INSERT INTO fprchr.trigger_email
    (trigger_email_rid,
    email_to,
    email_from,
    email_body,
    email_subject,
    email_cc,
    email_bcc,
    mime_type,
    email_priority
    VALUES (l_job,
    p_recipients,
    p_sender,
    p_message,
    p_subject,
    p_cc,
    p_bcc,
    p_mime_type,
    p_priority
    execute immediate 'alter session set events ''10046 trace name context off''';
    END submit;
    It seems like the characters have exceeded the limit that VARCHAR2 can handle? What other data type could I change the fprchr.trigger_email table to? Is that all that is needed?
    Thanks.

    It seems like the characters have exceeded the limit that VARCHAR2 can handle? What other data type could I change the fprchr.trigger_email table to? Is that all that is needed?
    Did you try with clob data type?
    Regards.
    Satyaki De

  • ORA-01461: can bind a LONG value only for insert into a LONG column-Update

    Hi,
    I'm using Oracle 9.2 with Weblogic 8 server. There are two columns OBJ_EVIDENCE_COMP - varchar2(4000 bytes), Descriptiion - varchar2(4000 bytes) in a table.I'm getting the Data from that table and again I'm updating into the same table with same data after updating the Data object in java.
    I am getting the following error
    "Java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column"
    Can some one let me know why this error occurs ? Please do let me know if you want any other information. Below is my SQL Query:
    * @jc:sql statement::
    * UPDATE CORRECTIVE_ACTION SET
    * CA_ID = {dt.caId},
    * CA_NBR = {dt.caNbr},
    * CAPA_PLAN_ID = {dt.capaPlanId},
    * OBJ_EVIDENCE_COMP = {dt.objEvidenceComp},
    * APPLICABLE_ELSE_WHERE = {dt.applicableElseWhere},
    * JUSTIFICATION = {dt.justification},
    * MOE = {dt.moe},
    * COMPLETION_DATE = {dt.completionDate},
    * EXTENSION_DUE_DATE = {dt.extensionDueDate},
    * STATUS_CD = {dt.statusCd},
    * SYSTEM_STATUS_CD = {dt.systemStatusCd},
    * ROOT_CAUSE_CD = {dt.rootCauseCd},
    * DESCRIPTION = {dt.description},
    * CA_TYPE = {dt.caType},
    * CREATED_BY = {dt.createdBy},
    * CREATED_DATE = {dt.createdDate},
    * MODIFIED_BY = {dt.modifiedBy},
    * MODIFIED_DATE = {dt.modifiedDate},
    * COMPLETION_DUE_DATE = {dt.completionDueDate}
    * WHERE CA_ID = {dt.caId}
    In the above update statement if i remove one among the 2 columns mentioned then it is getting updated properly......
    Regards,
    Bharat
    Edited by: 908508 on Jan 17, 2012 2:18 AM

    I am occasionally getting this error in an Oracle 11g database
    I use Rogue Wave to insert:
    connection.beginTransaction ("bulkInsertEvents");
    RWDBTBuffer <RWCString> symbols (symbol, rowCount);
    RWDBTBuffer <RWDateTime> timeStamps (timeStamp, rowCount);
    RWDBTBuffer <int> eventCounts (eventCount, rowCount);
    RWDBTBuffer <RWCString> events (event, rowCount);
    RWDBBulkInserter ins = table.bulkInserter (connection);
    ins << symbols << timeStamps << eventCounts << events;
    ins.execute ();
    connection.commitTransaction ("bulkInsertEvents");
    catch (RWxmsg & exception)
    cout << Logging::getProgramName () << " " << exception.why () << endl;
    throw "Failed to do bulk insert events to DBTools.";
    Some of the inserts give me
    "[SERVERERROR] ORA-01461: can bind a LONG value only for insert into a LONG column"
    the table structure is
    SYMBOL     VARCHAR2(33 BYTE)
    DATEANDTIME     TIMESTAMP(6)     
    NUMOFEVENTS     NUMBER     
    EVENTS     VARCHAR2(4000 BYTE)

  • APex 4.1 Error ORA-01461: can bind a LONG value only for insert into a LONG

    Hi There,
    Facing a strange issue.
    I have a regular cursor, and in that cursor loop I have a select statement into some variables based on cursor parameters.
    I was getting the "ORA-01461: can bind a LONG value only for insert into a LONG column" error so I started individually checking each of the columns. Now it works fine for some column, but the moment I add this number field. It starts throwing this error. Now, the database source where the select is fired is of type number, the variable into which I select it is number .
    Infact, I dont have any LONG column defined anywhere.
    The strange thing is that the block executes perfectly fine in SQl developer. So looks like a Apex specific issue.
    I am on 4.1/11g
    Any ideas?
    Thanks,
    Sun

    sun1977 wrote:
    Now, I have put this inside a Dynamic action (PL/SQL procedure). I think this PL/SQL procedure will go up to about 1500 to 2000 lines of code. There are no long columns involved anywhere or even CLOB, BLOB etc.
    Is there any limitation to the size of code? When you say size of a code. Are you saying the whole PL/SQL block is stored in one Varchar2(4000) field? :) Did not know that. I am quite sure, the PL/SQL compiled package on the database would work perfect. Just was wondering why it was not working within APEX!
    Also, Is there any documentation regarding this that you might be aware of?You can look at the APEX views. Code for some purposes (like region source) is stored in CLOBs:
    desc apex_application_page_regions
    Name                           Null     Type               
    WORKSPACE                      NOT NULL VARCHAR2(255 BYTE) 
    WORKSPACE_DISPLAY_NAME                  VARCHAR2(4000 BYTE)
    APPLICATION_ID                 NOT NULL NUMBER             
    APPLICATION_NAME               NOT NULL VARCHAR2(255 BYTE) 
    PAGE_ID                        NOT NULL NUMBER             
    PAGE_NAME                      NOT NULL VARCHAR2(255 BYTE) 
    REGION_NAME                    NOT NULL VARCHAR2(255 BYTE) 
    PARENT_REGION_ID                        NUMBER             
    PARENT_REGION_NAME                      VARCHAR2(255 BYTE) 
    TEMPLATE                                VARCHAR2(255 BYTE) 
    TEMPLATE_ID                             NUMBER             
    STATIC_ID                               VARCHAR2(255 BYTE) 
    REST_ENABLED                            VARCHAR2(3 BYTE)   
    DISPLAY_SEQUENCE               NOT NULL NUMBER             
    DISPLAY_REGION_SELECTOR                 VARCHAR2(3 BYTE)   
    REGION_ATTRIBUTES_SUBSTITUTION          VARCHAR2(4000 BYTE)
    ESCAPE_ON_HTTP_OUTPUT                   VARCHAR2(3 BYTE)   
    DISPLAY_COLUMN                          NUMBER             
    DISPLAY_POSITION                        VARCHAR2(255 BYTE) 
    DISPLAY_POSITION_CODE                   VARCHAR2(255 BYTE) 
    REGION_SOURCE                           CLOB
    ...for others&mdash;like LOV source and DA actions (PL/SQL code is stored in <tt>ATTRIBUTE_01</tt>)&mdash;are only VARCHAR2(4000 BYTE):
    desc apex_application_page_da_acts
    Name                        Null     Type               
    WORKSPACE                   NOT NULL VARCHAR2(255 BYTE) 
    WORKSPACE_DISPLAY_NAME               VARCHAR2(4000 BYTE)
    APPLICATION_ID              NOT NULL NUMBER             
    APPLICATION_NAME            NOT NULL VARCHAR2(255 BYTE) 
    PAGE_ID                     NOT NULL NUMBER             
    PAGE_NAME                   NOT NULL VARCHAR2(255 BYTE) 
    DYNAMIC_ACTION_ID           NOT NULL NUMBER             
    DYNAMIC_ACTION_NAME         NOT NULL VARCHAR2(255 BYTE) 
    ACTION_NAME                          VARCHAR2(100 BYTE) 
    ACTION_CODE                 NOT NULL VARCHAR2(50 BYTE)  
    ACTION_SEQUENCE             NOT NULL NUMBER             
    DYNAMIC_ACTION_EVENT_RESULT          VARCHAR2(5 BYTE)   
    EXECUTE_ON_PAGE_INIT                 VARCHAR2(3 BYTE)   
    AFFECTED_ELEMENTS                    VARCHAR2(4000 BYTE)
    AFFECTED_ELEMENTS_TYPE               VARCHAR2(30 BYTE)  
    AFFECTED_REGION                      VARCHAR2(255 BYTE) 
    AFFECTED_REGION_ID                   NUMBER             
    ATTRIBUTE_01                         VARCHAR2(4000 BYTE)
    ATTRIBUTE_02                         VARCHAR2(4000 BYTE)
    ATTRIBUTE_03                         VARCHAR2(4000 BYTE)
    ATTRIBUTE_04                         VARCHAR2(4000 BYTE)
    ATTRIBUTE_05                         VARCHAR2(4000 BYTE)
    ATTRIBUTE_06                         VARCHAR2(4000 BYTE)
    ATTRIBUTE_07                         VARCHAR2(4000 BYTE)
    ATTRIBUTE_08                         VARCHAR2(4000 BYTE)
    ATTRIBUTE_09                         VARCHAR2(4000 BYTE)
    ATTRIBUTE_10                         VARCHAR2(4000 BYTE)
    ATTRIBUTE_11                         VARCHAR2(4000 BYTE)
    ATTRIBUTE_12                         VARCHAR2(4000 BYTE)
    ATTRIBUTE_13                         VARCHAR2(4000 BYTE)
    ATTRIBUTE_14                         VARCHAR2(4000 BYTE)
    ATTRIBUTE_15                         VARCHAR2(4000 BYTE)
    STOP_EXECUTION_ON_ERROR              VARCHAR2(3 BYTE)   
    LAST_UPDATED_BY                      VARCHAR2(255 BYTE) 
    LAST_UPDATED_ON                      DATE               
    COMPONENT_COMMENT                    VARCHAR2(4000 BYTE)
    ACTION_ID                   NOT NULL NUMBER             
    COMPONENT_SIGNATURE                  CHAR(15 BYTE)       Oracle presmably have reasons for this difference but it's not something that is made clear in any way through the Builder UI.
    Common sense should come into play. As Tony points out, the proper way to develop and deploy complex PL/SQL is using modular subprograms stored in packages. Same for APEX as for anything else.

  • Error ORA-01461: can bind a LONG value only for insert into a LONG column

    Within an existing application , i need to create a new report , i created a new page in it and then tried to create classic report , during wizard when i enter the same query which i have used for previous page , it gives me following error during the creation of report.
    The following bind variable i have already used for previous page. I want to reuse the same bind variables. There is no any long dataype within column predicates.
    Error ORA-01461: can bind a LONG value only for insert into a LONG column
    OK
    Following is the query
    SELECT
       "VWSR_ALL_MERGED_DATA_MV"."SR_AREA" "SR_AREA",
       "VWSR_ALL_MERGED_DATA_MV"."SR_STATUS" "SR_STATUS",
       "VWSR_ALL_MERGED_DATA_MV"."SR_SUB_STATUS" "SR_SUB_STATUS",
       "VWSR_ALL_MERGED_DATA_MV"."SR_DATE_CREATED" "SR_DATE_CREATED",
       "VWSR_ALL_MERGED_DATA_MV"."SR_OPEN_DATE" "SR_OPEN_DATE",
       "VWSR_ALL_MERGED_DATA_MV"."SR_CLOSED_DATE" "SR_CLOSED_DATE",
       "VWSR_ALL_MERGED_DATA_MV"."SR_PRODUCT1" "SR_PRODUCT1",
       "VWSR_ALL_MERGED_DATA_MV"."SR_PRODUCT2" "SR_PRODUCT2",
       "VWSR_ALL_MERGED_DATA_MV"."SR_TIO_PRIORITY" "SR_TIO_PRIORITY",
       "VWSR_ALL_MERGED_DATA_MV"."SR_REF_NUMBER" "SR_REF_NUMBER",
       "VWSR_ALL_MERGED_DATA_MV"."SR_DATE_RECD" "SR_DATE_RECD",
       "VWSR_ALL_MERGED_DATA_MV"."SR_CIDN" "SR_CIDN",
       "VWSR_ALL_MERGED_DATA_MV"."SR_BUS_UNIT" "SR_BUS_UNIT",
       "VWSR_ALL_MERGED_DATA_MV"."SR_NUMBER" "SR_NUMBER",
       "VWSR_ALL_MERGED_DATA_MV"."SOURCE_SYSTEM" "SOURCE_SYSTEM",
       "VWSR_ALL_MERGED_DATA_MV"."BATCH_ID" "BATCH_ID"
    FROM VWSR_ALL_MERGED_DATA_MV
    WHERE trunc(VWSR_ALL_MERGED_DATA_MV.SR_DATE_RECD)=trunc(sysdate-1)
      AND VWSR_ALL_MERGED_DATA_MV.SR_TIO_PRIORITY  IN
                                                    :P2_SR_TIO_PRIORITY
                                                   ,'CEO'
                                                   ,'TER'
                                                   ,'Priority Assistance'
                                                   ,'Enquiry'
      AND   (
            (VWSR_ALL_MERGED_DATA_MV.SR_BUS_UNIT IN
                                         'Business Support and Improvement'
                                       , 'Finance and Administration'
                                       , 'Cust Sat Simplification and Productivity'
                                       , 'Project New and Customer Experience'
                                       , 'Corp Strategy and Customer Experience'
                                       , 'Other'
                AND :P2_SR_BUSINESS_UNIT= htf.escape_sc('BS&I'))
       OR   (VWSR_ALL_MERGED_DATA_MV.SR_BUS_UNIT IN
                                         'Consumer'
                                       , 'Consumer Telstra Country Wide'
                                       , 'Customer Service and Sales'
                                       , 'Offshore Sales and Service'
                                       , 'TC and TCW Operations'
                                       , 'Telstra Country Wide'
                                       , 'Other'
                AND :P2_SR_BUSINESS_UNIT= htf.escape_sc('TC&C'))
       OR   (VWSR_ALL_MERGED_DATA_MV.SR_BUS_UNIT IN
                             'Telstra Customer Sales and Service'                  
                            ,'Telstra Program Office'
                            ,'Human Resources'
                            ,'IT'
                            ,'Unallocated'
                            ,'Other'
                AND :P2_SR_BUSINESS_UNIT= 'OTHER')
       OR (VWSR_ALL_MERGED_DATA_MV.SR_BUS_UNIT IN
                        'Telstra Operations'
                       ,'Telstra Networks and Services'
                       ,'Other'
                AND :P2_SR_BUSINESS_UNIT= 'TO')
       OR (VWSR_ALL_MERGED_DATA_MV.SR_BUS_UNIT IN
                      'Telstra Business'
                AND :P2_SR_BUSINESS_UNIT= 'TB')
       OR (VWSR_ALL_MERGED_DATA_MV.SR_BUS_UNIT IN
                      'Telstra Wholesale'
                AND :P2_SR_BUSINESS_UNIT= 'TW')
       OR (VWSR_ALL_MERGED_DATA_MV.SR_BUS_UNIT IN
                      'Telstra Enterprise and Government'
                AND :P2_SR_BUSINESS_UNIT= htf.escape_sc('TE&G'))
       OR (VWSR_ALL_MERGED_DATA_MV.SR_BUS_UNIT IN
                      'Sensis'
                     ,'Sensis Pty Ltd'
                AND :P2_SR_BUSINESS_UNIT= 'SENSIS')
    AND :P2_SR_TIO_PRIORITY = 'Level 0'
    UNION
    SELECT
       "VWSR_ALL_MERGED_DATA_MV"."SR_AREA" "SR_AREA",
       "VWSR_ALL_MERGED_DATA_MV"."SR_STATUS" "SR_STATUS",
       "VWSR_ALL_MERGED_DATA_MV"."SR_SUB_STATUS" "SR_SUB_STATUS",
       "VWSR_ALL_MERGED_DATA_MV"."SR_DATE_CREATED" "SR_DATE_CREATED",
       "VWSR_ALL_MERGED_DATA_MV"."SR_OPEN_DATE" "SR_OPEN_DATE",
       "VWSR_ALL_MERGED_DATA_MV"."SR_CLOSED_DATE" "SR_CLOSED_DATE",
       "VWSR_ALL_MERGED_DATA_MV"."SR_PRODUCT1" "SR_PRODUCT1",
       "VWSR_ALL_MERGED_DATA_MV"."SR_PRODUCT2" "SR_PRODUCT2",
       "VWSR_ALL_MERGED_DATA_MV"."SR_TIO_PRIORITY" "SR_TIO_PRIORITY",
       "VWSR_ALL_MERGED_DATA_MV"."SR_REF_NUMBER" "SR_REF_NUMBER",
       "VWSR_ALL_MERGED_DATA_MV"."SR_DATE_RECD" "SR_DATE_RECD",
       "VWSR_ALL_MERGED_DATA_MV"."SR_CIDN" "SR_CIDN",
       "VWSR_ALL_MERGED_DATA_MV"."SR_BUS_UNIT" "SR_BUS_UNIT",
       "VWSR_ALL_MERGED_DATA_MV"."SR_NUMBER" "SR_NUMBER",
       "VWSR_ALL_MERGED_DATA_MV"."SOURCE_SYSTEM" "SOURCE_SYSTEM",
       "VWSR_ALL_MERGED_DATA_MV"."BATCH_ID" "BATCH_ID"
    FROM
       VWSR_ALL_MERGED_DATA_MV
    WHERE trunc(VWSR_ALL_MERGED_DATA_MV.SR_DATE_RECD)=trunc(sysdate-1)
       and VWSR_ALL_MERGED_DATA_MV.SR_TIO_PRIORITY IN (:P2_SR_TIO_PRIORITY)
    AND  (
         (VWSR_ALL_MERGED_DATA_MV.SR_BUS_UNIT IN (
                         'Business Support and Improvement'
                       , 'Finance and Administration'
                       , 'Cust Sat Simplification and Productivity'
                       , 'Project New and Customer Experience'
                       , 'Corp Strategy and Customer Experience'
                       , 'Other'
    AND :P2_SR_BUSINESS_UNIT= htf.escape_sc('BS&I'))
    OR (VWSR_ALL_MERGED_DATA_MV.SR_BUS_UNIT IN (
                         'Consumer'
                       , 'Consumer Telstra Country Wide'
                       , 'Customer Service and Sales'
                       , 'Offshore Sales and Service'
                       , 'TC and TCW Operations'
                       , 'Telstra Country Wide'
                       , 'Other')
    AND  :P2_SR_BUSINESS_UNIT= htf.escape_sc('TC&C'))
    OR (VWSR_ALL_MERGED_DATA_MV.SR_BUS_UNIT IN
                             'Telstra Customer Sales and Service'                  
                            ,'Telstra Program Office'
                            ,'Human Resources'
                            ,'IT'
                            ,'Unallocated'
                            ,'Other'
            AND :P2_SR_BUSINESS_UNIT= 'OTHER')
    OR (VWSR_ALL_MERGED_DATA_MV.SR_BUS_UNIT IN
                          'Telstra Operations'
                          ,'Telstra Networks and Services'
                          ,'Other'
            AND :P2_SR_BUSINESS_UNIT= 'TO')
    OR (VWSR_ALL_MERGED_DATA_MV.SR_BUS_UNIT IN
                         'Telstra Business'
            AND :P2_SR_BUSINESS_UNIT= 'TB')
       OR (VWSR_ALL_MERGED_DATA_MV.SR_BUS_UNIT IN
                      'Telstra Wholesale'
            AND :P2_SR_BUSINESS_UNIT= 'TW')
       OR (VWSR_ALL_MERGED_DATA_MV.SR_BUS_UNIT IN
                      'Telstra Enterprise and Government'
            AND :P2_SR_BUSINESS_UNIT= htf.escape_sc('TE&G'))
       OR (VWSR_ALL_MERGED_DATA_MV.SR_BUS_UNIT IN
                      'Sensis'
                     ,'Sensis Pty Ltd'
            AND :P2_SR_BUSINESS_UNIT= 'SENSIS')
    AND :P2_SR_TIO_PRIORITY = 'Level 1'Edited by: user13653962 on 30/01/2013 15:11
    Edited by: user13653962 on 30/01/2013 15:14

    You have an error in the code:
    1. you don't provide a value for 'what' - you have to tell Oracle what it should execute when it submits the job.
    And remember - with ISUBMIT the next_date parameter has datatype VARCHAR2 - SUBMIT uses datatype DATE. So make sure you provide a VARCHAR2 value and do not rely on implicit conversion.
    >
    PROCEDURE DBMS_JOB.ISUBMIT
    (job IN BINARY_INTEGER
    ,what IN VARCHAR2
    ,next_date IN VARCHAR2
    ,interval IN VARCHAR2 DEFAULT 'null'
    ,no_parse IN BOOLEAN DEFAULT FALSE);
    PROCEDURE DBMS_JOB.SUBMIT
    (job OUT BINARY_INTEGER
    ,what IN VARCHAR2
    ,next_date IN DATE DEFAULT SYSDATE
    ,interval IN VARCHAR2 DEFAULT 'null'
    ,no_parse IN BOOLEAN DEFAULT FALSE);

  • Can bind a LONG value only for insert into a LONG column

    I got an exception when I was using sesame adapter to dump a turtle file which contains long texts as objects into oracle semantic database. The exception information is:
    org.openrdf.repository.RepositoryException: org.openrdf.sail.SailException: java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
    ORA-06512: in "SF.ORACLE_ORARDF_ADDHELPER", line 1
    ORA-06512: in line 1
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
         at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
         at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
         at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:202)
         at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1005)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1307)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3449)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3530)
         at oracle.jdbc.driver.OracleCallableStatement.executeUpdate(OracleCallableStatement.java:4735)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1350)
         at oracle.spatial.rdf.client.sesame.OracleSailConnection.addStatement(OracleSailConnection.java:1976)
         at org.openrdf.repository.sail.SailRepositoryConnection.addWithoutCommit(SailRepositoryConnection.java:249)
         at org.openrdf.repository.base.RepositoryConnectionBase.add(RepositoryConnectionBase.java:510)
         at org.openrdf.repository.util.RDFInserter.handleStatement(RDFInserter.java:193)
         at org.openrdf.rio.turtle.TurtleParser.reportStatement(TurtleParser.java:963)
         at org.openrdf.rio.turtle.TurtleParser.parseObject(TurtleParser.java:416)
         at org.openrdf.rio.turtle.TurtleParser.parseObjectList(TurtleParser.java:339)
         at org.openrdf.rio.turtle.TurtleParser.parsePredicateObjectList(TurtleParser.java:315)
         at org.openrdf.rio.turtle.TurtleParser.parseTriples(TurtleParser.java:301)
         at org.openrdf.rio.turtle.TurtleParser.parseStatement(TurtleParser.java:208)
         at org.openrdf.rio.turtle.TurtleParser.parse(TurtleParser.java:186)
         at org.openrdf.rio.turtle.TurtleParser.parse(TurtleParser.java:131)
         at org.openrdf.repository.base.RepositoryConnectionBase.addInputStreamOrReader(RepositoryConnectionBase.java:404)
         at org.openrdf.repository.base.RepositoryConnectionBase.add(RepositoryConnectionBase.java:295)
         at org.openrdf.repository.base.RepositoryConnectionBase.add(RepositoryConnectionBase.java:226)
         at sforcl.dao.support.OracleSailDaoTemplate.addTTLFile(OracleSailDaoTemplate.java:114)
         at sforcl.test.OracleSailDaoTemplateTest.testAddTTLFile(OracleSailDaoTemplateTest.java:33)
         at sforcl.test.OracleSailDaoTemplateTest.main(OracleSailDaoTemplateTest.java:122)
    How can I solve this problem?

    Hi,
    Can you please try loading the same file following Example 5 in Section 8.10.5 of
    http://docs.oracle.com/cd/E11882_01/appdev.112/e25609/sem_sesame.htm
    Thanks,
    Zhe

  • ORA-01461: can bind a LONG value only for insert into a LONG column

    Good Afternoon,
    I was just wiondering if my issue is database related rather SQL related, because my process works and the code has not been updated for sometime.
    I receive the above error when tryig to insert into a table. I running Oracle 11g.
    here is my insert command definition:
    With insCmd
    .CommandType = CommandType.Text
    .CommandText = "INSERT INTO ORIGINAL_CLAIMS VALUES (orig_claim_seq.nextval,:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,xmltype(:12),:13,:14,:15)"
    With .Parameters
    .Add(":1", OracleDbType.Int64, ParameterDirection.Input) 'BATCH_ID
    .Add(":2", OracleDbType.Varchar2, ParameterDirection.Input) 'REC_ID
    .Add(":3", OracleDbType.Varchar2, ParameterDirection.Input) 'USER_ID
    .Add(":4", OracleDbType.Varchar2, ParameterDirection.Input) 'FORM_NBR
    .Add(":5", OracleDbType.Varchar2, ParameterDirection.Input) 'PATIENT_NBR
    .Add(":6", OracleDbType.Date, ParameterDirection.Input) 'ADMIT_DATE
    .Add(":7", OracleDbType.Varchar2, ParameterDirection.Input) 'TAX_ID
    .Add(":8", OracleDbType.Varchar2, ParameterDirection.Input) 'CLAIM_TYPE
    .Add(":9", OracleDbType.Date, ParameterDirection.Input) 'SUBMIT_DATE
    .Add(":10", OracleDbType.Date, ParameterDirection.Input) 'RECEIVE_DATE
    .Add(":11", OracleDbType.Varchar2, ParameterDirection.Input) 'CLAIM_SOURCE
    .Add(":12", OracleDbType.Clob, ParameterDirection.Input) 'CLAIM_XML * XML Data
    .Add(":13", OracleDbType.Date, ParameterDirection.Input) 'LOAD_DATE
    .Add(":14", OracleDbType.Date, ParameterDirection.Input) 'UPDATE_DATE
    .Add(":15", OracleDbType.Varchar2, ParameterDirection.Input) 'DOC_NO
    End With
    .Prepare()
    End With
    Here is the insert command to insert the record:
    With insCmd.Parameters
    .Item(":1").Value = batchID
    .Item(":2").Value = RecID
    .Item(":3").Value = UserID
    .Item(":4").Value = ""
    .Item(":5").Value = PatientNbr
    .Item(":6").Value = AdmitDate
    .Item(":7").Value = Left(TaxId, 9)
    .Item(":8").Value = Left(ClaimType, 1)
    .Item(":9").Value = SubmitDate
    .Item(":10").Value = ReceiveDate
    .Item(":11").Value = ClaimSource
    .Item(":12").Value = claimNode.OuterXml
    .Item(":13").Value = Now
    .Item(":14").Value = Now
    .Item(":15").Value = docNo
    End With
    insCmd.ExecuteNonQuery()
    What is strange is that this will work for some records and not for others.
    for example, i have a batch that has 50 recs, i should have the same records in my table, only 1 record gets inserted before the error occurs.
    So in rec 2 there is something that is preventing the insert to execute.
    There is either some 'junk' in the xml or some junk data on the other 14 fiields that would cause the insert to fail.
    as i step thru the process, to me the data looks valid.
    Any insight would be appreciated,
    thanks.
    Mike

    here's the table DDL:
    CREATE TABLE CCBH_TEST.ORIGINAL_CLAIMS
    CLAIM_SEQ NUMBER(18),
    BATCH_ID NUMBER(18),
    REC_ID VARCHAR2(5 BYTE),
    USER_ID VARCHAR2(10 BYTE),
    FORM_NBR VARCHAR2(8 BYTE),
    PATIENT_NBR VARCHAR2(50 BYTE),
    ADMIT_DATE DATE,
    TAX_ID VARCHAR2(20 BYTE),
    CLAIM_TYPE VARCHAR2(1 BYTE),
    SUBMIT_DATE DATE,
    RECEIVE_DATE DATE,
    CLAIM_SOURCE VARCHAR2(120 BYTE),
    CLAIM_XML SYS.XMLTYPE,
    LOAD_DATE DATE,
    UPDATE_DATE DATE,
    DOC_NO VARCHAR2(30 BYTE)
    I got tied up in some production issues, will look at rec 2 some time next week.
    since this is a TEST environment, i'm not that worried about it, but i would like find out.
    It could be another field with 'bad' data.
    thanks,

  • ORA-01461: can bind a LONG value only for insert into a LONG column - APEX

    Hi There,
    I getting the above error in the edit query section of the report queries.
    Navigation: Shared Components>Report Queries>Edit Report Query
    The same sql query is working fine in Toad. Also if I create a view on this sql query and use it in the Report Queries, it works fine. However I can't do that as I have to pass parameters to this query at runtime and it is a complex query.
    Please let me know what could be the reason and how can it be corrected.
    Thanks
    Krishna

    Any Thoughts?

Maybe you are looking for