SQL query writing limit exceeded.

Hi,
My query contains 1700 lines and the report builder query writen provide line maximum line limit is 1615. When i paste the query in SQL area of report builder, Its paste the 1615 lines and remaining lines cutoff.Its provide the facility to type the query but not to paste the query further. According to the Scenario i cant able to create the view.So please tell me how can i handle it.
Thanks.

Does the query really have to be that big?
I suspect a query of that size would be almost impossible to maintain or debug, assuming the performance is ok.
I would suggest that you review the query to see if there are some parts which could be separated out into formula columns, or possibly split the query up - maybe if the report has a number of groups you could break it up that way.
Generally when you hit an issue of this sort it is best to make your code fit the tools rather that the other way round.

Similar Messages

  • PI 7.11 - SXI_CACHE Issue - SQL 0904 - Resource Limit Exceeded

    Hi PI & IBM I Gurus,
    We are having the SXI_CACHE issue in our PI 7.11 SPS04 system. When we try to do the delta cache refresh through SXI_CACHE, it is returning the error SQL 0904 - Resource limit exceeded. When we try to do the full cache refresh, it is getting the issue 'Application issue during request processing'.
    We have cleaned up the SQL Packages with DLTR3PKG command, which did not resolve the issue. We recently performed a system copy to build the QA instance and I observed that the adapter engine cache for the development is presented in the QA instance and removed that cache from there.
    I am not seeing the adapter engine connection data cache in our PI system. The adapter engine cache is working fine.
    All the caches are working fine from the PI Administration page. The cache connectivity test is failing with the same error as I mentioned for the SXI_CACHE.
    Please let me know if you have encountered any issue like this on IBM I 6.1 Platform.
    Your help is highly appreciated.
    Thanks
    Kalyan

    Hi Kalyan,
    SQL0904 has different reason codes ...
    Which one are you seeing ?
    Is the SQL pack really at its boundary of 1GB ?
    ... otherwise, it is perhaps a totally different issue ... then DLTR3PKG cannot help at all ...
    If you should see this big SQL Package, you should use PRTSQLINF in order to see if there is more or less over and over the same SQL in, just with different host variables or so ...
    If the last point should be the case, I would open a message with BC-DB-DB4 so that they can check how to help here or to talk to the application people to behave a bit different ...
    Regards
    Volker Gueldenpfennig, consolut international ag
    http://www.consolut.com http://www.4soi.de http://www.easymarketplace.de

  • Sql query writing best practises

    HI forum,
    Any body is having a tutorial on sql query writing best practises...pls share with me
    Thanks

    For example:
    [url http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/toc.htm]Oracle Database Performance Tuning Guide 10g Release 2 (10.2)
    [url http://people.aapt.net.au/roxsco/tuning/]Oracle SQL Tuning Guide
    Gints Plivna
    http://www.gplivna.eu

  • Error while running query "time limit exceeding"

    while running a query getting error "time limit exceeding".plz help.

    hi devi,
    use the following links
    queries taking long time to run
    Query taking too long
    with hopes
    Raja Singh

  • NEED SQL QUERY writing help

    oracle 10g.
    os : linux
    table data appears like this
    SQL> select * from test_grp;
    COL1 COL2
    aaa 111
    aaa 444
    aaa 222
    bbb 333
    bbb 555
    SQL> select * from test_grp order by 2;
    COL1 COL2
    aaa 111
    aaa 222
    bbb 333
    aaa 444
    bbb 555
    As per my application requirement I need to seggerage the data as
    follows
    aaa (2) ie --- 111,222
    bbb(1) is --- 333
    aaa(1) is --- 444
    bbb(1) is -- 555
    I am not able to frame this. Any help ?

    SQL> create table test_grp
      2  as
      3  select 'aaa' col1, 111 col2 from dual union all
      4  select 'aaa', 444 from dual union all
      5  select 'aaa', 222 from dual union all
      6  select 'bbb', 333 from dual union all
      7  select 'bbb', 555 from dual
      8  /
    Tabel is aangemaakt.
    SQL> select col1
      2       , col2s
      3    from ( select col1
      4                , rtrim(col2s,',') col2s
      5                , rn
      6                , sumn
      7             from ( select col1
      8                         , col2
      9                         , sum(n) over (order by col2) sumn
    10                      from ( select col1
    11                                  , col2
    12                                  , case when col1 = lag(col1) over (order by col2) then 0 else 1 end n
    13                               from test_grp
    14                           ) t
    15                  )
    16            model
    17                  partition by (sumn)
    18                  dimension by (row_number() over (partition by sumn order by col2) rn)
    19                  measures (col1, cast(col2 as varchar2(100)) col2s)
    20                  rules
    21                  ( col2s[any] order by rn desc = col2s[cv()] || ',' || col2s[cv()+1]
    22                  )
    23         )
    24   where rn = 1
    25   order by sumn
    26  /
    COL COL2S
    aaa 111,222
    bbb 333
    aaa 444
    bbb 555
    4 rijen zijn geselecteerd.Regards,
    Rob.

  • PI 7.11 - SXI_CACHE Issue - SQL0904 - Resource limit exceeded

    Hi IBM I Gurus,
    We are having the SXI_CACHE issue in our PI 7.11 SPS04 system. When we try to do the delta cache refresh through SXI_CACHE, it is returning the error SQL 0904 - Resource limit exceeded. When we try to do the full cache refresh, it is getting the issue 'Application issue during request processing'.
    We have cleaned up the SQL Packages with DLTR3PKG command, which did not resolve the issue. We recently performed a system copy to build the QA instance and I observed that the adapter engine cache for the development is presented in the QA instance and removed that cache from there.
    I am not seeing the adapter engine connection data cache in our PI system. The adapter engine cache is working fine.
    All the caches are working fine from the PI Administration page. The cache connectivity test is failing with the same error as I mentioned for the SXI_CACHE.
    Please let me know if you have encountered any issue like this on IBM I 6.1 Platform.
    Your help is highly appreciated.
    Thanks
    Kalyan

    Hi Kalyan,
    SQL0904 has different reason codes ...
    Which one are you seeing ?
    Is the SQL pack really at its boundary of 1GB ?
    ... otherwise, it is perhaps a totally different issue ... then DLTR3PKG cannot help at all ...
    If you should see this big SQL Package, you should use PRTSQLINF in order to see if there is more or less over and over the same SQL in, just with different host variables or so ...
    If the last point should be the case, I would open a message with BC-DB-DB4 so that they can check how to help here or to talk to the application people to behave a bit different ...
    Regards
    Volker Gueldenpfennig, consolut international ag
    http://www.consolut.com http://www.4soi.de http://www.easymarketplace.de

  • Is there a fix limit how long an SQL query may be?

    Hello,
    I am currently writing an application (java/jdbc/thin-driver) which executes a simple but very big query which looks like the following:
    SELECT CALKEY, PERSNO, MANDT FROM PERSONS WHERE MANDT='1' AND PERSNO='100471' OR MANDT='1' AND PERSNO='100838' OR MANDT='1' AND PERSNO='101010' (to be continued the next 400kb)
    For now I am not able to test it with oracle but a not as professional database aborts simply by throwing an SQLException even with that "small" 400kb query, however this query could easily grow to 2-5mb too.
    Will the oracle jdbc-thin driver correctly process that large queries (and how fast?) and are there limits for the size of an SQL query?
    Thank you in advance, lg Clemens

    Hello and thats a lot for the suggestions and tips you gave me.
    where does all those 100471, 100838 came from ? would
    not it make sense to have those in the database?The problem lies in the fact that I get this data from our sap->db interface with beeing the "100471" the personal numbers of our users. So it would not make that much sence (from the performance point of view) to create a temporary table since the whole time needed to create+fill+drop the table would take longer than this approach.
    Thanks for the tips with the different synthax this really should reduce the lenght of the query.
    I also implemented a lenght-limit now, if the query string would become larger than a dynamically set limit a second query is generated and results are both added to a list.
    Thanks a lot for all this useful tips and suggestion, lg Clemens

  • Runtime error(Time limit exceeds)after executing select query

    Dear experts, whenever i executing the select query in this zprogram i am getting runtime error that time limit exceeds.i am using inner join and into table.after that also i am geetting error. how can i resolve it??
    SELECT LIKP~VBELN LIKP~WADAT_IST LIKP~VEHICLE_NO LIKP~TRNAME
              LIKP~VEHI_TYPE LIKP~LR_NO LIKP~ANZPK LIKP~W_BILL_NO
              LIKP~SEALNO1                                       " Seal NO1
              LIKP~SEALNO2                                       " Seal NO2
              LIPS~LFIMG
              VBRP~VBELN VBRP~VGBEL VBRP~MATNR VBRP~AUBEL VBRP~FKIMG
              VBAK~AUART
              VBRK~FKART VBRK~KNUMV VBRK~FKSTO
              FROM LIKP INNER JOIN LIPS ON LIKP~VBELN EQ LIPS~VBELN
                        INNER JOIN VBRP ON LIKP~VBELN EQ VBRP~VGBEL
                        INNER JOIN VBAK ON VBRP~AUBEL EQ VBAK~VBELN
                        INNER JOIN VBRK ON VBRP~VBELN EQ VBRK~VBELN
              INTO TABLE  I_FINAL_TEMP
              WHERE LIKP~VSTEL = '5100' AND
                 LIKP~WADAT_IST IN S_WADAT  AND
                    VBRP~AUBEL IN S_AUBEL AND
                    VBAK~AUART IN ('ZJOB','ZOR') AND
                    VBRK~FKART IN S_FKART AND
    *               VBRK~FKART IN ('ZF8','ZF2','ZS1') AND
                    VBRK~FKSTO NE 'X'.
    When I am debugging the select query.the cursor will not go to next step.after 15-20 minutes i am getting runtime error(time limit exceeds).
    how can i resolve it for that scenario??

    Looks like whole SD flow you trying to fetch in single query
    First you check the database statistic of these table are upto date in system ( Check with basis team )
    if this query was working fine earlier.
    Most of table involved are huge volume tables which queried with any primary key
    Any secondary index on created for LIKP on VSTEL WADET ?
    My suggestion would be split the selection queries and make use of primary or existing secondary index to fetch the desired result if possible. For testing purpose split the queries and find which is taking more time and which needs index by taking squel trace in ST05.
    Also take ST05 trace of this query in debugger ( New debugger -> special tool -> trace > ST05/SE30)

  • SQL Query limit

    How many characters long can a SQL query be? I'm generating an update query on the fly in a stored procedure using some variables and don't know exact length of these queries.
    Thanks in advance!

    By "generating an update statement on the fly", do you mean that you are using dynamic SQL? If so, are you using EXECUTE IMMEDIATE? Or DBMS_SQL?
    If you are using EXECUTE IMMEDIATE, there is a [limit on the length of the string|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6161200355268] that depends on a number of factors, but anything over 32k probably isn't safe. DBMS_SQL can allow you to generate effectively unlimited length SQL statements if you are using the right methods.
    Of course, I would want to make sure that dynamic SQL is really needed in the first place. And I would be very concerned if that dynamic SQL were generating queries longer than 32k.
    Justin

  • Having trouble writing to a database although SQL query is correct

    Hi there. I am trying to write an sql query to a database but I am failing to understand what is going wrong in terms of executing the query.
    I have the following code.
    static public int writeToStockTable (String suppIn, String nameIn, String typeIn, float quantIn, float priceIn, String descIn, String styleIn, String finishIn)         {               // Temporary variable to hold the SQL query               String SQLString, SQLString2;               ResultSet rs = null;                                     // Build a string containing the SQL INSERT instruction to be used later             SQLString = "INSERT INTO "+typeIn+" VALUES ('1', '" + suppIn + "', '" + nameIn + "', " + quantIn + ", " + priceIn + ", '"+descIn+"', '"+styleIn+"', '"+finishIn+"')";             SQLString2 = "SELECT Name FROM Suppliers WHERE Name = '" + suppIn + "'";                                         try                   {                         // The createStatement() method creates a Statement object.  Object will be                         // attached to my reference variable (statement) defined at the top of class.                         statement = connectionToBellFiresDB.createStatement();                                                 // The executeUpdate() statement can be used here to execute an                         // SQL INSERT instruction.                         rs = statement.executeQuery (SQLString2);                         if ((rs == null))                         {                             System.out.println ("Trying to say no supplier");                             return (-2);                         }                                                 else                         {                             System.out.println (SQLString);                             statement.executeUpdate (SQLString);                         }                                           }                 catch (SQLException exception)                   {                       return (-1);    // Return -1 if problem writing record to file                   }                             return (0);  // Return with 0 if record successfully written                       }
    Please ignore the attributes not used, it is very much a work in progress. The command that prints SQLString prints
    INSERT INTO Fireplace VALUES ('1', 'a', 'a', 1.0, 1.0, 'a', 'a', 'a')
    which is correct, but will return the error code -1 when asked to execute the query. The database jdbc:odbc driver has been initialised in the control panel and the program has no other problems accessing the database as far as i am aware.
    Any help would be appreciated, i hate database connections :)

    Chrift wrote:
    Im sorry i dont know what you mean by eating the exception, im quite a noob at programming to be honest!
    How do i print it out and what is a stack trace?Do you know what an exception is? If not, then you should stay far away from JDBC/Database programming for the time being.
    Read [the Exception Tutorial|http://java.sun.com/docs/books/tutorial/essential/exceptions/] first.
    Then: an exception has quite a bit of useful information attached that tells you what went wrong.
    In your case you catch the exception and ignore everything it could tell you by simply returning -1. Returning 0 and -1 to indicate success/failure is a very bad idea and should not be used in Java code, it's a C-style convention for C-era programming languages. In Java you use exceptions instead.
    For starters you could simply add "exception.printStackTrace()" in your catch-block to get some more information out of the exception.

  • Kodo 3.4.1: how to limit # of sql query params when using collection param

    Hi,
    We have a problem when using Kodo 3.4.1 against SQL Server 2005, when we execute query:
              Query query = pm.newQuery( extent, "IdList.contains( this )" );
              query.declareParameters( "Collection IdList" );
              query.declareImports( "import java.util.Collection;" );
              return (List) query.execute( list );
    We got:
    com.microsoft.sqlserver.jdbc.SQLServerException: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Too many parameters were provided in this RPC request. The maximum is 2100.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(Unknown Source)
    at com.solarmetric.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:354)
    at com.solarmetric.jdbc.PoolConnection$PoolPreparedStatement.executeQuery(PoolConnection.java:341)
    at com.solarmetric.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:352)
    at com.solarmetric.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1106)
    at com.solarmetric.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:352)
    at kodo.jdbc.runtime.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1730)
    at com.solarmetric.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:339)
    at kodo.jdbc.sql.Select.execute(Select.java:1581)
    at kodo.jdbc.sql.Select.execute(Select.java:1533)
    at kodo.jdbc.runtime.SelectResultObjectProvider.open(SelectResultObjectProvider.java:102)
    at com.solarmetric.rop.EagerResultList.<init>(EagerResultList.java:22)
    at kodo.query.AbstractQuery.execute(AbstractQuery.java:1081)
    at kodo.query.AbstractQuery.executeWithArray(AbstractQuery.java:836)
    at kodo.query.AbstractQuery.execute(AbstractQuery.java:799)
    It seems that there're too many ids in the list, and Kodo didn't limit the # of sql parameters when craft the sql query. Is there a way to ask Kodo to use multiple queries with smaller # of sql parameters instead of using one big sql query?
    Thanks

    Hi,
    Sadly, there is no way to do that in Kodo currently. The closest is the inClauseLimit DBDictionary setting, but that setting just breaks things up into multiple IN statements put together with an OR clause. In your case, it looks like the network transport, not the SQL parser, is complaining about size limits.
    You could force the query to run in-memory, but that would probably be prohibitively slow, unless the data set that you're querying against is relatively small.
    -Patrick

  • Problem writing a sql query for a select list based on a static LOV

    Hi,
    I have the following table...
    VALIDATIONS
    ID          Number     (PK)
    APP_ID          Number     
    REQUESTED     Date          
    APPROVED     Date          
    VALID_TIL     Date
    DEPT_ID          Number     (FK)
    I have a search form with the following field item variables...
    P11_DEPT_ID (select list based on dynamic LOV from depts table)
    P11_VALID (select list based on static Yes/No LOV)
    A report on the columns of the Validations table is shown based on the values in the search form. So far, my sql query for the report is...
    SELECT v.APP_ID,
    v.REQUESTED,
    v.APPROVED,
    v.VALID_TIL,
    d.DEPT
    FROM DEPTS d, VALIDATIONS v
    WHERE d.DEPT_ID = v.DEPT_ID(+)
    AND (d.DEPT_ID = :P11_DEPT_ID OR :P11_DEPT_ID = -1)
    This query works so far. My problem is that I don't know how to do a search based on the P11_VALID item - if 'yes' is selected, then the VALID_TIL date is still valid. If 'no' is selected then the VALID_TIL date has passed.
    Can anyone help me to extend my query to include this situation?
    Thanks.

    Hello !
    Let's have a look at my example:create table test
    id        number
    ,valid_til date
    insert into test values( 1, sysdate-3 );
    insert into test values( 2, sysdate-2 );
    insert into test values( 3, sysdate-1 );
    insert into test values( 4, sysdate );
    insert into test values( 5, sysdate+1 );
    insert into test values( 6, sysdate+2 );
    commit;
    select * from test;
    def til=yes
    select *
      from test
      where decode(sign(trunc(valid_til)-trunc(sysdate)),1,1,0,1,-1)
           =decode('&til','yes',1,-1);
    def til=no
    select *                                                                               
      from test                                                                            
      where decode(sign(trunc(valid_til)-trunc(sysdate)),1,1,0,1,-1)
           =decode('&til','yes',1,-1);  
    drop table test;  It's working fine, I've tested it.
    The above changes to my first idea I did because of time portion of the DATE datatype in Oracle and therefore the wrong result for today.
    For understandings:
    1.) TRUNC removes the time part of DATE
    2.) The difference of to date-values is the number of days between.
    3.) SIGN is the mathematical function and gives -1,0 or +1 according to an negative, zero or positiv argument.
    4.) DECODE is like an IF.
    Inspect your LOV for the returning values. According to my example they shoul be 'yes' and 'no'. If your values are different, you may have to modify the DECODE.
    Good luck,
    Heinz

  • Writing a function to find whether a value is present in a sql query output

    Hi gurus,
    I would like to write a function to which i will pass a value and a sql query as parameters.
    Now the function needs to execute that sql query and find whether the given value is present in the output list
    when the query is executed. If it is present it should return 'T' otherwise 'F'
    My function will look like
    CREATE FUNCTION CHECK_VALUE(VALUE VARCHAR2,V_SQL VARCHAR2) RETURN VARCHAR2
    SELECT CHECK_VALUE('Dallas','SELECT LOCATION_CODE FROM HR_LOCATIONS')
    It should check whether the value 'Dallas' is present in the output list returned by the sql query.
    Any help will be appreciated.
    Thank you.

    CREATE OR REPLACE
      FUNCTION CHECK_VALUE(
                           VALUE VARCHAR2,
                           V_SQL VARCHAR2
        RETURN VARCHAR2
        IS
            RETVAL VARCHAR2(4000);
            REFCUR SYS_REFCURSOR;
        BEGIN
            OPEN REFCUR FOR V_SQL;
            LOOP
              FETCH REFCUR INTO RETVAL;
              EXIT WHEN REFCUR%NOTFOUND;
              IF RETVAL = VALUE
                THEN
                  CLOSE REFCUR;
                  RETURN 'T';
              END IF;
            END LOOP;
            CLOSE REFCUR;
            RETURN 'F';
    END;
    Function created.
    SQL> SET SERVEROUTPUT ON
    SQL> EXEC DBMS_OUTPUT.PUT_LINE(CHECK_VALUE('DALLAS','select loc from dept'));
    T
    PL/SQL procedure successfully completed.
    SQL> EXEC DBMS_OUTPUT.PUT_LINE(CHECK_VALUE('PARIS','select loc from dept'));
    F
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Need help writing sql query

    i am trying to write sql query for a single recordset.
    I have an items table with all the standard item info and an item_colorID.
    i have a color_lookup table with 2 columns, item_colorID and color_ID
    i have a colors table with 2 columns, color_ID and color
    i want to join the tables and filter it so that a repeat region shows dynamic data of item name, description, thumb, price
    and also a list/menu dynamically populated by color
    filtered so that each item shows in the list/menu only the colors that the item has available.
    i have tried different variations of this sql
    SELECT * FROM items INNER JOIN color_lookup ON color_lookup.item_colorID = items.item_colorID INNER JOIN colors ON colors.color_ID = color_lookup.color_ID WHERE items.itemCatID = 3 ORDER BY items.itemName
    but the list/menu shows every color choice multiplied by the number of items in that color
    ie  White will show 80+ times.
    thanks for your help,
    jim balthrop

    bregent,
    thanks for your help.
    I am building a shopping cart and i have a recordset to list the items and a repeat region for that recordset
    i have a second recordset for the colors joined to the item_colorID nested inside the repeat region.
    the shopping cart software has a 'lookup from recordset' choice for the add to cart servior behavior
    and then i bind to the columns on the cart page.
    it produces this code
    if (isset($totalRows_rs_itemscat3) && $totalRows_rs_itemscat3 > 0)    {
        $row_rs_itemscat3 = WAEC_findRecordMySQL($rs_itemscat3, "item_ID", $ATC_itemID);
        if ($row_rs_itemscat3)    {
          $ATC_itemName = "".$row_rs_itemscat3['itemName']  ."";// column binding
          $ATC_itemDescription = "".$row_rs_itemscat3['itemShortDesc']  ."";// column binding
          $ATC_itemWeight = floatval("".$row_rs_itemscat3['itemWeight']  ."");// column binding
          $ATC_itemQuantity = "".$_POST["Farrington_1_Quantity_Add"]  ."";// column binding
          $ATC_itemPrice = floatval("".$row_rs_itemscat3['itemPrice']  ."");// column binding
          $ATC_itemThumbnail = "".$row_rs_itemscat3['itemThumb']  ."";// column binding
          $ATC_itemcolorchoice = "".$row_rs_colors['color']  ."";// column binding
          mysql_data_seek($rs_itemscat3, 0);
          $row_rs_itemscat3 = mysql_fetch_assoc($rs_itemscat3);
    the column binding for the colors is from a different recordset and when redirecting to the cart page the color info will not show.
    So my thinking is if i could get the color list/menu to populate from the same recordset as the item listing, it would solve my add to cart server behavior.
    Is it possible to do this with only one recordset?
    the products page and the cart page can be seen
    http://www.farrington-enterprises.com/rain-gutters.php
    add an item to the cart with any color choice and the color info does not carry to the cart.

  • SQL Query ( PL/SQL function body returning query ) page

    Hello Friends,
    I have a page with type SQL Query ( PL/SQL function body returning query ).
    I have written a pl/sql block that returns a sql query - select statment.
    Some times i am getting no data found error - does it got to do with the variable that stores the query .
    =======================
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Error ERR-1101 Unable to process function body returning query.
    OK
    =====================
    When the query is returned with records where exactly the records are stored is it in the variable declared in pl/sql block or with the Oracle Apex implicit cursor.
    Here's the pl/sql block ..
    The query is generated while the user is navigating through pages ..
    ====================
    declare
    l_return_stmt varchar2(32767);
    l_select varchar2(32000);
    l_from varchar2(32000);
    l_where varchar2(32000);
    l_order_by varchar2(32000);
    l_stmt_recordcount varchar2(32000);
    l_recordcount number ;
    begin
    l_select := 'select '||:P10_VARLIST1||:P10_VARLIST2||:P10_VARLIST3
    ||:P10_VARLIST4||:P10_VARLIST5;
    l_from := ' from '||:P10_RELATION;
    if length(:P10_WHERE) > 0 then
    l_where := ' where '||:P10_WHERE;
    else
    l_where := '';
    end if;
    if length(:P10_ORDER_BY) > 0 then
    l_order_by := ' order by '||:P10_ORDER_BY;
    else
    l_order_by := '';
    end if;
    l_return_stmt := l_select||l_from||l_where||l_order_by;
    :P10_STMT := l_return_stmt;
    return l_return_stmt;
    end;
    =============================
    Appreciate your help in this regard.
    thanks/kumar
    Edited by: kumar73 on Apr 22, 2010 6:38 AM

    It looks like the query string you are trying to pass back exceeds the 32K limit for a varchar. Where this is happening is kind of difficult to tell as it could be any number of points, and also depends on what you are passing into the process via page items.
    I would first try to establish what combination of page items causes this error to occur. Then, starting from the bottom and working your way backwards, I would start 'switching off' some of the items you use to build your query until it breaks again, thus establishing which part is leading to the error.
    Also, I'm not sure what :P10_STMT is doing (are you maybe using this for visiblity of the query created)?
    It looks like the query string you are trying to pass back exceeds the 32K limit for a varchar. Where this is happening is kind of difficult to tell as it could be any number of points, and also depends on what you are passing into the process via page items.
    I would first try to establish what combination of page items causes this error to occur. then, starting from the bottom and working your way backwards, I would start 'switching off' some of the items you use to build your query until it breaks again, thus establishing which part is leading to the error.
    Also, I'm not sure what :P10_STMT is doing (are you maybe using this for visiblity of the query created)?

Maybe you are looking for