Fetch LONG column into String -- null pointer

Case 1/ Fetch a LONG column directly from embedded SELECT statement
Result: iterator.my_long_column() returns the expected data
Case 2/ Fetch the same LONG column from a REF CURSOR that was returned by a stored function
Result: For the first row fetched, iterator.my_long_column() now returns a null pointer, but all the other columns in the query (VARCHAR2s) still return the expected data. For subsequent rows everything works fine...
Any ideas?

Hi
I faced similar error  mistake was same as you did that giving it to string value ,
<MethodName> obj=new <MethodName>(modelobject);
List L1=new ArrayList();
ArrayOfString arrStr=new ArrayOfString(<modelobject>);
String_Item it=new String_Item(<modelobject>);
item.setItem(<Value1>); L1.add(it);
it=new String_Item(<modelobject>);
item.setItem(<Value2>); L1.add(it);
etc..
arrStr.set<setter>(L1);
obj.set<ArrayOfString(arrStr);
So it require a object of type Collection (List ...)
Hope it help you
Best Regards
Satish Kumar

Similar Messages

  • Select LONG column into CLOB variable

    Hi all,
    I am trying retrieve the data present in a LONG column into a CLOB variable.
    However I am getting an error, pls let me know how I can resolve it.
    DECLARE
    v_text CLOB;
    BEGIN
    SELECT TO_LOB(trigger_body)
    INTO v_text
    FROM
    user_triggers
    WHERE
    ROWNUM <= 1;
    END;
    ERROR at line 8:
    ORA-06550: line 8, column 20:
    PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got LONG
    ORA-06550: line 8, column 5:
    PL/SQL: SQL Statement ignored
    Let me know if there is an alternate to this. I would like to get the data present in the LONG column into a variable.
    The reason why I am not retrieving the LONG column into LONG variable is stated below (from Oracle Website):
    You can insert any LONG value into a LONG database column because the maximum width of a LONG column is 2**31 bytes.
    However, you cannot retrieve a value longer than 32760 bytes from a LONG column into a LONG variable.
    Thanks and Regards,
    Somu

    There are couple of things I did (listed in order):
    1) Create Global Temporary Table containing a CLOB column
    2) Select LONG column and convert to CLOB by using TO_LOB and insert into Global Temporary Table containing a CLOB column
    2) Select from this Global Temporary Table (which already contains data in CLOB) and assign it to a CLOB variable.
    This is done because you can not directly use TO_LOB in a select statement to assign the value to a CLOB variable.
    Stated below is an example:
    -- Create Temporary Table
    CREATE GLOBAL TEMPORARY TABLE glb_tmp_table_lob(
    time TIMESTAMP WITH LOCAL TIME ZONE,
    text CLOB
    ON COMMIT DELETE ROWS;
    -- PL/SQL Block to Execute
    DECLARE
    v_clob CLOB;
    BEGIN
    -- Insert into Temporary Table by converting LONG into CLOB
    INSERT INTO glb_tmp_table_lob (
    time ,
    text
    SELECT
    sysdate ,
    TO_LOB(dv.text)
    FROM
    dba_views dv
    WHERE
    ROWNUM <= 1
    -- Select from the Temporary table into the variable
    SELECT
    gt.text
    INTO
    v_clob
    FROM
    glb_tmp_table_lob gt;
    COMMIT;
    -- Now you can use the CLOB variable as per your needs.
    END;
    /

  • What is in the column, empty string, null or ....?

    I am using Oracle 11.2, have one table tb_class as following:
    TB_CLASS (id number(3), nm varchar2(32), seqNum number(3));
    1, ,212
    2,'as', 12
    3, 'qq', 12
    select * from TB_CLASS where id=1 and nm=null; ...no row selected
    select nvl(nm) from TB_CLASS where id=1; ...1 row selected
    Any one know what is in column nm for row id=1? I thought it is empty string, but why it returns no row in the first query?
    Thanks!

    1) In Oracle there is no difference between NULL and the empty string.
    2) NULL is never equal to anything (including another NULL). NULL is never unequal to anything (including another NULL). You need to use the IS NULL and/ or IS NOT NULL operators in order to look for NULL values
    SELECT *
      FROM tb_class
    WHERE nm IS NULLor
    SELECT *
      FROM tb_class
    WHERE nm IS NOT NULLOf course, it is also possible that you are stating that the NM column contains one or more spaces or that it contains one or more non-printable characters rather than a NULL. That's why you were asked what dump(nm) returns
    Justin

  • Null Pointer when fetching VARRAY / OBJEC TYPE

    Hi,
    i'm trying to fetch a VARRAY, containing an Obeject Type consisiting of two NUMBERS (see scripts below). Now i used JDeveloper to generate corresponding Java Klasses. What i'm trying to do is this:
    String SQL = "select quantityprice from ts_transaction_q_history where hist_id = 125608";
    Map map = null;
    Class obj = null;
    Connection tmpCon = null;
    PreparedStatement tmpStmt = null;
    ResultSet tmpRS = null;
    VaQuantitypriceQ100 tmpQP100 = null;
    OtQuantityprice tmpQP = null;
    OtQuantityprice[] tmpQPArr = null;
    ARRAY tmpQP100ARR = null;
    try {
    tmpCon = getConnection();
    map= tmpCon.getTypeMap();
    obj = Class.forName("ch.egl.emis.persistence.wrapper.VaQuantitypriceQ100");
    map.put(VaQuantitypriceQ100._SQL_NAME, obj);
    tmpCon.setTypeMap(map);
    tmpStmt = tmpCon.prepareStatement(SQL);
    tmpRS = tmpStmt.executeQuery();
    while (tmpRS.next()) {
    tmpQP100ARR = (ARRAY) tmpRS.getObject(1);
    System.out.println(tmpQP100ARR.toString());
    ORADataFactory factory = VaQuantitypriceQ100.getORADataFactory();
    tmpQP100 = (VaQuantitypriceQ100) factory.create(tmpQP100ARR, OracleTypes.ARRAY);
    Long quan = tmpQP.getQuantity().longValue();
    Long price = tmpQP.getPrice().longValue();
    Well, everything works fine, as far as i can see. I get a Quantity (quan), but when i try to get the price, i get a null pointer.
    I am sure, that there is data on the DB and the value for price is nut null. i an using JBoss 3.2.7 and Oracle 9i. Connection is "thin" (may that be the Ptoblem)?
    Anybody ther who had similar problems or has a solution for this?
    Many thanks
    Sven
    ********************** VA_QUANTITYPRICE_Q_100 *********************************
    CREATE OR REPLACE TYPE VA_QUANTITYPRICE_Q_100 AS VARRAY(100) OF OT_QUANTITYPRICE
    ********************** OT_QUANTITYPRICE *********************************
    CREATE OR REPLACE TYPE "OT_QUANTITYPRICE" as object (
    quantity number,
    price number
    )

    Sven,
    Here is my simplified example. I hope it helps you.
    I am using JDK 1.5.0_06, Oracle 9.2.0.1 database and latest Oracle JDBC driver ("ojdbc14.jar").
    create or replace type OBJ as object (
      QUANTITY  number
    ,PRICE     number
    create or replace type VA_OBJ as varray(100) of OBJ
    create table TBL (
      CLMN  VA_OBJ
    insert into TBL (CLMN)
    values (VA_OBJ(OBJ(0,1),OBJ(10,100),OBJ(100,1000)))
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.Arrays;
    import oracle.jdbc.pool.OracleDataSource;
    import oracle.sql.ARRAY;
    import oracle.sql.STRUCT;
    public class ArStruct {
      public static void main(String[] args) {
        Connection c = null;
        OracleDataSource ods = null;
        ResultSet rs = null;
        Statement s = null;
        try {
          ods = new OracleDataSource();
          ods.setURL("jdbc:oracle:thin:scott/tiger@//host:1521/orcl");
          c = ods.getConnection();
          s = c.createStatement();
          rs = s.executeQuery("select CLMN from TBL");
          if (rs.next()) {
            ARRAY ar = (ARRAY) rs.getObject(1);
            Object[] obj = (Object[]) ar.getArray(1L, 1);
            if (obj != null) {
              STRUCT struct = (STRUCT) obj[0];
              obj = struct.getAttributes();
              System.out.println(Arrays.asList(obj));
        catch (Exception x) {
          x.printStackTrace();
        finally {
          if (c != null) {
            try {
              c.close();
            catch (SQLException xSql) {
              System.err.println("Failed to close database connection.");
              xSql.printStackTrace();
          if (ods != null) {
            try {
              ods.close();
            catch (SQLException xSql) {
              System.err.println("Failed to close datasource.");
              xSql.printStackTrace();
    }When I run the above class, this is the output:
    [0, 1]Good Luck,
    Avi.

  • Null Pointer when fetching VARRAY / OBJECT TYPE

    Hi,
    i'm trying to fetch a VARRAY, containing an Obeject Type consisiting of two NUMBERS (see scripts below). Now i used JDeveloper to generate corresponding Java Klasses. What i'm trying to do is this:
    String SQL = "select quantityprice from ts_transaction_q_history where hist_id = 125608";
    Map map = null;
    Class obj = null;
    Connection tmpCon = null;
    PreparedStatement tmpStmt = null;
    ResultSet tmpRS = null;
    VaQuantitypriceQ100 tmpQP100 = null;
    OtQuantityprice tmpQP = null;
    OtQuantityprice[] tmpQPArr = null;
    ARRAY tmpQP100ARR = null;
    try {
    tmpCon = getConnection();
    map= tmpCon.getTypeMap();
    obj = Class.forName("ch.egl.emis.persistence.wrapper.VaQuantitypriceQ100");
    map.put(VaQuantitypriceQ100._SQL_NAME, obj);
    tmpCon.setTypeMap(map);
    tmpStmt = tmpCon.prepareStatement(SQL);
    tmpRS = tmpStmt.executeQuery();
    while (tmpRS.next()) {
    tmpQP100ARR = (ARRAY) tmpRS.getObject(1);
    System.out.println(tmpQP100ARR.toString());
    ORADataFactory factory = VaQuantitypriceQ100.getORADataFactory();
    tmpQP100 = (VaQuantitypriceQ100) factory.create(tmpQP100ARR, OracleTypes.ARRAY);
    Long quan = tmpQP.getQuantity().longValue();
    Long price = tmpQP.getPrice().longValue();
    Well, everything works fine, as far as i can see. I get a Quantity (quan), but when i try to get the price, i get a null pointer.
    I am sure, that there is data on the DB and the value for price is nut null. i an using JBoss 3.2.7 and Oracle 9i. Connection is "thin" (may that be the Ptoblem)?
    Anybody there who had similar problems or has a solution for this?
    Many thanks
    Sven
    ********************** VA_QUANTITYPRICE_Q_100 *********************************
    CREATE OR REPLACE TYPE VA_QUANTITYPRICE_Q_100 AS VARRAY(100) OF OT_QUANTITYPRICE
    ********************** OT_QUANTITYPRICE *********************************
    CREATE OR REPLACE TYPE "OT_QUANTITYPRICE" as object (
    quantity number,
    price number
    )

    Hi,
    i'm trying to fetch a VARRAY, containing an Obeject Type consisiting of two NUMBERS (see scripts below). Now i used JDeveloper to generate corresponding Java Klasses. What i'm trying to do is this:
    String SQL = "select quantityprice from ts_transaction_q_history where hist_id = 125608";
    Map map = null;
    Class obj = null;
    Connection tmpCon = null;
    PreparedStatement tmpStmt = null;
    ResultSet tmpRS = null;
    VaQuantitypriceQ100 tmpQP100 = null;
    OtQuantityprice tmpQP = null;
    OtQuantityprice[] tmpQPArr = null;
    ARRAY tmpQP100ARR = null;
    try {
    tmpCon = getConnection();
    map= tmpCon.getTypeMap();
    obj = Class.forName("ch.egl.emis.persistence.wrapper.VaQuantitypriceQ100");
    map.put(VaQuantitypriceQ100._SQL_NAME, obj);
    tmpCon.setTypeMap(map);
    tmpStmt = tmpCon.prepareStatement(SQL);
    tmpRS = tmpStmt.executeQuery();
    while (tmpRS.next()) {
    tmpQP100ARR = (ARRAY) tmpRS.getObject(1);
    System.out.println(tmpQP100ARR.toString());
    ORADataFactory factory = VaQuantitypriceQ100.getORADataFactory();
    tmpQP100 = (VaQuantitypriceQ100) factory.create(tmpQP100ARR, OracleTypes.ARRAY);
    Long quan = tmpQP.getQuantity().longValue();
    Long price = tmpQP.getPrice().longValue();
    Well, everything works fine, as far as i can see. I get a Quantity (quan), but when i try to get the price, i get a null pointer.
    I am sure, that there is data on the DB and the value for price is nut null. i an using JBoss 3.2.7 and Oracle 9i. Connection is "thin" (may that be the Ptoblem)?
    Anybody there who had similar problems or has a solution for this?
    Many thanks
    Sven
    ********************** VA_QUANTITYPRICE_Q_100 *********************************
    CREATE OR REPLACE TYPE VA_QUANTITYPRICE_Q_100 AS VARRAY(100) OF OT_QUANTITYPRICE
    ********************** OT_QUANTITYPRICE *********************************
    CREATE OR REPLACE TYPE "OT_QUANTITYPRICE" as object (
    quantity number,
    price number
    )

  • Text search query into long column

    hi,
    I need some explanation about this situation:
    I need to perform a search into a long column containing XML file. Not all records found match my search criteria.
    If I search in a varchar column it seem to be correct, so have you any suggest for me?
    thanks in advance,
    Virginio
    null

    I'm working with Oracle8i version 8.1.7
    realese 3.
    This is an example of query that I'm using:
    select *
    from <table>
    where contains (<column>, <string>, 0) > 0
    where <column> is of type Long and <string>
    is the text to search. At the moment I don't need to apply any score filter.
    I've generated the index on this table as suggested by documentation:
    create index <index_name> on <table>(<column>) indextype is ctxsys.context;
    Thanks in advanced,
    Virginio.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Omar Alonso ([email protected]):
    Could you please post the test case? What's the db version and platform?<HR></BLOCKQUOTE>
    null

  • ORA-07445 (solaris 9.0.) when inserting into LONG column

    i am getting a core-dump when inserting into a table w/ long column. running 9.0.1 on solaris.
    ORA-07445: exception encountered: core dump [kghtshrt()+68] [SIGSEGV] [Address not mapped to object] [0x387BBF0] [] []
    if anyone has ANY input - please provide it ... i am desperate at this point.
    i am trying to avoid upgrading to 9.2.0 to solve this problem.
    regards -
    jerome

    You should report this in a service request on http://metalink.oracle.com.
    It is a shame that you put all the effort here to describe your problem, but on the other hand you can now also copy & paste the question to Oracle Support.
    Because you are using 10.2.0.3; I am guessing that you have a valid service contract...

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

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

  • Concatenate strings from a column into a single row

    I am trying to string values from a column into a single row. I need a list of students (one row per student) with their phone number and they could have more than one number. I found a function that should do what I need but the syntax is for SQL Server, not SQL*Plus. I've tried several variations but can not come up with the correct syntax.
    This is the SQL Server version:
    CREATE FUNCTION dbo.GetPhoneList(@StudentID int)
    RETURNS varchar(500) AS
    BEGIN
    DECLARE @StringList varchar(500)
    SELECT @StringList = COALESCE(@StringList + ‘, ‘, ”) + Telephone.PhoneNumber
    FROM Telephone t
    WHERE t.StudentID = @StudentID
    IF @StringList IS NULL
    SET @StringList = ‘No Phone’
    RETURN @StringList
    END
    SQL*Plus does not like the @ symbol, so I tried taking that out. I've put semi-colons where I think they should be, but I still get various error messages. Any suggestions?
    Thanks.

    Hi,
    What you want to do is called "String Aggregation"
    You could write a PL/SQL funcrtion to do that for a specific column in a specific table, but [this page|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2196162600402] has a couple of different generic solutions that will work on any tables and columns.
    I recommend the first soluton, the user-defined function STRAGG, which you can copy from that page.
    Once you have STRAGG installed, your query can be something like:
    SELECT     s.student_id
    ,     NVL ( STRAGG (t.phone_number)
             , 'No phone'
             )     AS phone_nums
    FROM          student          s
    LEFT OUTER JOIN     telephone     t     ON s.student_id     = t.student_id
    GROUP BY     s.student_id;On Oracle 10 (and up) you may have a similar function, WM_CONCAT (owned by WMSYS), already installed.
    WM_CONCAT is not documented, so you may not want to use it in your Production applications.
    It lokks like
    Edited by: Frank Kulash on Feb 10, 2009 6:31 PM

  • Null pointer error if not started with 1st in string

    hi, this little pratice is about building a simple shopping cart. the TOAD.JSP will display the item list and quantity, user could check item and input the quantity that they want. if the user input larger quantity than database, servlet will sent the back to TOAD.jsp and show message. now it works if selected from 1 item, but if selected 2nd or 3rd, it will have null pointer error over here:
    for(int i=0; i<ItemList.size(); i++)
    newit = (ItemBean)ItemList.get(i);
    if (item != null && item.equals(newit.getItem()) )
    %>
    <tr>
    <td ><input type="checkbox" name = "item" value="<%= newit.getItem() %>"><b><%= newit.getItem() %> </b><br></td>
    <td><input type=text name="<%= newit.getItem() %>Qty" value="<%= orderQty%>"></td>
    </tr>
    <tr><td colspan = 2>
    <font size="3" color="red">
    The item <%= newit.getItem() %> is NOT available in stock</font>
    </td>
    </tr>
    <%
    } else {
    %>
    <tr>
    <td ><input type="checkbox" name = "item" value="<%= newit.getItem() %>"><b><%= newit.getItem() %> </b><br></td>
    <td><b><input type=text name="<%= newit.getItem() %>Qty" value="<%= newit.getQty()%>"></b> </td>
    </tr>
    <%
    %>
    thanks for your time!

    You have prvided unsufficent information and poorly formatted code and as such no meaningful answer can given you at present.
    But here is the best that one can guess at.
    You have a null somewhere.
    Is it coming from this code? I am going to say no.
    Where does it come from? I don't know.
    Where should you look? In the code that does processing to see what happens when yuo have more than one item.
    What should you do next? Start putting in some debugging and tracing statements to see where you are heading off into the null abyss.

  • ORA-01405: fetched column value is NULL

    Hi All,
    I am using OWB 10gR2 and DB 10gR2. I am getting the following error while executing the mapping,
    ORA-01405: fetched column value is NULL.
    I have used NVL function for the measure columns, but the problem is not solved.
    Can anybody please tell me solution,
    Thanks in advance,
    Siva

    Hi Siva
    It may be that you've taken care of null value in just one place and now, the error is coming
    from somewhere further down the line.
    Regards
    Arif

  • How to get an XML string store in CLOB or LONG column ?

    How to get an XML string store in CLOB or LONG column ?
    We use XSU with the following command
    String str = qry.getXMLString();
    but all the "<" are replace by "&lt;"
    It's impossible to parse the result for XSLT transformation
    Thank's for your help
    Denis Calvayrac
    Example :
    in the column "TT_NAME"
    "<name><firstname>aaa</<firstname><lastname>bbb</lastname></name>
    I want this result
    <TT_NAME>
    <name>
    <firstname>aaa</firstname>
    <lastname>bbb</lastname>
    </name>
    </TT_NAME>
    but, I have this result
    <TT_NAME>
    &lt;name&gt;
    &lt;firstname&gt;aaa&lt;/firstname&gt;
    &lt;lastname&gt;bbb&lt;/lastname&gt;
    &lt;/name&gt;
    </TT_NAME>

    Can you post some of your code, so I can take a look ?
    Thanks

  • 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

  • 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

Maybe you are looking for