TNS error on sql query

Hi,
Somebody please explain why it happens when I run some queries. This was in the session log of Informatica tool. Following is the desc...
ORA-12612: TNS:connection is busy
Cause: Attempted operation failed because it conflicts with an ongoing action or status of the connection.
Action: Not normally visible to the user. For further details, turn on tracing and reexecute the operation. If error persists, contact Worldwide Customer Support.
Thanks all.
vg

Zero seems an awfully low setting - you'd be generating constant network traffic. The documentation recommends 10 minutes between checks.
Do you really need to do this dead session checking at all? Unless you are seriously short of resource I would suggest you remove the parameter entirely from the SQLNET.ORA file. You can always get the DBA to check explicitly for non-active sessions (DBAs just sit around all day doing nothing, they would relish this additional task :P ).
Cheers, APC

Similar Messages

  • Error in SQL Query The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. for the query

    hi Experts,
    while running SQL Query i am getting an error as
    The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. for the query
    select  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price ,
    T2.LineText
    from OQUT T0  INNER JOIN QUT1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN
    QUT10 T2 ON T1.DocEntry = T2.DocEntry where T1.DocEntry='590'
    group by  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price
    ,T2.LineText
    how to resolve the issue

    Dear Meghanath,
    Please use the following query, Hope your purpose will serve.
    select  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price ,
    CAST(T2.LineText as nvarchar (MAX))[LineText]
    from OQUT T0  INNER JOIN QUT1 T1 ON T0.DocEntry = T1.DocEntry LEFT OUTER JOIN
    QUT10 T2 ON T1.DocEntry = T2.DocEntry --where T1.DocEntry='590'
    group by  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price
    ,CAST(T2.LineText as nvarchar (MAX))
    Regards,
    Amit

  • ERROR: Updatable SQL Query already exists on page 20.

    Hello,
    I created a tabular form, then added a where clause and started getting the following error:
    Error in mru internal routine: ORA-20001: no data found in tabular form
    So I deleted all components of the tabular form (region, buttons, branches and process) and started building it again from scratch. This is a strategy that has worked for me a number of times in HTML DB. Unfortunately now I get the following error when trying to build a new tabular form:
    Updatable SQL Query already exists on page 20.You can only add one updatable SQL query per page. Select a different page.
    What is the logic that throws this error. I'm 99% convinced I've cleared the page of any updatable SQL, is there something on the application level I should also clear out?
    Thanks!

    Ignore this, problem solved. It seems I do have SQL reports that are marked as updatable even though they are just plain reports.
    Sorry.

  • Error in SQl Query - SQl Command not properly ended

    Hi All
    I have this SQL query that returns the following error when I run it in TOAD:
    SELECT
    VC.CAMPAIGN_NUMBER,VC.CAMPAIGN_TITLE,VC.CAMPAIGN_DESC,
    VCV.START_DATE, VCV.END_DATE,VC.CAMPAIGN_TYPE,VC.APPLICABILITY,
    VC.CAMPAIGN_PRIORITY
         FROM
         VM_CAMPAIGN_VIN VCV ,VM_CAMPAIGN VC
         WHERE
              VCV.VIN = 'US'
              AND
    VCV.CAMPAIGN_NUMBER = VC.CAMPAIGN_NUMBER AND VC.COUNTRY_CODE = 'E'
              AND VC.LANGUAGE_CODE = 'L' AND VC.CAMPAIGN_TYPE = null
    AND SYSDATE BETWEEN VCV.START_DATE AND VCV.END_DATE
    AND SYSDATE BETWEEN VC.START_DATE AND VC.END_DATE)
    A ORDER BY A.CAMPAIGN_PRIORITY DESC, A.END_DATE
    The error is:
    SQl Command not properly ended
    Any help is highly appreciated. Thanks

    Thanks a lot to everyone. It helped me run the query without any problem. Now I have another issue. This may not be the right place to post this question, I think.My apologies for that. The problem is, Weblogic posts an error as follows:
    java.sql.SQLException: ORA-00923: FROM keyword not found where expected
    I am wondering if this is an Java related error or an SQL related error.
    Well, I am using the SQL Statement which you helped debug, and it is inside something called "XXSQLConstants.java consisting of the following SQL statement:
    public static final String XX_ALL_CAMPS_SELECT = "SELECT * FROM" +
         "(SELECT vc.campaign_number, vc.campaign_title, vc.campaign_desc, vc.start_date," +
         "vc.end_date, vc.campaign_type, vc.applicability, vc.campaign_priority" +
    "FROM vm_campaign vc" +
    "WHERE vc.applicability = 'Y'" +
    "AND vc.country_code = ? " +
    "AND vc.language_code = ? " +
    "AND vc.campaign_type = ? "+
    "AND SYSDATE BETWEEN vc.start_date AND vc.end_date" +
    "AND NOT EXISTS (" +
    "SELECT 'X'" +
    "FROM vm_campaign_vin vcv" +
    "WHERE (vcv.vin = ? " +
    "AND vcv.campaign_number = vc.campaign_number" +
    "))" +
         "UNION" +
         "SELECT vc.campaign_number, vc.campaign_title, vc.campaign_desc," +
         "vcv.start_date, vcv.end_date, vc.campaign_type, vc.applicability," +
    "vc.campaign_priority" +
    "FROM vm_campaign_vin vcv, vm_campaign vc" +
    "WHERE vcv.vin = ? " +
    "AND vcv.campaign_number = vc.campaign_number" +
    "AND vc.country_code = ? " +
    "AND vc.language_code = ? " +
    "AND vc.campaign_type IS NULL" +
    "AND SYSDATE BETWEEN vcv.start_date AND vcv.end_date" +
    "AND SYSDATE BETWEEN vc.start_date AND vc.end_date)";
    The SQl runs fine when tested (well, it does not return any data for the rows returned, but there are no errors), but in my application server I get the following error (pointing out the same SQL code pasted above:
    java.sql.SQLException: ORA-00923: FROM keyword not found where expected
    Any suggestions? Thanks in advance. I appreciate all replies

  • Error in SQL query

    I am using the following query to find out the table and column which contain the data '18947567' in any of the column in the whole database.I am gicing some filter condition with the table starting with 'FRI' and with column data type with 'NUMBER' and schema 'FRI' .It is working fine for some schema and tables and this query is giving correct results.But when trying for someother schema it is giving the following errors.
    select distinct table_name
    ,substr (t.column_value.getstringval (), 1, 50) "Column/Value"
    from all_tab_cols,
    table
    (xmlsequence
    (dbms_xmlgen.getxmltype ('select '||column_name
    ||' from '||table_name
    ||' where upper('||column_name||')=''18947567'''
    ).extract('ROWSET/ROW/*'))
    ) t
    where table_name like '%FRI_%'
    and data_type = 'NUMBER'
    and OWNER = 'FRI'
    order by 1
    ORA-19206 AND ORA-06512
    Please help me to solve this error and run the above query.
    Edited by: user10341395 on Jan 18, 2009 10:36 AM
    Edited by: user10341395 on Jan 18, 2009 10:39 AM

    you can post your version?
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL> select distinct table_name
      2  ,substr (t.column_value.getstringval (), 1, 50) "Column/Value"
      3  from all_tab_cols,
      4  table
      5  (xmlsequence
      6  (dbms_xmlgen.getxmltype ('select '||column_name
      7  ||' from '||table_name
      8  ||' where upper('||column_name||')=''18947567'''
      9  ).extract('ROWSET/ROW/*'))
    10  ) t
    11  where table_name like '%FRI_%'
    12  and data_type = 'NUMBER'
    13  and OWNER = 'FRI'
    14  order by 1
    15  /
    no rows selected
    SQL>

  • Odd Variable Substitution Error in SQL Query

    I'm trying to finish up an application but one goofy error is
    throwing me for a loop. The error complains about my SQL syntax on
    the line containing "#filelist_sql#" near the bottom of the query,
    but when I output the SQL and run it in phpMyAdmin, it works fine.
    Thanks in advance for any help provided. I think I've just
    been looking at this way too long.
    Code follows:

    Thanks for the quick assistance, Azadi. I am finding the same
    bit of strangeness occurring just a bit earlier in my code.
    The application complains about the SQL syntax near
    "#grouplist_sql#" in the attached code.
    After the code gets processed (using '11' for
    sql_find_lists.id), the SQL looks like:
    SELECT DISTINCT file_id FROM grouplists_to_files WHERE
    grouplist_ids = '11' OR grouplist_ids LIKE '11,%' OR grouplist_ids
    LIKE '%,11' OR grouplist_ids LIKE '%,11,%'
    Hopefully someone can spot something else brilliantly obvious
    that is wrong here.

  • Error in sql query as "loop has run more times than expected (Loop Counter went negative)"

    Hello,
    When I run the query as below
    DECLARE @LoopCount int
    SET @LoopCount = (SELECT Count(*) FROM KC_PaymentTransactionIDConversion with (nolock) Where KC_Transaction_ID is NULL and TransactionYear is NOT NULL)
    WHILE (
        SELECT Count(*)
        FROM KC_PaymentTransactionIDConversion with (nolock)
        Where KC_Transaction_ID is NULL
        and TransactionYear is NOT NULL
    ) > 0
    BEGIN
        IF @LoopCount < 0
            RAISERROR ('Issue with data in KC_PaymentTransactionIDConversion, loop has run more times than expected (Loop Counter went negative).', -- Message text.
                   16, -- Severity.
                   1 -- State.
    SET @LoopCount = @LoopCount - 1
    end
    I am getting error as "loop has run more times than expected (Loop Counter went negative)"
    Could any one help on this issue ASAP.
    Thanks ,
    Vinay

    Hi Vinay,
    According to your code above, the error message make sense. Because once the value returned by “SELECT Count(*)  FROM KC_PaymentTransactionIDConversion with (nolock) Where KC_Transaction_ID is NULL and TransactionYear is NOT NULL” is bigger than 0,
    then decrease @LoopCount. Without changing the table data, the returned value always bigger than 0, always decrease @LoopCount until it's negative and raise the error.
    To fix this issue with the current information, we should make the following modification:
    Change the code
    WHILE (
    SELECT Count(*)
    FROM KC_PaymentTransactionIDConversion with (nolock)
    Where KC_Transaction_ID is NULL
    and TransactionYear is NOT NULL
    ) > 0
    To
    WHILE @LoopCount > 0
    Besides, since the current query is senseless, please modify the query based on your requirement.
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Errors executing SQL query in EJB 2.0 QL using RAD-6.0 on WAS-6.0

    I have 3 tables in my database which is running on DB2 UDB ESE V-8.2
    The tables are emp, dept & policy_master respectively
    Table emp has columns id, name, deptid, and policyid.Here dept id and policyid are foreign keys which are referenced by dept and policy_master tables
    In the dept table column deptid is primay key and non-key is dept name
    In my policy_master table i have column policyid as primay key and non-key column is policy name
    Now i want to find records in emp table by deptid column in emp table which should return a emp local interface
    Now for that i had written ejbql "select object(o) from emp o where o.deptid=?1" using finder method namely findByDeptid(String deptid) in emp entity bean.
    When i execute the entity bean using RAD Test Client,I am getting following 2 errors namely:
    1. "WQRY0036E: Emp o does not have a field deptid in ejb-jar.xml "
    2. "Class must implement the inherited abstract method CMPEmpLocalHome.findByDeptid(String) EJSLocalCMPEmpHome_0783c8c6.java TestEJB/ejbModule/sample"
    When i analysed the problem i found that the deptid in emp bean is not defined as a CMP field in the map file & deployment descriptor that is why i am not able to write such kind of ejb queries.The deptid field in emp table is having a foreign key relationship with dept table.
    Detailed Discription of tables structure
    Table EMP
    Column name Type name Length Scale Nulls
    EMPID VARCHAR 4 0 No (Primary Key)
    FIRSTNAME VARCHAR 10 0 Yes
    LATSNAME VARCHAR 10 0 Yes
    DEPTID VARCHAR 4 0 No (Foreign Key Refrenced By Dept Table)
    POLICY_ID VARCHAR 10 0 No (Foreign Key Refrenced By Policy Master Table)
    Table DEPT
    Column name Type name Length Scale Nulls
    DEPTID VARCHAR 4 0 No (Primary Key)
    DEPTNAME VARCHAR 10 0 Yes
    DEPTLOCATION VARCHAR 10 0 Yes
    Table POLICY_MASTER
    Column name Type name Length Scale Nulls
    POLICY_ID VARCHAR 10 0 No (Primary Key)
    POLICY_NAME VARCHAR 10 0 Yes
    Now I want to find all record using findByDeptid method in EMP table. So for that what ejb ql I have to write.
    I used "select object(o) from emp where deptid=?1" then I am getting error in "ejb-jar.xml" that field does not exist.
    So please tell me how can I find records in emp table so that the bean returns a local interface.
    Please provide some assisstance as soon as possible
    Thanks in Advance,
    Mahesh.B.S

    I have 3 tables in my database which is running on DB2 UDB ESE V-8.2
    The tables are emp, dept & policy_master respectively
    Table emp has columns id, name, deptid, and policyid.Here dept id and policyid are foreign keys which are referenced by dept and policy_master tables
    In the dept table column deptid is primay key and non-key is dept name
    In my policy_master table i have column policyid as primay key and non-key column is policy name
    Now i want to find records in emp table by deptid column in emp table which should return a emp local interface
    Now for that i had written ejbql "select object(o) from emp o where o.deptid=?1" using finder method namely findByDeptid(String deptid) in emp entity bean.
    When i execute the entity bean using RAD Test Client,I am getting following 2 errors namely:
    1. "WQRY0036E: Emp o does not have a field deptid in ejb-jar.xml "
    2. "Class must implement the inherited abstract method CMPEmpLocalHome.findByDeptid(String) EJSLocalCMPEmpHome_0783c8c6.java TestEJB/ejbModule/sample"
    When i analysed the problem i found that the deptid in emp bean is not defined as a CMP field in the map file & deployment descriptor that is why i am not able to write such kind of ejb queries.The deptid field in emp table is having a foreign key relationship with dept table.
    Detailed Discription of tables structure
    Table EMP
    Column name Type name Length Scale Nulls
    EMPID VARCHAR 4 0 No (Primary Key)
    FIRSTNAME VARCHAR 10 0 Yes
    LATSNAME VARCHAR 10 0 Yes
    DEPTID VARCHAR 4 0 No (Foreign Key Refrenced By Dept Table)
    POLICY_ID VARCHAR 10 0 No (Foreign Key Refrenced By Policy Master Table)
    Table DEPT
    Column name Type name Length Scale Nulls
    DEPTID VARCHAR 4 0 No (Primary Key)
    DEPTNAME VARCHAR 10 0 Yes
    DEPTLOCATION VARCHAR 10 0 Yes
    Table POLICY_MASTER
    Column name Type name Length Scale Nulls
    POLICY_ID VARCHAR 10 0 No (Primary Key)
    POLICY_NAME VARCHAR 10 0 Yes
    Now I want to find all record using findByDeptid method in EMP table. So for that what ejb ql I have to write.
    I used "select object(o) from emp where deptid=?1" then I am getting error in "ejb-jar.xml" that field does not exist.
    So please tell me how can I find records in emp table so that the bean returns a local interface.
    Please provide some assisstance as soon as possible
    Thanks in Advance,
    Mahesh.B.S

  • Error While execting SQL Query : No Data to Read from Sockt.

    Hi,
    I am getting the Error "No Data To Read from Sockt" While executing SQL Query from PL/SQL Developer and same error i am getting while i trying on Toad and SQL*Plus also.
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE     10.2.0.3.0     Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production Pls suggest !!
    Thanks n Regards
    Rj

    Try to connect without tnsnames. So try the basic connection from SQLDeveloper.
    If it works, you have to verify your tnsnames.ora
    Are you th only person to have this connection problem or all users meet this error?
    Does this connection worked before, is it a new connection?
    What changes occured since the connection is out of service.

  • Error while executing a sql query for select

    HI All,
    ORA-01652: unable to extend temp segment by 128 in tablespace PSTEMP i'm getting this error while i'm executing the sql query for selecting the data.

    I am having 44GB of temp space, while executing the below query my temp space is getting full, Expert please let us know how the issue can be resolved..
    1. I dont want to increase the temp space
    2. I need to tune the query, please provide your recomendations.
    insert /*+APPEND*/ into CST_DSA.HIERARCHY_MISMATCHES
    (REPORT_NUM,REPORT_TYPE,REPORT_DESC,GAP,CARRIED_ITEMS,CARRIED_ITEM_TYPE,NO_OF_ROUTE_OF_CARRIED_ITEM,CARRIED_ITEM_ROUTE_NO,CARRIER_ITEMS,CARRIER_ITEM_TYPE,CARRIED_ITEM_PROTECTION_TYPE,SOURCE_SYSTEM)
    select
    REPORTNUMBER,REPORTTYPE,REPORTDESCRIPTION ,NULL,
    carried_items,carried_item_type,no_of_route_of_carried_item,carried_item_route_no,carrier_items,
    carrier_item_type,carried_item_protection_type,'PACS'
    from
    (select distinct
    c.REPORTNUMBER,c.REPORTTYPE,c.REPORTDESCRIPTION ,NULL,
    a.carried_items,a.carried_item_type,a.no_of_route_of_carried_item,a.carried_item_route_no,a.carrier_items,
    a.carrier_item_type,a.carried_item_protection_type,'PACS'
    from CST_ASIR.HIERARCHY_asir a,CST_DSA.M_PB_CIRCUIT_ROUTING b ,CST_DSA.REPORT_METADATA c
    where a.carrier_item_type in('Connection') and a.carried_item_type in('Service')
    AND a.carrier_items=b.mux
    and c.REPORTNUMBER=(case
    when a.carrier_item_type in ('ServicePackage','Service','Connection') then 10
    else 20
    end)
    and a.carrier_items not in (select carried_items from CST_ASIR.HIERARCHY_asir where carried_item_type in('Connection') ))A
    where not exists
    (select *
    from CST_DSA.HIERARCHY_MISMATCHES B where
    A.REPORTNUMBER=B.REPORT_NUM and
    A.REPORTTYPE=B.REPORT_TYPE and
    A.REPORTDESCRIPTION=B.REPORT_DESC and
    A.CARRIED_ITEMS=B.CARRIED_ITEMS and
    A.CARRIED_ITEM_TYPE=B.CARRIED_ITEM_TYPE and
    A.NO_OF_ROUTE_OF_CARRIED_ITEM=B.NO_OF_ROUTE_OF_CARRIED_ITEM and
    A.CARRIED_ITEM_ROUTE_NO=B.CARRIED_ITEM_ROUTE_NO and
    A.CARRIER_ITEMS=B.CARRIER_ITEMS and
    A.CARRIER_ITEM_TYPE=B.CARRIER_ITEM_TYPE and
    A.CARRIED_ITEM_PROTECTION_TYPE=B.CARRIED_ITEM_PROTECTION_TYPE
    AND B.SOURCE_SYSTEM='PACS'
    Explain Plan
    ==========
    Plan
    INSERT STATEMENT ALL_ROWSCost: 129 Bytes: 1,103 Cardinality: 1                                                        
         20 LOAD AS SELECT CST_DSA.HIERARCHY_MISMATCHES                                                   
              19 PX COORDINATOR                                              
                   18 PX SEND QC (RANDOM) PARALLEL_TO_SERIAL SYS.:TQ10002 :Q1002Cost: 129 Bytes: 1,103 Cardinality: 1                                         
                        17 NESTED LOOPS PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 129 Bytes: 1,103 Cardinality: 1                                    
                             15 HASH JOIN RIGHT ANTI NA PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 129 Bytes: 1,098 Cardinality: 1                               
                                  4 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 63 Bytes: 359,283 Cardinality: 15,621                          
                                       3 PX SEND BROADCAST PARALLEL_TO_PARALLEL SYS.:TQ10001 :Q1001Cost: 63 Bytes: 359,283 Cardinality: 15,621                     
                                            2 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD :Q1001Cost: 63 Bytes: 359,283 Cardinality: 15,621                
                                                 1 MAT_VIEW ACCESS FULL MAT_VIEW PARALLEL_COMBINED_WITH_PARENT CST_ASIR.HIERARCHY :Q1001Cost: 63 Bytes: 359,283 Cardinality: 15,621           
                                  14 NESTED LOOPS ANTI PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 65 Bytes: 40,256,600 Cardinality: 37,448                          
                                       11 HASH JOIN PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 65 Bytes: 6,366,160 Cardinality: 37,448                     
                                            8 BUFFER SORT PARALLEL_COMBINED_WITH_CHILD :Q1002               
                                                 7 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 1 Bytes: 214 Cardinality: 2           
                                                      6 PX SEND BROADCAST PARALLEL_FROM_SERIAL SYS.:TQ10000 Cost: 1 Bytes: 214 Cardinality: 2      
                                                           5 INDEX FULL SCAN INDEX CST_DSA.IDX$$_06EF0005 Cost: 1 Bytes: 214 Cardinality: 2
                                            10 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD :Q1002Cost: 63 Bytes: 2,359,224 Cardinality: 37,448                
                                                 9 MAT_VIEW ACCESS FULL MAT_VIEW PARALLEL_COMBINED_WITH_PARENT CST_ASIR.HIERARCHY :Q1002Cost: 63 Bytes: 2,359,224 Cardinality: 37,448           
                                       13 TABLE ACCESS BY INDEX ROWID TABLE PARALLEL_COMBINED_WITH_PARENT CST_DSA.HIERARCHY_MISMATCHES :Q1002Cost: 0 Bytes: 905 Cardinality: 1                     
                                            12 INDEX RANGE SCAN INDEX PARALLEL_COMBINED_WITH_PARENT SYS.HIERARCHY_MISMATCHES_IDX3 :Q1002Cost: 0 Cardinality: 1                
                             16 INDEX RANGE SCAN INDEX PARALLEL_COMBINED_WITH_PARENT CST_DSA.IDX$$_06EF0001 :Q1002Cost: 1 Bytes: 5 Cardinality: 1

  • SQL Query error in java swing Application

    hi,
    I'm getting the following error when i try to manipulate the date in query.I have set of tuples and would like to retrieve with respect to the date given.Please do help me to get rid of this error.This is the error.
    MY QUERY:
    ResultSet rsdate=st1.executeQuery("select * from phy_stock where date = "+d1+"");
    Where d1 is given like this:
    String startdate[2]="11/31/2008";
    DateFormat df = new SimpleDateFormat ("MM/dd/yyyy"); //converting a string to DATE format.
    Date d1 = df.parse(startdate[2]);
    ERROR:
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'date = Mon Sep 01 00:00:00 IST 2008'
    thanks,
    kumar.

    Dates do not have formats. When referencing a Date in String concatenation, which is what you are doing here,
    ResultSet rsdate=st1.executeQuery("select * from phy_stock where date = " + d1 + "");you will get what Date's toString method produces, which will not work for that (or any) query. For one, it wouldn't be surrounded by single quotes ('), and for two, the String format of the Date would not be acceptable by the DB (unless you had changed the DBs defaults).
    Use a PreparedStatement, as suggessted above, and this problem goes away.
    Edit: And make sure to use the setDate method, of course.

  • PL/SQL function body returning SQL query - ORA-06502: PL/SQL: numeric or value error

    I'm attempting to dynamically generate a rather large SQL query via the "PL/SQL function body returning SQL query" report region option.  The SQL query generated will possibly be over 32K.  When I execute my page, I sometimes receive the "ORA-06502: PL/SQL: numeric or value error" which points to a larger than 32K query that was generated.  I've seen other posts in the forum related to this dynamic SQL size limitation issue, but they are older (pre-2010) and point to the 32K limit of the DNS (EXECUTE IMMEDIATE) and DBMS_SQL.  I found this post (dynamic sql enhancements in 11g) which discusses 11g no longer having the 32K size limitation for generating dynamic SQL.  Our environment is on 11gR2 and using ApEx 4.2.1.  I do not know which dynamic SQL method -- DNS or DBMS_SQL -- ApEx 4.2.1 is using.  Can someone clarify for me which dynamic SQL method ApEx uses to implement the "PL/SQL function body returning SQL query" option?
    As a test, I created a page on apex.oracle.com with a report region with the following source:
    declare
      l_stub varchar2(25) := 'select * from sys.dual ';
      l_sql  clob := l_stub || 'union all ';
      br     number(3) := 33;
    begin
      while length ( l_sql ) < 34000 loop
        l_sql := l_sql || l_stub || 'union all ';
      end loop;
      l_sql := l_sql || l_stub;
      for i in 1 .. ceil ( length ( l_sql ) / br ) loop
        dbms_output.put_line ( dbms_lob.substr ( l_sql, br, ( ( i - 1 ) * br ) + 1 ) );
      end loop;
      return l_sql;
    end;
    The dbms_output section is there to be able to run this code in SQL*Plus and confirm the size of the SQL is indeed larger than 32K.  When running this in SQL*Plus, the procedure is successful and produces a proper SQL statement which can be executed.  When I put this into the report region on apex.oracle.com, I get the ORA-06502 error.
    I can certainly implement a work-around for my issue by creating a 'Before Header' process on the page which populates an ApEx collection with the data I am returning and then the report can simply select from the collection, but according to documentation, the above 32K limitation should be resolved in 11g.  Thoughts?
    Shane.

    What setting do you use in your report properties - especially in Type and in Region Source?
    If you have Type="SQL Query", then you should have a SELECT statement in the Region Source. Something like: SELECT .... FROM ... WHERE
    According to the ERR-1101 error message, you have probably set Type to "SQL Query (PL/SQL function body returning SQL query)". In this situation APEX expects you to write a body of a PL/SQL function, that will generate the text of a SQL query that APEX should run. So it can be something like:
    declare
    mycond varchar2(4000);
    begin
    if :P1_REPORT_SEARCH is not null THEN
    mycond:='WHERE LAST_NAME like :P1_REPORT_SEARCH ||''%''';
    end if;
    return 'select EMPLOYEE_ID, FIRST_NAME, LAST_NAME from EMPLOYEES ' ||mycond;
    end;
    And for escaping - are you interested in escaping the LIKE wildcards, or the quotes?
    For escaping the wildcards in LIKE function so that when the user enters % you will find a record with % and not all functions, look into the SQL Reference:
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/conditions007.htm
    (You would than need to change the code of your function accordingly).
    If you are interested in escaping the quotes, try to avoid concatenating the values entered by the user into the SQL. If you can, use bind variables instead - as I have in my example above. If you start concatenating the values into the text of SQL, you are open to SQLInjection - user can enter anything, even things that will break your SQL. If you really need to allow users to choose the operator, I would probably give them a separate combo for operators and a textfield for values, than you could check if the operator is one of the allowed ones and create the condition accordingly - and than still use bind variable for inserting the filtering value into the query.

  • Error in report when executing pl/sql function body returning sql query.

    Hi,
    I have used the pl/sql function body returning sql query for creating a report. I have created a datepicker(
    P10_TASK_DATE) which can be submitted.The code is as below
    DECLARE
    v_sql varchar2(3000);
    BEGIN
    if :P10_TASK_DATE is not null THEN
    v_sql:='select
          * from tasks';
    return v_sql;
    else
    v_sql:='select * from discovery';
    return v_sql;
    END IF;
    END;if the date field is empty "select * from discovery" is executed and report is getting generated. But when we give a
    date using date picker the page is submitted and i get "report error: ORA-01403: no data found" even
    though the "tasks" table has data in it. Plz help
    Thanks,
    TJ

    hi
    Please try this
    1. Create 2 region
    1st region source=
    select * from tasks'
    go to the tab -> condition =
    item NOT NULL
    EXpression1 =:P10_TASK_DATE
    this will run whenever the item have any date
    2. open your 2 nd region source code= select * from discovery
    put the condition
    item is  NULL
    EXpression1 =:P10_TASK_DATE
    thanks
    Mark Wyatt

  • Getting zero-sized reply error when running report from SQL query

    Hi,
    I have a Report from SQL Query in Portal. When I select Excel in Output Format and then run the report, it works properly, but when I select HTML in Output Format, the report works if the rows returned are not so many (I've been able to display the report for up to 701 rows), but when I try selecting a value from the LOV that selects many rows, I get the following error:
    ERROR
    The requested URL could not be retrieved
    While trying to retrieve the URL: <data suppressed>
    The following error was encountered:
    Zero Sized Reply
    Squid did not receive any data for this request.
    Any ideas on how to fix this? Why does the number of rows returned affect the report this way?
    Thanks,
    Lorena

    Problem comes when any of the filter is applied in any one of the cases selected from the GUI.Do you mean that the problems only shows when you run the report in your browser via 9iAS?
    Which version are you using?
    Can you post the before report trigger?

  • Getting Zero Sized Reply error in report from SQL query

    Hi,
    I have a Report from SQL Query in Portal 3.0.9. When I select Excel in Output Format and then run the report, it works properly, but when I select HTML in Output Format, the report works if the rows returned are not so many (I've been able to display the report for up to 701 rows), but when I try selecting a value from the LOV that selects many rows, I get the following error:
    ERROR
    The requested URL could not be retrieved
    While trying to retrieve the URL: <data suppressed>
    The following error was encountered:
    Zero Sized Reply
    Squid did not receive any data for this request.
    Any ideas on how to fix this? Why does the number of rows returned affect the report this way?
    Thanks,
    Lorena

    Hi,
    I have a Report from SQL Query in Portal 3.0.9. When I select Excel in Output Format and then run the report, it works properly, but when I select HTML in Output Format, the report works if the rows returned are not so many (I've been able to display the report for up to 701 rows), but when I try selecting a value from the LOV that selects many rows, I get the following error:
    ERROR
    The requested URL could not be retrieved
    While trying to retrieve the URL: <data suppressed>
    The following error was encountered:
    Zero Sized Reply
    Squid did not receive any data for this request.
    Any ideas on how to fix this? Why does the number of rows returned affect the report this way?
    Thanks,
    Lorena

Maybe you are looking for

  • MacBook Wont sleep from Apple Menu?

    Every time I try to sleep my computer from the apple menu it doesn't work it will just sit. I did an upgrade from Leopard not a clean install.

  • Renaming main file causes compiled SWF to stop working in Firefox only

    I have a project as follows: src\UploadIndex.mxml (main file) src\com\FileUploader.mxml I want to rename the main file to "FileUploader". I've renamed the component file to "Uploader", then renamed the main file to "FileUploader". The project now loo

  • Collections: can't transfer photos in

    I set up a new collection and loaded photos into it. I wanted to add more, but nothing would transfer. I set up another new collection, but nothing would transfer into that either. I rebooted the program and the same results. I rebooted my PC with th

  • E6 Belle refresh with Prod code 059h6f1

    Are users with the product code 059h6f1 to be forgotten like the belle update? It took long enough to get Microsoft apps.  Anna/Belle handsets : E6-00 s60 handsets : E71 grey steel, 6700slide Purple s40 Handsets : Nokia C3-01, 6086, N6300. JesusPad2

  • Filtering Spam with JavaMail

    My spam filter, ChiaraMail, has come up against some spam which it doesn't know how to deal with. Specifically, I've been getting more and more spam whose content is in HTML and obfuscated with "<...>" tags. For example, M<foo>ake<bar>Mo<fasdf>ney<vc