ORA-22275 inserting into the CLOB column using ODBC input parameters

Hi all,
I'm having problem with INSERT into the CLOB column via bound input parameters.
After calling SQLExecDirect() I'm getting following error:
[Oracle][ODBC][Ora]ORA-22275: invalid LOB locator specified
Adding defaults to the table definitions does not help. If I embed parameter values into the SQL statement - everything works just fine.
I use Oracle 9.2 with latest Oracle ODBC driver 9.2.0.4 under Windows XP.
Any ideas appreciated...
Vlad
Code looks like this:
SQLBindParameter(hstmt,1,...);
SQLBindParameter(hstmt,2,...);
SQLBindParameter(hstmt,3,...);
SQLExecDirect(hstmt,...);
SQL statement looks like this:
insert into tst_table (id,str_fld,clob_fld1,clob_fld2) values (50, ? , ? , ?)
Table looks like this:
CREATE TABLE tst_table (
     id          number (10,0)     NOT NULL ,
     str_fld          nvarchar2 (50)     NOT NULL ,
     clob_fld1     nclob          NOT NULL ,
     clob_fld2     nclob          NOT NULL ,
     CONSTRAINT PK_tst_table PRIMARY KEY
          id
I tried to add defaults to the table, but result is the same:
CREATE TABLE tst_table (
     id          number (10,0)               NOT NULL ,
     str_fld          nvarchar2 (50)               NOT NULL ,
     clob_fld1     nclob     default EMPTY_CLOB()     NOT NULL ,
     clob_fld2     nclob     default EMPTY_CLOB()     NOT NULL ,
     CONSTRAINT PK_tst_table PRIMARY KEY
          id

You need to provide the data at execution time (i.e. SQL_LEN_DATA_AT_EXEC(0) in the SQLBindParameter followed by a series of SQLPutData calls). If you go to Metalink
Top Tech Docs | Oracle ODBC Driver | Scripts & Sample Code
has some sample code that shows you how to do this.
Justin

Similar Messages

  • How to update\insert data into a NVARCHAR column using ODBC API

    I am trying to update a Sybase table via Microsofts ODBC API. The following is the basics of the C++ I am trying to execute. In table, TableNameXXX, ColumnNameXXX has a type of  NVARCHAR( 200 ).
    SQLWCHAR updateStatement[ 1024 ] = L"UPDATE TableNameXXX SET ColumnNameXXX = N 'Executive Chair эюя' WHERE PKEYXXX = 'VALUE'";
    if( ret = SQLExecDirect( hstmt, ( SQLWCHAR* ) updateStatement, SQL_NTS ) != SQL_SUCCESS )
    // Handle Error
    The Sybase database has a CatalogCollation of 1252LATIN1, CharSet of windows-1252,  Collation of 1252LATIN1, NcharCharSet of UTF-8 and an NcharCollation of UCA.
    Once this works for the Sybase ODBC connection I need to get it to work in various other ODBC drivers for other databases.
    The error i get is "[Sybase][ODBC Driver][SQL Anywhere]Syntax error near 'Executive Chair ' on line 1"
    If i take out the Unicode characters and remove the N it will update. 
    Does anyone know how to get this to work? What am I missing?
    I wrote a C# .net project using an ODBCConnection to a SQL Server database and am getting "sort of" the same error. I means sort of as this error contains the Unicode Text in the message whereas the Sybase ODBC error has "lost" the unicode.
    static void Main(string[] args)
    using (OdbcConnection odbc = new OdbcConnection("Dsn=UnicodeTest;UID=sa;PWD=password")) // ;stmt=SET NAMES 'utf8';CharSet=utf16"
    //using (OdbcConnection odbc = new OdbcConnection("Dsn=Conversion;CharSet=utf8")) // ;stmt=SET NAMES 'utf8';CharSet=utf8
    try
    odbc.Open();
    string queryString = "UPDATE TableNameXXX SET ColumnNameXXX = N 'Executive Chair эюя' WHERE PKEYXXX = 'AS000008'";
    System.Console.Out.WriteLine(queryString);
    OdbcCommand command = new OdbcCommand(queryString);
    command.Connection = odbc;
    int result = command.ExecuteNonQuery();
    if( result == 1)
    System.Diagnostics.Debug.WriteLine("Success");
    catch(Exception ex)
    System.Diagnostics.Debug.WriteLine(ex.StackTrace);
    System.Diagnostics.Debug.WriteLine(ex.Message);
    "ERROR [42000] [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near 'Executive Chair эюя'."

    Your error comes from Sybase, so I suggest you post your question to a Sybase forum.  And be aware that Sybase does not use the same tsql dialect as sql server, so you must use their dialect (if, indeed, there is any difference in this particular situation). 
    One note - there should be no space between "N" and the Unicode string literal to which it applies in tsql.  E.g.,
    = N'Executive Chair эюя'
    not
    = N 'Executive Chair эюя'

  • SQL LOADER: how to load CLOB column using stored function

    Hi,
    I am a newbie of sql loader. Everything seems to be fine until I hit a
    road block - the CLOB column type. I want to load data into the clob
    column using a stored function. I need to do some manipulation on the
    data before it gets saved to that column. But I got this error when I
    run the sql loader.
    SQL*Loader-309: No SQL string allowed as part of "DATA" field
    specification
    DATA is my CLOB type column.
    here is the content of the control file:
    LOAD DATA
    INFILE 'test.csv'
    BADFILE 'test.bad'
    DISCARDFILE 'test.dsc'
    REPLACE
    INTO TABLE test_table
    FIELDS TERMINATED BY ','
    OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    codeid          BOUNDFILLER,
    reason          BOUNDFILLER,
    Checkstamp     "to_date(:CHECKSTAMP, 'mm/dd/yyyy')",
    "DATA"          "GetContent(:codeid, :reason)"
    All references are suggesting to use a file to load data on
    CLOB column but I want to use a function in which it generates
    the content to be saved into the column.
    Any help is greatly appreciated.
    Thanks,
    Baldwin
    MISICompany

    *** Duplicate Post ... Please Ignore ***

  • Probelm regarding insert into long datatype column

    hi all ,
    in one of my table one column's datatype is long and i want to insert a value into this column but getting following error
    ora-1461 :- can bind a LONG value only for insert into a long column
    please help me
    any help appriciated

    Show us the code...?
    Looks like you are trying to insert into the wrong column.

  • ORA-01461 when trying to insert text 4000 characters into a CLOB column

    I work on a Windows application that connects to databases using ODBC. I'm currently working on adding Oracle support to the application, but I'm running into a lot of problems inserting strings of more than 4000 characters into CLOB columns. First, I tried to do that directly using code similar to the following (setup, cleanup, and error checking snipped for clarity).
    SQLHDBC hDbc;
    SQLHSTMT hStmt;
    unsigned char query[200];
    SQLAllocStmt(hDbc, &hStmt);
    strcpy(query,"INSERT INTO test_table (col_clob, col_int) ('long string', 1)");
    SQLExecDirect(hStmt,query,strlen(query));
    Of course, "long string" was really a string of more than 4000 characters. When I did that, I got an error indicating that I needed to use bind parameters for strings that long. However, bind parameters don't seem to work either. I changed my code to something like the following:
    SQLHDBC hDbc;
    SQLHSTMT hStmt;
    unsigned char query[200];
    +unsigned char *str=NULL;+
    int str_size;
    SQLAllocStmt(hDbc, &hStmt);
    strcpy(query,"INSERT INTO test_table (col_clob, col_int) (:strvar, 1)");
    SQLPrepare(hStmt,query,SQL_NTS);
    str = (unsigned char*)malloc(6000 * sizeof(unsigned char));
    SQLBindParameter(hStmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARBINARY, 0, 0, str, sizeof(str), &str_size);
    strcpy(str,'long_string');
    str_size = SQL_NTS;
    SQLExecute(hStmt);
    This code works fine when 'long_string' is less than 4000 characters. When it's greater than that, I get the following error:
    +[Oracle][ODBC][Ora]ORA-01461: can bind a LONG value only for insert into a LONG column+
    I'm using Visual Studio.NET 2003 on Windows XP, and Oracle client 11.1.0.6.0. My server version is as follows:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    I thought I read somewhere that this is a known bug with Oracle 10.2.0.1.0, but I can't seem to find the reference now. Can anyone confirm this or provide some assistance with this problem? Frankly, it seems kind of ridiculous that I can't do something as simple as inserting a reasonably sized amount of text into a CLOB column. I'm considering using BFILEs instead, but that would be kind of a pain to fit into our application, so I'd prefer not to do this if at all possible.
    Thanks in advance for any help.

    I found this link referring to a similar problem that was apparently fixed in version 10.2.0.4 of the server: ORA-01461: can bind a LONG value only for insert into a LONG column Should I try to upgrade the server and see if that fixes things?

  • 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

  • How to insert more than 32k xml data into oracle clob column

    how to insert more than 32k xml data into oracle clob column.
    xml data is coming from java front end
    if we cannot use clob than what are the different options available

    Are you facing any issue with my code?
    String lateral size error will come when you try to insert the full xml in string format.
    public static boolean writeCLOBData(String tableName, String id, String columnName, String strContents) throws DataAccessException{
      boolean isUpdated = true;
      Connection connection = null;
      try {
      connection = ConnectionManager.getConnection ();
      //connection.setAutoCommit ( false );
      PreparedStatement PREPARE_STATEMENT = null;
      String sqlQuery = "UPDATE " + tableName + " SET " + columnName + "  = ?  WHERE ID =" + id;
      PREPARE_STATEMENT = connection.prepareStatement ( sqlQuery );
      // converting string to reader stream
      Reader reader = new StringReader ( strContents );
      PREPARE_STATEMENT.setClob ( 1, reader );
      // return false after updating the clob data to DB
      isUpdated = PREPARE_STATEMENT.execute ();
      PREPARE_STATEMENT.close ();
      } catch ( SQLException e ) {
      e.printStackTrace ();
      finally{
      return isUpdated;
    Try this JAVA code.

  • 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: 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)

  • 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);

  • 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

  • Error - Failure inserting into the read-only column "Adj_ID".

    I received the error messages while importing data from one DB to another.
    Validating (Error)
    Messages
    Error 0xc0202049: Data Flow Task 1: Failure inserting into the read-only column "Adj_ID".
     (SQL Server Import and Export Wizard)
    Error 0xc0202045: Data Flow Task 1: Column metadata validation failed.
     (SQL Server Import and Export Wizard)
    Error 0xc004706b: Data Flow Task 1: "component "Destination 2 - Adjustments" (271)" failed validation and returned validation status "VS_ISBROKEN".
     (SQL Server Import and Export Wizard)
    Error 0xc004700c: Data Flow Task 1: One or more component failed validation.
     (SQL Server Import and Export Wizard)
    Error 0xc0024107: Data Flow Task 1: There were errors during task validation.
     (SQL Server Import and Export Wizard)

    >> Failure inserting into the
    read-only column "Adj_ID". 
    The error message is very clear(inserting to readonly column). Are you inserting data to  Identity or calculated column
    Satheesh
    My Blog

  • Problem in Loading data for clob column using sql ldr

    Hi,
    I am having problem in loading data for tables having clob column.
    Could anyone help me in correcting the below script for ctrl file inorder to load the data which is in mentioned format.
    Any help really appreciated.
    Table Script
    Create table samp
    no number,
    col1 clob,
    col2 clob
    Ctrl File
    options (skip =1)
    load data
    infile 'c:\1.csv'
    Replace into table samp
    fields terminated by ","
    trailing nullcols
    no,
    col1 Char(100000000) ,
    col2 Char(100000000) enclosed by '"' and '"'
    Data File(1.csv)
    1,asdf,"assasadsdsdsd""sfasdfadf""sdsdsa,ssfsf"
    2,sfjass,"dksadk,kd,ss""dfdfjkdjfdk""sasfjaslaljs"
    Error Encountered
    ORA-01461: can bind a LONG value only for insert into a LONG column
    Table sampThanks in advance

    I can't reproduce it on my 10.2.0.4.0. CTL file:
    load data
    INFILE *
    Replace into table samp
    fields terminated by ","
    trailing nullcols
    no,
    col1 Char(100000000) ,
    col2 Char(100000000) enclosed by '"' and '"'
    BEGINDATA
    1,asdf,"assasadsdsdsd""sfasdfadf""sdsdsa,ssfsf"
    2,sfjass,"dksadk,kd,ss""dfdfjkdjfdk""sasfjaslaljs"Loading:
    SQL> Create table samp
      2  (
      3  no number,
      4  col1 clob,
      5  col2 clob
      6  );
    Table created.
    SQL> host sqlldr scott/tiger control=c:\temp\samp.ctl log=c:\temp\samp.log
    SQL> select * from samp
      2  /
            NO
    COL1
    COL2
             1
    asdf
    assasadsdsdsd"sfasdfadf"sdsdsa,ssfsf
             2
    sfjass
    dksadk,kd,ss"dfdfjkdjfdk"sasfjaslaljs
            NO
    COL1
    COL2
    SQL> SY.

Maybe you are looking for

  • Cant Edit Message Body (outlook 2003 and 2007), Cant select text VIA click (word), Cant Edit Advanced Options (word)

    A number of my users are having similar problems across the entire network. These issues have started on 8/26/2014 This problem is not localized to a specific outlook version, the problem is happening on 2003 and 2007 alike. Also this problem is star

  • Calling Windows XP FTP Command in java

    Hi there! Need help in calling Windows XP FTP command in java: executing the FTP command in DOS works well, but when I tried calling it in java using Process and Runtime objects, it successfully transferred the files from remote to my local pc... but

  • Dashboard Design File cannot be opened

    Hi all, I know this is already requested a lot of times but reading through all the different topics did not solve my issue. I've worked on a new .xlf file for about 2 full days without exporting it. What i did was regularly saving the file and conti

  • ISU migration, field CITY_CODE

    Hi all, we are currently facing the following problem and your feedback is highly appreciated. We have maintained the regional structure of Postal Codes/Cities/Streets in our system. Can we use in PARTNER object the field BUT020-CITY_CODE via KSM Mig

  • Need help setting the exact size of my JSlider

    Hello everyone. I'm trying to build a small program to help people learn a about RGB colour values, and at the same time teach myself a bit more about Java. Things have been going fine so far until I came to setting my JSlider's size. The intention i