Ora-01461

Hi,
I am working in oracle 10g. i am inserting the records in a table from the appliaction(Java application). In that i am getting an error as
ORA-01461 .
DB - 10.2.0.1.0 (i am using LONG datatype for the column)
Kindly provide me a solution for this.
Rgds...

ORA-01461:     can bind a LONG value only for insert into a LONG column
Cause:     An attempt was made to insert a value from a LONG datatype into another datatype. This is not allowed.
Action:     Do not try to insert LONG datatypes into other types of columns.
As you say you are using LONG data type for the column, could you post the exact INSERT statement that is generated (of course, I am not looking for values here)?
Is your INSERT formed without a column list (like INSERT INTO TABLE VALUES (...) instead of INSERT INTO TABLE (col1, col2...) VALUES (....))? This could be the reason as columns won't match as expected.

Similar Messages

  • Error ORA-01460 warning ORA-01461 during running a mapping with parameters

    Oracle 10g release2(10.2.0.1.0), OWB 10.2.0.1.31, Workflow server 2.6.4
    I have a simple process flow ( start -> mapping -> end).
    The mapping consists of 4 input groups(3 ordinary tables<INGRP1, INGRP2, INGRP3> and 1 mapping input parameter operator <INGRP4>), a joiner, a filter, an expression operator and 1 output group.
    I want to use two variables in join condition, so I bound two mapping input parameters(<INGRP4.SRC_SYS_CDE> and <INGRP4.ADMIN_ORG_NUM>) with two parameters of the process flow's start activity.
    Those two mapping input parameters are of type char, one is 4-char long and the other is 2-char long. So I set both of the two parameters of the start activity as String, one as 08, another as 7504.
    My join condition is:
    INGRP1.ORGIDT = INGRP2.SOURCEORGANIZATIONNO AND
    INGRP2.SOURCESYSTEMCODE = INGRP4.SRC_SYS_CDE AND
    INGRP2.ADMINORGANIZATIONNO = INGRP4.ADMIN_ORG_NUM AND
    INGRP1.CURCDE = INGRP3.NUM(+)
    There are no errors and warnings in validation, generation and deployment process, but when I run the process flow, it always finishes blankly(zero insert) with no error and warning messages. It should insert more than 20,000 rows.
    When I run the mapping and set the parameters 08 and 7504 at the parameter prompt, then start, the following error and warning occurs.
    Error ORA-01460: unimplemented or unreasonable conversion requested
    Warning ORA-01461: can bind a LONG value only for insert into a LONG column
    So what's the problem? How can I fix it?

    The problem was mapping input parameter type.
    VARCHAR2-type mapping input parameter works with String-type PF parameter. But CHAR-type won't.

  • Bug: updating a view with a CLOB column results in ORA-01461

    Here is a database script to create a table and a view:
    CREATE TABLE TEST_CLOB(ID NUMBER, TEXT CLOB);
    CREATE OR REPLACE VIEW VTEST_CLOB AS
    SELECT ID, TEXT FROM
        SELECT ID, TEXT
        FROM TEST_CLOB
        WHERE ID IN (SELECT 1 FROM DUAL)
    The following code throws ORA-01461: can bind a LONG value only for insert into a LONG column.
    static void Main()
         using (var conn = new OracleConnection(ConnectionString))
              conn.Open();
              var trans = conn.BeginTransaction();
              var cmd = conn.CreateCommand();
              cmd.BindByName = true;
              var p = new OracleParameter("vText", new string('a', 4001));
              cmd.Parameters.Add(p);
              cmd.CommandText = "UPDATE vTEST_ClOB set TEXT = :vText";
              cmd.ExecuteNonQuery();
              trans.Rollback();
    Please create a table and a view exactly as shown above.
    The error doesn't happen when updating TEST_CLOB table itself or if the view is created as follows:
    CREATE OR REPLACE VIEW VTEST_CLOB AS
    SELECT ID, TEXT FROM
        SELECT ID, TEXT
        FROM TEST_CLOB
        WHERE ID IN (1)
    This code was tested with ODP.NET version 4.112.3.0 and ODP.NET Managed Beta2 version 4.112.3.60.
    Oracle 11g Release 11.2.0.2.0 64-bit.
    When constructing OracleParameter like this: var p = new OracleParameter(name, stringValue), OracleDbType property is always set to OracleDbType.Varchar2,
    but I think it should take into accout the size of the stringValue and change it to OracleDbType.Clob automatically.

    I've noticed similar behavior with byte arrays.
    Parameters with byte[] data longer than 4000 bytes are treated as RAW or LONG RAW type values (not sure which one exactly).
    Explicitly setting parameter type to OracleDbType.Blob works around this problem.
    Also, it's very strange that these errors don't seem to occur on tables, only views are affected.
    Any thoughts on this please?

  • ORA-01461 error

    Hi, all
    I am loading data in csv format into the Oracle 9i table. I can proceed with one a few lines, but end up with "ORA-01461 can bind a LONG value only for insert into a LONG column" error message. When I uncomment the setSQL call in earch loop, I got my job done with no complain. I wonder is there something wrong with my source code, or repeatedly bind and execute on a prepared statement are just disallowed.
    The csv data is something like:
    4409020,xxxxxx,6578B,,
    9901400,xxxxx,11CBM,,
    4447130,xxxx,6578H,,
    And the C++ source:
    PFile file("data.csv");
    int colCount = 5;
    int colTypes[] = {
         occi::OCCI_SQLT_CHR,
         occi::OCCI_SQLT_CHR,
         occi::OCCI_SQLT_CHR,
         occi::OCCI_SQLT_CHR,
         occi::OCCI_SQLT_NUM
    int count = 0;
    PString line;
    PStringArray fields;
    // prepare
    stmt->setSQL("INSERT INTO m_pckk_hatyu VALUES (:1,:2,:3,:4,:5)");
    while (file.ReadLine(line)) {
         //stmt->setSQL((const char *)sql);
         fields = line.Tokenise(",", TRUE);
         csvColCount = fields.GetSize();
         if (colCount != csvColCount) {
              cout << "Skip line " << (count+1) << ": " << line << endl;
              continue;
         // bind
         for (int j=0; j<colCount; j++) {
              if (colTypes[j] == occi::OCCI_SQLT_NUM) {                         // number
                   stmt->setNumber(j+1, occi::Number(fields[j].AsReal()));
              } else if (colTypes[j] == occi::OCCI_SQLT_CHR) {               // varchar2
                   stmt->setString(j+1, (const char *)fields[j]);
         // execute
         count += stmt->executeUpdate();

    When you are dealing with long varchars, try using the stmt->setMaxParamSize(index, maxSize) API. i beleive oracle has some predefined optimized sizes for the bind variables. Here the index is the index of the bind variable and the maxSize is the size of the varchar.

  • Report Wizard - Inconsistency causing ORA-01461 - bind a LONG (bug?)

    We have come across an inconsistency in the creation of APEX report region resulting in an error "ORA-01461: can bind a LONG value only for insert into a LONG column"
    I want to share this to either get the attention of someone on the development team to help fix it, or to help someone who is running into the same issue and how to work around it.
    Here are the details:+
    Specs_*
    Latest APEX 4.0.2.00.07
    DB 11.1 and 11.2 confirmed same.
    Process+*
    First - complex nasty query. Fact of life - sometimes it happens. Long with over 4K characters
    Creating a STANDARD report (non interactive) - using the CREATE PAGE wizard or the CREATE REGION wizard, after entering in the SQL, it will throw a simple error page (wwv_flow.accept) showing the error ORA-01461: can bind a LONG value only for insert into a LONG column
    Workaround+*
    Run the same wizard with select * from dual to get the page and region created.
    Once it is created - edit the region - and place the long nasty query in the region source. It will then take and work as expected.
    Other Findings+*
    Originally, we considered it was because of the LENGTH of the query. This proved to be un-true. We were able to run the wizard with a 20,000 character select statement without an issue. We are still investigating, but it is difficult to determine what is going on inside the wizard. The SQL is valid and performs well, even if it is complex.
    Note: Because of placement of bind variables - it does not work well as a view.
    The work around is good to know, but the behavior has been described as "buggy" by some of my developers.
    If anyone is interested in more details, please let me know.
    --Tim                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Thank you for innovating the trick to go around this (bug?) !!!
    rgrds Paavo

  • ORA-01461 error using jdbc 10.2.0.1.0

    I am using the oracle jdbc 10.2.0.1.0 ( the latest version) and oracle 10g (10.1.0.4.0) database. Sometimes, the error "ORA-01461: can bind a LONG value only for insert into a LONG column' if I use a java program to insert record to a table containing a 'long raw' field. Previously, the same java program work well with oracle 9i.
    Interestingly, the 'ORA-01461' only SOMETIMES happen. If the problem appears, I need to rename the table and create a new one and then the data can be inserted.

    After 3 days of deep analysis on my project, now I have a clear idea of the problem.
    As you can find on web, newer versions of Oracle drivers for Java have the possibility to set property :
    oracle.jdbc.RetainV9LongBindBehavior=true
    it's considered the fix for this bug, and effectively it seems to work.
    But also with this setting, drivers have one more bug!+
    The problem appears in these conditions:
    - Application tries to save a string into a LONG column database
    - String length is more than 4000 bytes
    - String has less than 4000 characters (it's possible in case of international characters, which takes more than 1 byte)
    With these conditions, we have again error ORA-01461: can bind a LONG value only for insert into a LONG column.
    It seems that drivers evaluate string length before saving it, and consider it as LONG only for 4000+ characters. The bug is just on this check, that must consider length in bytes, according to database character encoding, and not simply for character length.
    As workaround, on my application we added a logic that appends spaces (" ") until total characters are at least 4001. In this way, string is considered correctly as LONG and storage works correctly.
    The check is something similar to this:
    if(value.getBytes("UTF-8").length > 4000 && value.length() < 4000)
    for(int x = value.length(); x<=4000; x++)
    value += " "; // always use StringBuffer for appending
    This workaround works, but it's clear that it can be not acceptable in many cases, for application funcionalities. In my specific bug, it has been very useful.
    My customer opened a ticket to Oracle, asking for solution of this bug. I will wait for Oracle answer.
    Finally, we have to say that Oracle warned to not use anymore LONG datatype: it's deprecated since v8.0.
    Bye guys ;-)
    Edited by: user12274810 on 25-nov-2009 12.04

  • ORA-01461 while importing from UTF8 to AL32UTF8

    Hello All,
    Source Env: 9i on Solaris
    Dest Env: 10.2.0.3 on Solaris 10
    We have a table in a UTF8 database(9i).
    While trying to import it into a AL32UTF8, it terminates with
    IMP-00058: ORACLE error 1461 encountered
    ORA-01461: can bind a LONG value only for insert into a LONG column
    IMP-00028: partial import of previous table rolled back: 9170 rows rolled back The table has a column with LONG datatype.
    Is this error because of the characterset conversion ?
    TIA,
    JJ

    Srini,
    I checked that already.
    This table does not have LOB datatype. Only NUMBER,VARCHAR2,DATE and LONG.
    Moreover, i tried with and without pre creating the table. Both ways result in this error.
    TIA,
    J J

  • 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

  • BUG? ORA-01461 in Unit Tester when saving a long Dynamic Value Query

    I get an ORA-01461 "can bind a LONG value only for insert into a LONG column" error when saving a Test Implementation with a Dynamic Value Query whose length of the SQL statement is roughly 2,000 characters - I'm UNIONing ALL about 30 test case values together, but it seems to be choking on such a long SQL string for some reason....
    I am running version Early Adopter Release #2 (2.1.0.63), build MAIN-63.10.
    Thoughts?

    Confirmed.
    Bug 9119144: ORA-01461 IN UNIT TESTER WHEN SAVING A LONG DYNAMIC VALUE QUERY (OR OTHER CLOB)
    Brian Jeffries
    SQL Developer Team

  • 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!

  • ORA-01461 - Inserting pound sign

    Wonder if anyone can help with this issue?
    I'm running Oracle Forms [32 Bit] Version 10.1.2.0.2 (Production) with OC4J 10.1.2.0.2 against Oracle database version 11.1.0.7.0. where the NLS_CHARACTERSET on the database is AL32UTF8.
    NLS_LANG on my machine is:
         SQL> @.[%NLS_LANG%].
         SP2-0310: unable to open file ".[AMERICAN_AMERICA.WE8MSWIN1252]..sql"
         SQL>
    I have a form with a non database block containing a push button and text item field, Data Type - CHAR, Maximum Length - 1000, Data Length Semantics - Null
    create table amc_pound_test
    ( apt_id number
    , text1 varchar(2000)
    Using the button with a When-Button-Pressed trigger I try to insert the text, "£1", into the above table using the following code:
         DECLARE
              aSeq Number;
         BEGIN
              Select NVL(MAX(Apt_Id),0) + 1
              Into aSeq
              From AMC_POUND_TEST;
              Insert Into AMC_POUND_TEST
              ( apt_id
              , text1
              Values
              ( aSeq
              , 'Direct: '||:block3.text1
              commit;
              insert_rec(:block3.text1);
         END;
    Where insert_rec is a program unit defined as:
         PROCEDURE insert_rec ( pi_Text1 amc_pound_test.Text1%TYPE ) IS
              aSeq Number;
         BEGIN
              Select NVL(MAX(Apt_Id),0) + 1
              Into aSeq
              From AMC_POUND_TEST;
         INSERT INTO AMC_POUND_TEST
         ( Apt_Id
         , Text1
         VALUES
         ( aSeq
         , 'Via Proc: '||pi_Text1
         commit;
         END;
    When the Maximum Length of field on the form (:block3.text1) is set to 1000 or less both inserts work fine.
    Once the Maximum Length is increased to more than 1000, e.g. 1001, 1333, 2000 the insert via the Insert_Rec procedure fails with an ORA-01461 error.
    However, if I remove the pound sign, both inserts work fine!
    Any ideas?
    Many Thanks
    Anton

    Seems to be related to Oracle Bug 5143833.
    I'll update if the workaround to set the NLS_LANG to UTF8 works on customer site.

  • Gettin ORA-01461 error in informatica level

    Hi All
    Iam getting following error at informatica level.
    WRT_8229 : Database errors occurred:
    ORA-01461: can bind a LONG value only for insert into a LONG column
    But we dont have any column with LONG datatype. only we have varchar2 datatype and date. its direct loading from source to target.
    could you please provide me the solution
    thanks
    LNR

    Looks like a bug..check metalink note 728074.1
    Pls mark correct/helpful...

  • ORA-01461 in report.

    Hi All,
    Please advice on following:
    I have:
    Table A with column ONE varchar2(2000)
    Table B With columnTWO varchar2(2000)
    Report with embedded program unit (package) that does something like:
    Declare
    v_temp varchar2(2000);
    begin
    select ONE into v_temp from A;
    insert into B (TWO) values (v_temp);
    Commit;
    end;
    The result is ORA-01461: can bind a LONG value only for insert into a LONG column
    Actual length of v_temp variable does not exceed 300 character.
    Would you have any ideas why this happens and how can be overcome?
    Thank you.

    That what I exactly did.
    But I would like to find solution, as this report aimed to be distrebuded in 100+ sites and it much easier just to copy rep file....
    Might national character be the reason for it?

Maybe you are looking for

  • ITunes 11.0.2 will not allow me to drag any files to import items between computers using Home Sharing. Help?

    There are no "import" thumbnails and I'm un able to drag and drop files. I've ensured on both computers that they both have sharing capabilities. All the websites say that I should be able to just drag and drop the files into the outgoing computer li

  • Change Quiz Buttons

    Should be as simple as a nursery rhyme, but I can't make the gray buttons go away on a quiz slide. If I go to a button's properties and change it to an image button, scroll until I find one approriately colored for my presentation and click OK, the b

  • Multiclip angles dissappear

    Help .. Could anyone tell me why my multiclip angles dissappear from the viewer as soon as I hit play. Only the active angle shows. They come back when I stop. Sometimes it all works fine, sometimes it doesn't .. and I don't seem to be doing anything

  • Xl spreadsheets too small to read...?

    just recently come fromt he dark side...and really liking this OS and pretty much everything on this macbook pro. however I still prefer to stick with xl and as such am trying to find out how to make the spreadsheets appear larger...without having to

  • Calling an ABCS Requester from a DB Adapter

    I have built a standard AIA integration scenario where we have the following processes: Requestor DB Adapter (pulls data from source system - implemented as an ESB) Requester ABCS (implemented as BPEL) EBS Payables Invoice (implemented as an ESB) Pro