String buffer put together many stirngs

Hi All,
I am trying to JENA java based browsing system. This is the code for query and results. JENA can only get one single query like "String sQuery = request.getParameter("query");". On GUI I made the interface the user can write select, where, and, using, from. So I made put together using stringbuffer method.
Would you see the below code is right? or somethings are strange. Someone says me to use str.concat but I do not know how to use it. I am just beginner on JAVA and JENA API, so would like to get your comments.
Thanks.
Hyunjoo
See Below codes;
String sQuerySelect = request.getParameter("querySelect");
String sQueryWhere = request.getParameter("queryWhere");
String sQueryAnd = request.getParameter("queryAnd");
String sQueryUsing = request.getParameter("queryUsing");
String sQuery = request.getParameter("query");
// query string /// string plus plus plus
sQuery = new StringBuffer().append("SELECT ").append("sQuerySelect").append(" WHERE ").append("sQueryWhere").append(" AND ").append("sQueryAnd").append(" USING ").append("sQueryUsing)
.toString()
String sQueryFrom = request.getParameter("queryFrom");
String sResult = request.getParameter("result");
model.read(sQueryFrom);
Query query = new Query(sQuery)
query.setSource(model);

String sQuerySelect = request.getParameter("querySelect");
String sQueryWhere = request.getParameter("queryWhere");
String sQueryAnd = request.getParameter("queryAnd");
String sQueryUsing = request.getParameter("queryUsing");
String sQuery = request.getParameter("query");
// query string /// string plus plus plus
sQuery = "SELECT "+sQuerySelect+" WHERE "+sQueryWhere+" AND "+sQueryAnd+" USING "+sQueryUsing;
String sQueryFrom = request.getParameter("queryFrom");
String sResult = request.getParameter("result");
model.read(sQueryFrom);
Query query = new Query(sQuery)
query.setSource(model);

Similar Messages

  • Oracle Report Error (string buffer too small) in Portal

    Hi,
    I have registered an oracle report (.rdf) with portal which works fine outside in Reports Builder, but when I try to run it in Portal it keeps throwing this error:
    SQL-6502: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "PORTAL.WWV_RW_USR", line 444
    ORA-06512: at "PORTAL.WWV_RW_USR", line 923
    ORA-06512: at line 1
    Anyone know what needs to be done to fix this?
    Thanks

    Sean:
    Thank you very much for wading through my post.
    >"if (NIerror = DAQmxCfgInputBuffer(h, numSamples*4))"
    >I would leave this line out. DAQmx should create an input buffer automatically
    >based on the number of channels and number of samples per channel.
    Yeah- I put that in trying to fix the problem. The error message doesn't say *which* buffer is too small
    >If you just call the DAQmxReadDigitalLines() function with "numSampsPerChan" set to -1,
    >DAQmx will wait until all samples are acquired before performing the read.
    I'm trying to avoid the wait. That's why I'm trying to figure out how many samples are ready.
    I suppose I can try numSampsPerChan=-1, set a short timeout and check for the timeout error.
    >If this does not help, please send me a small section of code that reproduces that behavior,
    >and I will try running it on my machine.
    I will try modifying one of the examples to do what I'm trying to do.
    Again, Thank you!
    John Weeks
    WaveMetrics, Inc.
    Phone (503) 620-3001
    Fax (503) 620-6754
    www.wavemetrics.com

  • 6502 = ORA-06502: PL/SQL: numeric or value error: character string buffer

    i'm getting this error when i try to do the following
    6502 = ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    declare
    str1Query varchar2(32767);
    str2Query varchar2(32767);
    str3Query varchar2(32767);
    str31Query varchar2(32767);
    str32Query varchar2(32767);
    str4Query varchar2(32767);
    desc_t dbms_sql.desc_tab2;
    l_col_cnt integer;
    colvalue varchar(32676);
    cur_rows number;
    repCursor integer;
    begin
    repCursor := dbms_sql.open_cursor;
    dbms_sql.parse(repCursor,str1Query || ' ' || str2Query || ' ' || str3Query || ' ' || str31Query || ' ' || str32Query || str4Query,dbms_sql.native);
    dbms_sql.describe_columns2( repCursor, l_col_cnt, desc_t );
    DBMS_SQL.CLOSE_CURSOR (repCursor);
    end;
    if there is any ideas about what is wrong

    That is not the PL/SQL block that you have run to get that error, right?
    What are the sizes of the individual variables - str1Query, str2Query etc...
    Whay are there so many variables joined together?
    That posted code cannot generate the error you posted:
    SQL> declare
      2
      3  str1Query varchar2(32767);
      4  str2Query varchar2(32767);
      5  str3Query varchar2(32767);
      6  str31Query varchar2(32767);
      7  str32Query varchar2(32767);
      8  str4Query varchar2(32767);
      9  desc_t dbms_sql.desc_tab2;
    10  l_col_cnt integer;
    11  colvalue varchar(32676);
    12  cur_rows number;
    13  repCursor integer;
    14
    15  begin
    16
    17  repCursor := dbms_sql.open_cursor;
    18  dbms_sql.parse(repCursor,str1Query || ' ' || str2Query || ' ' || str3Query || ' ' || str31Query || ' ' || str32Query || str4Query,dbms_sql.native);
    19  dbms_sql.describe_columns2( repCursor, l_col_cnt, desc_t );
    20  DBMS_SQL.CLOSE_CURSOR (repCursor);
    21  end;
    22  /
    declare
    ERROR at line 1:
    ORA-00900: invalid SQL statement
    ORA-06512: at "SYS.DBMS_SYS_SQL", line 826
    ORA-06512: at "SYS.DBMS_SQL", line 39
    ORA-06512: at line 18
    SQL>

  • Need Help Putting Together a rMBP so I Have Everything I Need...

    Hello-
    I am having trouble getting the right kind of help from "Chat Now" on apple.com and calling in to get my questions/needs taken care of so that when I get the rMBP I will be sure I wil have what I need to go right online and teach the online courses. I even went to the local apple store and woked with a couple sames guys there, but they were not clear in a couple situations on what I would need with the different options the rMBP gives. so I am truning to the great apple forum for additional help.  this might be too much to ask even for tis forum, but if I can learn a little at a time, maybe I can gradually gain the knowledge I need to have a complete and functioning home office for my personal computing needs and my needs as an online teacher at a university back East. My technical knowledge is not the best, so as far as the rMBP goes, a big problem for me is that I do not have the knowledge to make sure I order everything I need with the changes a new rMBP will bring to my current setup (which is just a basic MBP using a wireless router and a USB cable for the printer that I just connect when I need to print). I realizee my current set up on my desk is not the most advanced, but I would need a pro to come to my office and help me get the best set-up for what I am curently using. It seems that the agents I chat with and/or talk to on the phone are aslo lacking in knowledge to help me put together a rMBP that will be ready to fully use and have with the order all that I need so that I do not have to order additional items in a mad rush to be ready for the courses I am teaching online. I have read several articles about the rMBP so that I cold have some knowledge about what I will need but as I said my techie knowledge is lacking. I am looking at the 15" rMBP with all of the full upgrades that the configure option allows one to get. I am not clear if I do run into trouble with my wi fi and have to use my ethernet cable what I will need to do this. I also have programs that are older that I am guesing I will need to install using a DVD player. I would like to hook up the printer I have or a new Canon printer and use it wirelessly, but for now I will most likely be using it with a USB cable. I am not clear on the thunderbolt technology and if I should get any of these cables for any of the connections. I also would like to get a great speaker system and will need to hook that up, but I am not clear on the best way to do this. I have been wanting an iMac, but I am not sure what is a good slection to get and how to connect it to the rMBP or one of the other 2 older MBPs I currently have.
    If somebody could list for me what I would need to have a complete rMBP that will allow me to do these hookups and connections and explain what would be the best way to complete the various connections so that I have all that I will need to get up and running, I would really appreciate it. Because I do not have any USB 3.0 cables or cables for various additional connections, I would need help/suggestions in this area. I realize this is hard to do not seeing my office, but since I will be starting new with the purchase of the new rMBP and hopefully an iMac (and a new Canon printer and new set of great sounding speakers) getting some advice on what I should order for the various connections would be a hugh help. Part of the problem is with the rMBP and not having used one of these in the past. I know some of the differences with this machine like the lack of an internal SuperDrive and the new ports, but I do not know what cables I will need that will utilize the newer technology this machine and an imac will bring to my office.
    Any suggestions are greatly appreciated, even if you do not give me specific answers, but an idea, for example, of what I might need to connect the speaker system (knowing the best way the new speaker system shold be connected to the rMBP and/or the iMac. I am not even clear if I do want to use the iMac with the rMBP for teaching with a larger display what I will need to connect the imac to the rMBP. is this done by an HDMI cable and if so is there a specific type or example you could mention that is on apple.com?

    There are many differences with the new rMBP. There are ports that I am not sure what I would use them for.  Even the ethernet cable I use now to get the internet will not work with the rMBP.  I thought there would be some additional help on here.  as far as configuring the rMBP there are just a few options but the differences between an older MBP and the new rMBP is great.  No need to reply I will turn off email notifications. I gave as much information as I did because in the past I was told to give more information.

  • BI Publisher Report Query Error: "character string buffer too small"

    Using apex.oracle.com, I am trying to make a Report Query (Shared Components > Report Queries) based on many columns (around 60).
    When I enter my SQL in the "Source Query" Text Area and then click Test Report I get the following error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small In order to try to make the simplest test case possible for this, I then tried entering SQL selecting just from DUAL.
    The following SQL fails with the error mentioned above.
    SELECT
    'wibble' as a
    ,'wibble' as b
    ,'wibble' as c
    ,'wibble' as d
    ,'wibble' as e
    ,'wibble' as f
    ,'wibble' as g
    ,'wibble' as h
    ,'wibble' as i
    ,'wibble' as j
    ,'wibble' as k
    ,'wibble' as l
    ,'wibble' as m
    ,'wibble' as n
    ,'wibble' as o
    ,'wibble' as p
    ,'wibble' as q
    ,'wibble' as r
    ,'wibble' as s
    ,'wibble' as t
    ,'wibble' as u
    ,'wibble' as v
    ,'wibble' as w
    ,'wibble' as x
    ,'wibble' as y
    ,'wibble' as z
    ,'wibble' as ab
    ,'wibble' as ac
    ,'wibble' as ad
    ,'wibble' as ae
    ,'wibble' as af
    ,'wibble' as ag
    ,'wibble' as ah
    ,'wibble' as ai
    ,'wibble' as aj
    ,'wibble' as ak
    ,'wibble' as al
    ,'wibble' as am
    ,'wibble' as an
    ,'wibble' as ao
    ,'wibble' as ap
    ,'wibble' as aq
    ,'wibble' as ar
    ,'wibble' as at
    ,'wibble' as au
    ,'wibble' as av
    FROM dualRemoving the last column from this SQL query (bringing the total number of columns down to 45) as follows and then clicking "Test Report" works successfully.
    SELECT
    'wibble' as a
    ,'wibble' as b
    ,'wibble' as c
    ,'wibble' as d
    ,'wibble' as e
    ,'wibble' as f
    ,'wibble' as g
    ,'wibble' as h
    ,'wibble' as i
    ,'wibble' as j
    ,'wibble' as k
    ,'wibble' as l
    ,'wibble' as m
    ,'wibble' as n
    ,'wibble' as o
    ,'wibble' as p
    ,'wibble' as q
    ,'wibble' as r
    ,'wibble' as s
    ,'wibble' as t
    ,'wibble' as u
    ,'wibble' as v
    ,'wibble' as w
    ,'wibble' as x
    ,'wibble' as y
    ,'wibble' as z
    ,'wibble' as ab
    ,'wibble' as ac
    ,'wibble' as ad
    ,'wibble' as ae
    ,'wibble' as af
    ,'wibble' as ag
    ,'wibble' as ah
    ,'wibble' as ai
    ,'wibble' as aj
    ,'wibble' as ak
    ,'wibble' as al
    ,'wibble' as am
    ,'wibble' as an
    ,'wibble' as ao
    ,'wibble' as ap
    ,'wibble' as aq
    ,'wibble' as ar
    ,'wibble' as at
    ,'wibble' as au
    FROM dualSo the question is: Is there a hard-coded limit of 45 columns for a Source Query? Or is there something else causing this error message?
    (For information in the above example I have "Use Generic Report Layout" selected and the output format set to "PDF")
    Thanks very much in advance for any comments or suggestions,
    Andy

    Thanks for the suggestion Simon.
    I just created a view based on the 46-column SELECT statement from dual above and then set "SELECT * FROM myview" as the Source Query.
    Unfortunately I get exactly the same error.
    Thanks,
    Andy

  • Help - i recently made put together a high quality movie for a relative, it has taken me months to complete and it goes for a total of 9 hours and 43 minutes ,however, it won't let me export the video at all! please help - its taken ages to make it!

    Help - i recently made put together a high quality movie for a relative, it has taken me months to complete and it goes for a total of 9 hours and 43 minutes ,however, it won't let me export the video at all! please help - its taken ages to make it!

    9 hours??!
    Twice the length of a cinema epic?
    How are you expecting to distribute it?
    iDVD encoding settings:
    http://docs.info.apple.com/article.html?path=iDVD/7.0/en/11417.html
    Short version:
    Best Performance is for videos of up to 60 minutes
    Best Quality is for videos of up to 120 minutes
    Professional Quality is also for up to 120 minutes but even higher quality (and takes much longer)
    That was for single-layer DVDs. Double these numbers for dual-layer DVDs.
    Professional Quality: The Professional Quality option uses advanced technology to encode your video, resulting in the best quality of video possible on your burned DVD. You can select this option regardless of your project’s duration (up to 2 hours of video for a single-layer disc and 4 hours for a double-layer disc). Because Professional Quality encoding is time-consuming (requiring about twice as much time to encode a project as the High Quality option, for example) choose it only if you are not concerned abo
    In both cases the maximum length includes titles, transitions and effects etc. Allow about 15 minutes for these.
    You can use the amount of video in your project as a rough determination of which method to choose. If your project has an hour or less of video (for a single-layer disc), choose Best Performance. If it has between 1 and 2 hours of video (for a single-layer disc), choose High Quality. If you want the best possible encoding quality for projects that are up to 2 hours (for a single-layer disc), choose Professional Quality. This option takes about twice as long as the High Quality option, so select it only if time is not an issue for you.
    Use the Capacity meter in the Project Info window (choose Project > Project Info) to determine how many minutes of video your project contains.
    NOTE: With the Best Performance setting, you can turn background encoding off by choosing Advanced > “Encode in Background.” The checkmark is removed to show it’s no longer selected. Turning off background encoding can help performance if your system seems sluggish.
    And whilst checking these settings in iDVD Preferences, make sure that the settings for NTSC/PAL and DV/DV Widescreen are also what you want.
    http://support.apple.com/kb/HT1502?viewlocale=en_US

  • ORA-6502: PL/SQL: numeric or value error: character string buffer too small WWV-11230

    Hi,
    I'm trying to create an UI Template. I've generated the html using Frontpage and am successfully able to see in a browser.
    I've copied the html to the UI form, but when I try to preview or execute the UI template, I get the following error:
    Error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small (WWV-11230)
    null

    I AM FACING SIMILAR PROBLEM, THE EXACT ERROR IS:
    Error: Excepcisn de wwv_generate_component.build_procedure (WWV-01821)
    No se ha podido generar la pantalla de interfaz de usuario: ORA-06502: PL/SQL: numeric or value error: character string buffer too small (WWV-16409)
    (SORRY , PART OF THE ERROR IS IN SPANISH!)
    I CREATED A FORM , WORKED WITH IT A LOT WITHOUT PROBLEMS. NOW I NEED TO DO SOME CHANGES ON CERTAIN FIELDS AND WHEN I TRY TO SAVE IT I GET THE ABOVE ERROR.
    THEN I GO BACK TO AN OLDER VERSION, COPY AND TRY TO DO CHANGES AND AGAIN THE ERROR COMES UP.
    THE CHANGES I AM TRYING TO DO ARE TO SOME OF THE EXISTING FIELDS IN THE FORM WHICH NEED TO BE PUT AS "INSERTABLE".
    THE SCREEN LAYOUT IS DISPLAYED WITHOUT PROBLEM.
    (THE FORM IS BASED ON A TABLE WITH APROX 80 FIELDS).
    I NEED SOME URGENT HELP. PLS LET ME KNOW ANY OTHER INFO YOU MAY NEED TO HELP ME SOLVE THIS PROBLEM.
    FYI I AM WORKING ON PORTAL VERSION 3.0.9 / ON Windows 2000 (DATABASE 8.1.7.0 AND iAS ARE ON DIFFERENT MACHINES).
    TKS IN ADVANCE

  • Which is better storing string values in Map or String buffer

    Hi,
    I have a store a 10 string values in a cookie. Do i use a String buffer and append all values or put it in a hash map.
    If i put in a string buffer i have to use a string tokenizer to loop and extract the values., but if i am using a map then
    retrieval will be easier, but in terms of memory management, which is better. as i have to create this cookie for every unique IP hitting my site.
    Thanks,
    Viiveek

    viiveek wrote:
    I have a store a 10 string values in a cookie. Do i use a String buffer and append all values or put it in a hash map.
    If i put in a string buffer i have to use a string tokenizer to loop and extract the values., but if i am using a map then
    retrieval will be easier, but in terms of memory management, which is better. as i have to create this cookie for every unique IP hitting my site. In terms of memory management, StringBuffer could potentially be better as there is no need to keep key objects in memory.
    That doesn't make it a good idea. The bytes of memory you'd lose by using a Map would be made up by the fact that Map was expressly made for storing key/value pairs. Memory management should be about the 200th factor you should consider.

  • WWV_FLOW_WORKSHEET_CONDITIONS - ORA-06502 character string buffer too small

    Hi,
    I am currently working on a application that can upload CSV files inside many tables. Since I hate reinventing the wheels, I have decided to reverse engineer APEX and APEX APIs that are used by the SQL Workshop to upload CSV files to a single table. Since this feature was tested many times by many developers around the world, I know I can trust the code. If in a future release of APEX those packages are modified, I'll have to update my abstraction layer to call my own packages instead of APEX packages. (This is not an issue for our team.)
    First Step
    Use apex_040000.wwv_flow_load_data.create_csv_collection to create an apex collection with the first 20 rows of the csv file. At this step, we can validate the format of a sample of the file without loading all rows of the csv file.
    Second Step
    Use apex_040000.wwv_flow_load_data.load_csv_data to upload all rows of the csv file inside a table.
    Third Step
    Do whatever you want with the data inside the table. (i.e.: Send the data into multiple tables...)
    Here's my problem..._
    After the first or second steps, I display the data using interactive reports. I want to highlight every cells containing "invalid" data. I use apex_040000.wwv_flow_worksheet_api.add_or_update_highlight. When I have too many invalid cells, the IR doesn't show at run time, and you can see ORA-06502: PL/SQL: numeric or value error: character string buffer too small on the page.
    I would like to know the limitations of IR using the table WWV_FLOW_WORKSHEET_CONDITIONS. Is there a way to create many highlight conditions inside a single row of WWV_FLOW_WORKSHEET_CONDITIONS ? I want to find the best approach to add hundreds of conditions.
    Thanks
    Louis-Guillaume Carrier-Bédard
    My Google+: https://profiles.google.com/lgcarrier
    My Blog: http://www.lgcarrier.com
    Twitter: http://www.twitter.com/lgcarrier
    APEX Québec: http://www.apexquebec.com
    APEXFramework: http://www.apexframework.com

    At run time, when I look at the html source code, I can see all the generated CSS rules to highlight the cells of the IR.
    ie.: *.apexir_WORKSHEET_DATA tr td.rule_5352115461902443_td {background-color:#FF0000 !important;}*

  • I am putting together a proposal for a Final Cut Pro Workstation to use with a tapeless HD camera.  Can anyone suggest the best camera (in the 5-10,000 dollar range) ?  What hardware and software should I include in the package?

    I am putting together a proposal for a Final Cut Pro Workstation to use with a tapeless HD camera.  Can anyone suggest the best camera (in the 5-10,000 dollar range) ?  What hardware and software should I include in the package?

    This is quite an open suggestion, but here are some ideas which might get you started.  There are good HD cameras in your price range from Sony, Panasonic and Canon (and maybe other manufacturers). Tapeless formats vary.  I have only worked with Sony XDCAM which seems pretty good to me.  File sizes for material shot at 35MBS are not too huge and, with the free Sony transfer and conversion programme, are easy to bring into the computer via USB direct from the camera or from a fairly inexpensive converter.  The Sony XDCAM EX3 can produce results well up to broadcast quality.
    As to hardware, you'll need a powerful MAC - iMac, Macbook Pro or MacPro with 4GB or more of RAM and a good video card.  Softwarewise, FCPX is quite a bit cheaper than FC Studio 3 and of course it's 64bit and can make better use of multi-core machines than FCP7.    It's also designed to handle HD formats with less hassle than FCP7 and is matched to the latest versions of Motion and Compressor.   But you'd probably be wise to search reviews of FCPX before you make your choice - it has some issues.
    A good HD monitor will be essential and, for colour correction etc, you may want to consider a second monitor or HD TV foe editing. ( A MacPro is generally the best machine to connect a second monitor to). 
    This should give you a good editing system, but there are many other things you could add (Photoshop, professional sound monitors, etc)
    Hope this helps a bit.
    Jonathan

  • HTMLDB_ITEM.POPUP_FROM_QUERY - character string buffer too small

    I am creating a updateable report with a popup_from_query item on a table with a high number of columns (40 columns) where every column should be displayed as a popup_from_query.
    I get the following error message when running the page:
    report error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    *** It seems the longer the column list gets, the shorter the p_lov_query parameter could be.
    - Region 1: If you use only one column, your lov query fails with a statement that is 807+ characters. (if you use 806 it will work without an error).
    - Region 2: If you use only two column, you will fail just with a value of 800.
    - Region ?: I have 40 columns, now my query fails of about 30 charachters.
    * Region 1:
    select
    htmldb_item.popup_from_query(5,'x',
    'SELECT distinct '||COLUMN_NAME||' d, '||COLUMN_NAME||' r'||
    rpad(' ',807,' ')||
    ' FROM '||TABLE_NAME||' order by 1') xxxxxxxxxxxxxxxxxxxxxxxxxxxxx1
    from all_tab_columns
    where rownum < 2
    * Region 2:
    select
    HTMLDB_ITEM.POPUP_FROM_QUERY (
    44, 'x',
    'SELECT distinct '||COLUMN_NAME||' d, '||COLUMN_NAME||' r'||
    rpad(' ',800,' ')||
    ' FROM '||TABLE_NAME||' order by 1',
    least(DATA_LENGTH,60),2000
    ) xxxxxxxxxxxxxxxxxxxxxxxxxxxxx1,
    HTMLDB_ITEM.POPUP_FROM_QUERY (
    44, 'x',
    'SELECT distinct '||COLUMN_NAME||' d, '||COLUMN_NAME||' r'||
    rpad(' ',800,' ')||
    ' FROM '||TABLE_NAME||' order by 1',
    least(DATA_LENGTH,60),2000
    ) xxxxxxxxxxxxxxxxxxxxxxxxxxxxx2
    from all_tab_columns
    where data_type in ('VARCHAR2')
    I have set the region to: Use Generic Column Names (parse query at runtime only)
    Has anyone some suggestions or workaround for updateable reports with a lot of columns where popup's are needed?
    Thx Willi

    Hallo,
    Thank you a lot for that hint. But if this would be the case, why does Region 2 work then?
    Any further comments are welcome.
    Thx, Willi
    P.S.: I had reached the 2000 items (<input>) limit, but now only display less 2000 items on the page: "Your browser sent a request that this server could not understand.
    mod_plsql: /pls/htmldb/wwv_flow.accept HTTP-400 Too many arguments passed in.
    Got 9016 parameters. Upper limit is 2000"

  • PL/SQL: numeric or value error (character string buffer too small)

    Hi All,
    Below is the procedure used to send notifications. It was working fine in previous DB version :- 10.1.0.5.0 and there was recent upgrade to 11.2.0.2.0.
    I complies fine, but when executing it throws the error.
    PROCEDURE PROC_STATUS_MAIL_UNADJ IS
           K_BOUNDARY CONSTANT VARCHAR2(1000) := 'a1b2c3d4e3f2g1';
          l_analysis_report  VARCHAR2(32767); --empty_clob; --clob :=
          l_header VARCHAR2(1000);
          l_footer VARCHAR2(200);
          cnxn UTL_SMTP.connection;
          cursor cloc is select location_id from locations order by location_id asc;
          loc_id cloc%rowtype;
    BEGIN
      dbms_output.enable (1000000);
         FOR loc_id in  cloc
         loop
         l_analysis_report := '<style type="text/css">
        <!--.style1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; color: #FF0000}-->
        <!--.sidebar1 { font-family: Arial, Helvetica, sans-serif; font-size: 10px}-->
        <!--.text { font-family: Arial, Helvetica, sans-serif; font-size: 12px}-->
        </style>
        <center><b><font face="Arial">Run Summary Report'
                    || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI AM') || '<br><br></font></b></center>'
                    || ' <div align="center"><table width="95%" border="1" cellspacing="0" cellpadding="1" </div>'
                    || '<span style="font-size: 10pt; font-family: Arial"> </span> '
                    || '<tr bgcolor=b4b4b4><td align="center"> <font size="3"> <b>'
                    || 'Analysis</b></td><td align="center"><font size="3"> <b>'
                    || 'Start Time</b></td><td align="center"><font size="3"> <b>'
                    || 'End Time</b></td><td align="center"><font size="3"> <b>'
                    || 'Run Duration (mins)</b></td><td align="center"><font size="3"> <b>'
                    || 'Status</b></font></td></tr> ' || UTL_TCP.CRLF;
                    FOR curr_refresh IN (SELECT AN.ANALYSIS_ID,AN.NAME ANALYSIS_NAME,TO_CHAR(ARH.RUN_START_TIME,'DD/MM/YYYY HH:MI:SS') START_TIME,
                                         TO_CHAR(ARH.RUN_END_TIME,'DD/MM/YYYY HH:MI:SS')END_TIME,
                                         ROUND(((ARH.RUN_END_TIME-ARH.RUN_START_TIME)*24*60),2) RUN_TIME_SECS,ARH.JOB_STATUS STATUS
                                         FROM
                                         RUN_HISTORY ARH,ANALYSES AN
                                         WHERE
                                         AN.ANALYSIS_ID=ARH.ANALYSIS_ID
                                         AND AN.CYCLE_IND_ID IN (1,3)
                                         AND ARH.RUN_START_TIME>TO_DATE(SYSDATE-30)
                                         AND ARH.JOB_NAME LIKE 'RHS_QU%'                                  
                                         AND AN.LOCATION_ID = loc_id.location_id
                                         AND ARH.JOB_STATUS='Completed'
                                         ORDER BY ARH.RUN_START_TIME DESC)
                           LOOP
                       l_analysis_report  := l_analysis_report ||'<tr><td align="center">'|| curr_refresh.analysis_name
                          || '</td><td align="center">' || curr_refresh.start_time || '</td><td align="center">'
                          || curr_refresh.end_time || '</td><td align="center">'|| curr_refresh.RUN_TIME_SECS ||
                          '</td><td align="center">'|| curr_refresh.status ||
                          '</td> </tr>' || UTL_TCP.CRLF;
                      exit when length (l_analysis_report) > 32500;
                   END LOOP;
                  l_analysis_report := l_analysis_report || '</table><br><br>';
                   l_footer := UTL_TCP.CRLF ||'<b> Note: This is an auto generated email. Please do not reply to it. Contact the IT team for any further information.</b>'||  UTL_TCP.CRLF;
                   FOR curr_email IN (SELECT GLOBAL_NAME INSTANCE_NAME,
                                      EU.EMAIL_USER_LAST_NAME last_name, EU.EMAIL_USER_FIRST_NAME ACNAME,
                                      EU.EMAIL_USER_EMAIL_ID,loc.LOCATION_NAME LOC_NAME,
                                      '[email protected]' MAIL_FROM
                                      FROM
                                      RHS_EMAIL_USER EU,LOCATIONS LOC,GLOBAL_NAME
                                      WHERE EU.LOCATION_ID=LOC.LOCATION_ID
                                      AND EU.LOCATION_ID=loc_id.location_id
                                  ) LOOP
                cnxn := UTL_SMTP.open_connection('smtprelay.inc.com', 25);
                UTL_SMTP.helo(cnxn, 'smtprelay.inc.com');
                UTL_SMTP.mail(cnxn, '[email protected]');
                UTL_SMTP.rcpt(cnxn, curr_email.EMAIL_USER_EMAIL_ID);
                      l_header := 'MIME-Version: 1.0'||'
    To: ' || curr_email.last_name || ' <' || curr_email.EMAIL_USER_EMAIL_ID || '>
    From: ' || curr_email.mail_from || '
    Subject: Un-Adjusted Analysis Report for ' || curr_email.loc_name || ' Location from' || curr_email.instance_name || ' on ' || to_char(sysdate, 'DD-MON-YYYY') || '
    Reply-To: [email protected]
    Content-Type: text/html;' || UTL_TCP.CRLF || UTL_TCP.CRLF;
                UTL_SMTP.data(cnxn, l_header || l_analysis_report || l_footer);
                UTL_SMTP.quit(cnxn);
                END LOOP;
                END LOOP;
    END PROC_STATUS_MAIL_UNADJ;
    Error :-
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "SYS.UTL_SMTP", line 591
    ORA-06512: at "SYS.UTL_SMTP", line 497
    ORA-06512: at "SYS.UTL_SMTP", line 503
    ORA-06512: at "RISK_HISTORY.PKG_RHS_EMAIL_NOTIFY", line 206
    ORA-06512: at "RISK_HISTORY.PKG_RHS_EMAIL_NOTIFY", line 414
    ORA-06512: at line 2Can you please let me know if there is any issue with code or any upgrade issue ?
    Regards,
    Sunny
    Edited by: k_17 on Oct 13, 2011 12:07 PM

    Hi Helios,
    Many thanks for your reply.
    I am able to figure out the issue. In the code we have
    l_analysis_report  := l_analysis_report ||'<tr><td align="center">'|| curr_refresh.analysis_name
                          || '</td><td align="center">' || curr_refresh.start_time || '</td><td align="center">'
                          || curr_refresh.end_time || '</td><td align="center">'|| curr_refresh.RUN_TIME_SECS ||
                          '</td><td align="center">'|| curr_refresh.status ||
                          '</td> </tr>' || UTL_TCP.CRLF;
                      exit when length (l_analysis_report) > 32500;where "l_analysis_report VARCHAR2(32767);"
    The issue is report has more characters, and when executing it throws the error " ORA-06502: PL/SQL: numeric or value error: character string buffer too small ".
    Can you please let me know how to have more characters/data in the report. Will CLOB help if yes, please let me know how to use it.
    Kindly suggest some options.
    Regards,
    Sunny

  • Overflow the SQL query string buffer

    Hello,
    I have a report that is using a query to determine values for a parameter. In Report Builder everything renders fine, but when I publish the report on the Report Server, it will not render if too many values are entered for the parameter, including "Select
    All". The reason for this behavior is likely due to the number of possible values for the parameter being over 2500. My research has shown that this is causing an overflow of the SQL query string buffer. The obvious fix is to not use that column as a
    parameter, but the power that be are insisting. My system administrator says he can likely increase the buffer size, but has asked me to find out how and where to do that. Any help would be much appreciated.

    Hi CrazyAlligator,
    According to your description, you have more than 2500 values within a parameter. It throws overflow exception when selecting all values. Right?
    Microsoft security update MS11-100 limits the maximum number of form keys, files, and JSON members to
    1000 in an HTTP request. Because of this change, ASP.NET applications reject requests that have more than
    1000 of these elements. HTTP clients that make these kinds of requests will be denied, and an error message will appear in the web browser. The error message will usually have an HTTP 500 status code. This new limit can be configured on a per-application
    basis. Please see the "Resolution" section for configuration instructions. Please refer the KB article:
    https://support2.microsoft.com/kb/2661403?wa=wsignin1.0
    In this scenario, we need add the setting in the web.config file. Please follow the steps below:
    Go to the reporting services installation folder.
    Go to the report server folder and make a backup of the file “Web.config”. Once you have the backup, open the original file in notepad and add the following entry under the Configuration section:
        <appSettings>
                    <add key="aspnet:MaxHttpCollectionKeys" value="10000"/>
        </appSettings>
    Go to the Report Manager folder and again make a backup of the file “Web.config”. Once you have the backup, open the original file in notepad and add the following entry under the appSettings tag:
    <add key="aspnet:MaxHttpCollectionKeys" value="10000"/
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • ORA-06502 nuemeric or value error: character string buffer too small

    i am getting above error while doing
    ORA-06502 nuemeric or value error: character string buffer too small
    ORA-06512 itw_item_add_ch at line 17
    plz urgent
    CREATE OR REPLACE procedure itw_item_add_ch (header_id1 number, folio out varchar2,tariff out varchar2) as
    cursor item_add(header_id1 number) is
    SELECT
    DISTINCT c.attribute4 item_tariff_no,
    c.attribute5 item_folio
    FROM OE_ORDER_LINES_ALL b,
         mtl_system_items c
    WHERE b.flow_status_code not in ('SHIPPED','FULFILLMENT','CLOSED')
    and      b.inventory_item_id = c.inventory_item_id
    and     b.ship_from_org_id = c.organization_id
    and b.header_id = header_id1;
    begin
    for item_att in item_add(header_id1) loop
         if folio is null then
         folio := item_att.item_folio;
         else
         folio := folio||'/'||item_att.item_folio;
         end if;
         if tariff is null then
         tariff := item_att.item_tariff_no;
         else
         tariff := tariff||'/'||item_att.item_tariff_no;
         end if;
         end loop;
    end;

    if you want to find out which of your two variables are causing the problem, then use pragma exception_init along with "begin end exception" blocks within the loop.
    I've removed the procedure specification, so you can test this in SQL Plus. You need to supply a number to the Header_id1 variable something like this:
    set serveroutput on
    begin
      header_id1 number := 1; -- supply your own parameter here
      cursor Item_Add(Header_Id1 number) is
        select
              distinct c.Attribute4 Item_Tariff_No
             ,c.Attribute5          Item_Folio  
        from  Oe_Order_Lines_All    b
             ,MTL_System_Items      c
        where b.Flow_Status_Code    not in ('SHIPPED','FULFILLMENT','CLOSED')
        and   b.Inventory_Item_Id   = c.Inventory_Item_Id
        and   b.Ship_From_Org_Id    = c.Organization_Id
        and   b.Header_Id           = Header_Id1;
      exception TOO_MANY_CHARS;
      exception TOO_TARIFF_CHARS;
      pragma exception_init(TOO_MANY_CHARS, -6502);
      l_Folio varchar2(32747);
      l_Tariff varchar2(32747);
      l_Folio_Continue boolean  := true;
      l_Tariff_Continue boolean := true;
    begin
      for Item_Att in Item_Add(Header_Id1) loop
        if (l_Folio_Continue) then
          begin
            if l_Folio is null then
              l_Folio := Item_Att.Item_Folio;
            else
              l_Folio := l_Folio||'/'||Item_Att.Item_Folio;
            end if;
          exception
            when TOO_MANY_CHARS then
              dbms_output.put_line ('Foilio has too many values ');
              l_Folio_Continue := false;
              exit;
          end;
        end if;
        if (l_Tariff_Continue) then
          begin
            if l_Tariff is null then
              l_Tariff := Item_Att.Item_Tariff_No;
            else
              l_Tariff := l_Tariff||'/'||Item_Att.Item_Tariff_No;
            end if;
          exception
            when TOO_MANY_CHARS then
              dbms_output.put_line ('Tariff has too many values ');
              l_Tariff_Continue := false;
              exit;
        end if;
      end loop;
    end;
    /this is untested, so please sort out any compilation errors yourself.

  • LOV - PL/SQL: numeric or value error: character string buffer too small

    I have a field set to 'text field with autocomplete' and now that the data that is used for the LOV has increased dramatically it returns the following error 'ORA-06502: PL/SQL: numeric or value error: character string buffer too small'. Through trial and error I determined that if I restricted the number of rows returned using rownum < nnn then it would work. I then determined that I could use the trim and substring functions and remove the rownum restriction and it would work. Below is the LOV query. I have seen a couple of other posts similar to my problem and one of them asked if there was a way to increase the buffer size, but it was never answered. Is there a way, such as a parameter setting, that I could increase the buffer size for LOVs?
    select distinct substr(trim(item_requested),1,50) d
    from consolidated_components
    order by 1
    Thank you.

    Hi Scott
    Thanks very much for jumping in here.
    No, I didn't use the wizard to create the page. It was a manual operation but to tell you the truth the page has been changed so many times as I was working on different functionality and appearance that anything could have happened. I ended up having to manually create row processing processes and delete other processes, creating and hiding buttons, changing the way I'm passing item values, etc. I realize regardless of what I do as a developer the software should be able to handle all changes through it's interface but I've been in this business long enough to be realistic.
    I also could have done something blatantly stupid as I continue to learn this product. For those of us not yet totally comfortable with all the web development technology, Javascript, AJAX, etc., but are asked to develop applications that work best using those technologies sometimes we make elementary blunders.
    Thanks very much for your help. It is indeed appreciated.
    -gary

Maybe you are looking for

  • I think I've found a bug... (CS 4 6.0.4, export to EPUB, w/ test case)

    Hi everyone, I think I've found a bug. I suppose I would like to see if others can reproduce it - I've managed to on 2 work machines, but the more the merrier. I suppose I'm also hoping that giving this bug more exposure will increase the likelihood

  • NWDI in three system landsacpe

    Hi 1. I had Portal Dev system where central NWDI & central SLD was configured with template installer, developers were doing initial developements 2. Now I have installed the Portal Quality system, I Just registered with the central SLD of Portal Dev

  • HT201412 there is a black box on my screen

    There is a black box around all my apps/when I turn on the phone and my touch screen isn't working - I can't move off the initial screen and the only thing I can get to work is Siri - I have tried turning it off and on (which is difficult since the t

  • Ibooks not downloading on my iphone 5

    Hi.  ibooks isn't downloading on my iPhone 5c. I'm not sure what operating system I'm on.  I did an update in early Jan.  I recently changed the apple ID associated with my iPhone.  ibooks lets me "get" the book, but it just loops the download.  Than

  • Error when upgrade from 8.8 PL5 to other patch or upgrade

    Hi, I encountered a problem during the upgrade process from PL05 to another PL, to be precise to PL13, PL14, PL15 and PL16. In practice, the system does not allow me to select Common DB and Company DB in the list of components to upgrade. If I look i