Problem in running Job through Sqlplus

Hi,
I'm trying to run sequence of sql statments to run a job. At the end of this i'm getting error, anyone can help me out on the same.
-- Creating a table with a column cob.
create table gob(cob number(5))
-- Procedure to insert a value 100 in table gob
create or replace procedure autoins IS
begin
insert into gob values(100);
end;
-- PL-SQL block to create & submit a job.
VARIABLE jobno number;
BEGIN
DBMS_JOB.SUBMIT(:jobno, 'autoins ;',
SYSDATE, 'SYSDATE + 1');
COMMIT;
END;
At the end of it i'm getting following error,
BEGIN
ERROR at line 1:
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at "SYS.STANDARD", line 586
ORA-06512: at line 2
Anyone can help ???????
Regards,
Ashish.

Hi Garcia,
Thanks a lot for this help. Acutally "select count(1) from dual" was returning 3 initally so i have used delete statement twice and now its returning only one value. Though problem is solved but still i couldn't understand the cause of this.
Thanks a lot again.
Regards,
Ashish.

Similar Messages

  • Problem in submitting job through Pl/sql

    Hi,
    I have a procedure with parameters as shown below.
    Pkg1.Proc1(indate date, innum1 number, innum2 number)
    I am trying to execute this procedure by submitting jobs through another procedure and passing the parameters dynamically. I found the jobs are not getting submitted. Please see the code inside the procedure as below.
    dbms_job.submit(var1,'BEGIN pkg1.Proc1(''' || i_date||''','|| i_num1||','||i_num2||'); END;',SYSDATE);
    I have tried as following also
    dbms_job.submit(var1,'BEGIN pkg1.Proc1(''''' || i_date||''''','|| i_num1||','||i_num2||'); END;',SYSDATE);
    both time the procedure is running fine but the job is not seen as submitted.
    when I am executing it as follows in sql * plus, it is executing fine.
    dbms_job.submit(var1,'BEGIN pkg1.Proc1(''15-aug-2007'',1,2); END;',SYSDATE);
    Please let me know if I need to change anything in my code.
    Regards,
    Poulose

    Hi Pls find the portion below.
    process_id is of type number and having value 1001. v_business_dt is a date variable. and i_module is a number with value 1.
    DBMS_JOB.ISUBMIT(CF_CRM.process_id,'BEGIN DBK_CRM_PROCESS_TRACKING.RUN_PROC(''' || v_business_dt||''','|| i_module||','||CF_CRM.process_id||'); END;',SYSDATE);

  • Problems with running Applet through HTML

    I am currently having problems with running my file through the HTML. For some reason when I open it in the browser it keeps saying Error. I am programming in NetBeans.
    The code I am using is:
    <html>
    <head>
    <title></title>
    </head>
    <body>
    <applet code=”CarApplet.class” codebase="RedCarApplet.jar" width=690 height=300></applet>
    </body>
    </html>

    Heres the error message, I see that it cannot find the class I have stated above. Any solutions?
    My class is in the 'build' folder but, the HTML file is in the 'src' folder. Now my applet contains a 'jar' file, do I need to add that to the HTML code?
    load: class ‚Ä?TunerApplet.class‚Ä? not found.
    java.lang.ClassNotFoundException: ‚Ä?TunerApplet.class‚Ä?
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.FileNotFoundException: C:\Users\*****\*******\NetBeansProjects\RadioApplet\src\‚Ä?TunerApplet\class‚Ä?.class (The system cannot find the path specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(Unknown Source)
         at java.io.FileInputStream.<init>(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 9 more
    Exception: java.lang.ClassNotFoundException: ”TunerApplet.class”

  • Problem in running job from OEM

    I have registered JOB with OEM using TCL script from warehouse builder. I login to OEM and it shows me one job in JOB library. Now i submit this job. It keeps on showing status submitting on the Active jobs tab. It does not do anything
    Thanks in advance.

    Hi Garcia,
    Thanks a lot for this help. Acutally "select count(1) from dual" was returning 3 initally so i have used delete statement twice and now its returning only one value. Though problem is solved but still i couldn't understand the cause of this.
    Thanks a lot again.
    Regards,
    Ashish.

  • Problems running jobs in db 10gR2 from owb 10.1.0.4

    Hi all,
    we have a little problem, we can not run jobs through the deployment manager. The deployment is ok but instead of something running we get to see nothing at all. I already noticed some minor problems that could be solved by granting a few privileges and I am afraid there are a few more missing.
    The installation was a fresh 10.2.0.2 database in which a new runtime repository and schema was created. In the location we specified 10.2 as target database release.
    Is any tip available about where to check ?
    What log/trace could be usefull ?
    Who is running this combination for production ?
    thanks.
    Ronald.

    Thanks for the pointer, it did not help ...
    We opened a TAR and we were suggested changing to owf 2.6.3 instead of 2.6.4. This looks a bit weird to me since as fas as I remember 2.6.4 ( from the 10gR2 companion cd) was installed ... This seems to be working ok now.
    Ronald
    http://ronr.nl/unix-dba

  • I am having a problem w/ my itunes working correctly due to accidentally running Itunes through my troubleshooting, running programs made for previous versions of windows!! How do I turn it off?!??

    I am having a problem w/ my Itunes working correctly, after accidentally running Itunes through my  troubleshooter  to, Run Programs Made For PreviousVersions of Windows. It keeps popping up that the Compatibility  Version is on, to make sure it's off before opening my Itunes Account. I've looked everywhere, Please, Please, How Do I Make This Right??!??

    It sounds like either your hard drive or the SATA cable that connects it to the motherboard are failing. This could be heat related in your case, which is why you see it after it runs awhile. You can take it to the Genius Bar for a free evaluation. If you decide to test it yourself, I usually suggest moving the hard drive to an external enclosure. If it works there for awhile, the cable is probably the issue.
    http://www.amazon.com/Sabrent-2-5-Inch-Aluminum-Enclosure-EC-TB4P/dp/B005EIGUD4/ ref=sr_1_3?ie=UTF8&qid=1397647657&sr=8-3&keywords=2.5+enclosure
    http://www.ifixit.com/Device/MacBook_Pro_13%22_Unibody_Mid_2009

  • Help me, I am using flash pro cc and air 4.0,i have one problem when publishing apk through air publish settings,choosing the run time option from third party is disabled.can any one help me bcoz i have to publish without air runtime.......

    Help me, I am using flash pro cc and air 4.0,i have one problem when publishing apk through air publish settings,choosing the run time option from third party is disabled.
    can any one help me bcoz i have to publish without air runtime.......

    Hi,
    This option is available when your publish target is set to AIR 3.6.
    You can download the desired AIR SDK version from Archived Adobe AIR SDK versions
    Thanks!
    Mohan

  • Problems with DBMS_JOB - not running jobs

    Hello,
    for some reason our Database (after night restart - shutdown at 23:00, startup at 0:20) stopped to run jobs from DBMS_JOB. I've enabled them manually (DBMS_JOB.RUN(2334)) - but they still not run after reaching the NEXT_DATE,NEXT_SEC time.
    I've noticed that:
    select * from dba_scheduler_global_attribute where ATTRIBUTE_NAME='CURRENT_OPEN_WINDOW';
    ATTRIBUTE_NAME VALUE
    CURRENT_OPEN_WINDOW TUESDAY_WINDOW
    Current day of week is wednesday not tuesday - and I think that is the reason.
    I've tried this statement:
    SQL> execute DBMS_SCHEDULER.CLOSE_WINDOW(WINDOW_NAME => 'TUESDAY_WINDOW');
    BEGIN DBMS_SCHEDULER.CLOSE_WINDOW(WINDOW_NAME => 'TUESDAY_WINDOW'); END;
    ERROR at line 1:
    ORA-00449: background process '' unexpectedly terminated with error
    ORA-06512: at "SYS.DBMS_ISCHED", line 347
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 968
    ORA-06512: at line 1
    Is there any other way to fix this problem without restart of database?
    Thank you for any help
    Best regards

    Manually execute the job and let it run itself beginning next Tuesday.

  • A problem about the "Max running jobs". Thanks a million!

    Hello everyone,
    The "Max running jobs" was set to 15.
    (1). When I dragged two assets into FCSvr at a time, in the "Search all jobs" window, I saw the first one being uploaded then transcoded, and later the second one being uploaded then transcoded.
    (2). When I dragged them into FCSvr one by one, I saw them being uploaded, then the first one being transcoded, and the second one later.
    Thus with (2), there is no need to wait or queue between the uploading of the second one and the transcoding of the first one.
    However, I intend to drag the assets at the same time, besides, I wanna attain the aim in (2) that no queue to wait. Could someone tell me how to do it?
    With best regards,
    Steven Lee
    PINZ Media

    If I understand, you used for upload menu "Upload file..."
    For uploading and conversation in same time many files you can setup production action (response) for some folder on your device (XSAN, RAID, HDD)
    This action can create production for folder, and create assets for media in folder. The add action "SCAN" in response submenu. For transcoding many assets in same time check radio button "Background Analyze" in response "SCAN".
    You can read more about that in manual.

  • Problem in running WAR file developed through NetBeans Visual Web

    hi all,
    actually i developed a web application in JSF using IDE NetBeans Visual Web.
    application is having a table which is connected to database ( MySQL ).... i dragged my database table on visual web's table and all the connections were automatically created. i m using tomcat as a web server.
    application runs fine through Netbeans but wen i deployed its war file in tomcat and tried to run.....browser showed me the table but the data was not there.....infact i m getting "No items in the table" written, in my table on browser.
    plz help.....thnx in advance
    Pranay

    Ramchow --
    One suggestion is to use JDeveloper to do the deployment.
    Create a connection in JDeveloper to the OC4J instance you wish to deploy to, then create a new deployment profile for your application and let JDeveloper perform the deploymnent for you.
    Once it's working, you can then go and look at the OC4J configuration files and see the tags looks like to perform the deployment correctly.
    Note that JDeveloper will deploy the WAR file by first wrappering it in an EAR file.
    -steve-

  • ORA-00900: invalid SQL statement error while running jobs in APEX 4.2

    Hi,
    the following procedure compiled successfully in Apex 4.2:
    create or replace procedure "DEVLOE" AS
    L_TEMPLATE VARCHAR2(32000);
    L_base_TEMPLATE VARCHAR2(32000);
    begin
    l_base_template := '<html>
    <head>
    <title>HTML Editor Sample Page</title>
    </head>
    <body>
    <p>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span class="plsql-literal" style="line-height: 14.65625px; white-space: nowrap;">Hi #Contact#,</span></span></span></p>
    <p>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span class="plsql-literal" style="line-height: 14.65625px; white-space: nowrap;">This is a notification message to inform you that <strong>Development </strong>effort </span><span class="plsql-literal" style="line-height: 14.65625px; white-space: nowrap;">and milestones are yet to be updated for ECR: </span><span class="plsql-operator" style="line-height: 14.65625px; white-space: nowrap;"></span><span class="plsql-word" style="line-height: 14.65625px; white-space: nowrap;">#ECR_NAME#. This ECR has priority #p#. </span></span></span></p>
    <table align="center" border="1" cellpadding="1" cellspacing="1" style="width: 500px;">
    <tbody>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="color: rgb(255, 0, 0);"><span style="font-family: verdana, geneva, sans-serif;"><u><strong>Department</strong></u></span></span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span style="color: rgb(255, 0, 0);"><u><strong><span style="background-color: rgb(255, 255, 255);">Contact Name</span></strong></u></span></span></span></td>
    </tr>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Product Management Contact</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#pdm#</span></span></td>
    </tr>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">PMO Contact</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#PMO#</span></span></td>
    </tr>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Dev Contact</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#Dev#</span></span></td>
    </tr>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">QA Contact</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#QA#</span></span></td>
    </tr>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Infodev Contact</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#Info#</span></span></td>
    </tr>
    </tbody>
    </table>
    <p>
     </p>
    <span fckbookmark="1" style="display: none;"> </span><span fckbookmark="1" style="display: none;"> </span>
    <table align="center" border="1" cellpadding="1" cellspacing="1" style="width: 500px;">
    <tbody>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span style="color: rgb(0, 0, 255);">Team</span></span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span style="color: rgb(0, 0, 255);">Start Date</span></span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span style="color: rgb(0, 0, 255);">End Date</span></span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span style="color: rgb(0, 0, 255);">Effort(in person days)</span></span></span></td>
    </tr>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Development</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#d1#</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#e1#</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#L1#</span></span></td>
    </tr>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Quality Assurance</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#d2#</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#e2#</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#L2#</span></span></td>
    </tr>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Information Development</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#d3#</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#e3#</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#L3#</span></span></td>
    </tr>
    </tbody>
    </table>
    <p>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">The ECR application is located</span> at </span>: https://apex.oraclecorp.com/pls/apex/f?p=1472:1<span fckbookmark="1" style="display: none;"> </span></p>
    <span fckbookmark="1" style="display: none;"> </span>
    <p>
    <span style="font-family: verdana, geneva, sans-serif; font-size: 14px;">Regards,</span></p>
    <p>
     </p>
    <p>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">ECR Team</span></span></p>
    </body>
    </html>
    FOR c1 IN (select ECR_NAME,PMO_CONTACT, QE_LOE,INFODEV_LOE, DEV_START_DATE, DEV_END_DATE, QE_CONTACT,QE_START_DATE,INFODEV_START_DATE,INFODEV_END_DATE, QE_END_DATE, INFODEV_CONTACT, PDM_CONTACT, DEV_LOE,ECR_PRIORITY, DEV_CONTACT from ECR_NAME WHERE DEV_LOE IS NULL AND ECR_STATUS = 'Effort Estimation is in Progress' AND ECR_PRIORITY <=5)
    LOOP
    l_template := l_base_template;
    l_template:= replace(l_template, '#Contact#', c1.DEV_CONTACT);
    l_template:= replace(l_template, '#ECR_NAME#', c1.ECR_NAME);
    l_template:= replace(l_template, '#p#', c1.ECR_PRIORITY);
    l_template:= replace(l_template, '#PMO#', c1.PMO_CONTACT);
    l_template:= replace(l_template, '#pdm#', c1.PDM_CONTACT);
    l_template:= replace(l_template, '#Dev#', c1.DEV_CONTACT);
    l_template:= replace(l_template, '#QA#', c1.QE_CONTACT);
    l_template:= replace(l_template, '#Info#', c1.INFODEV_CONTACT);
    l_template:= replace(l_template, '#d1#', c1.DEV_START_DATE);
    l_template:= replace(l_template, '#L1#', c1.DEV_LOE);
    l_template:= replace(l_template, '#e1#', c1.DEV_END_DATE);
    l_template:= replace(l_template, '#d2#', c1.QE_START_DATE);
    l_template:= replace(l_template, '#L2#', c1.QE_LOE);
    l_template:= replace(l_template, '#e2#', c1.QE_END_DATE);
    l_template:= replace(l_template, '#d3#', c1.INFODEV_START_DATE);
    l_template:= replace(l_template, '#L3#', c1.INFODEV_LOE);
    l_template:= replace(l_template, '#e3#', c1.INFODEV_END_DATE);
    htmldb_mail.Send(p_to => '[email protected]',
    p_cc => '[email protected]',
    p_from => '[email protected]',
    p_body => l_template,
    p_body_html => l_template,
    p_subj => 'cxxxx:' ||c1.ECR_NAME );
    END LOOP;
    end;
    the when I ran:
    begin
    devloe();
    end;
    I received the mail as well.
    However, when I try to schedule this in the job:
    declare
    JobNo user_jobs.job%TYPE;
    begin
    dbms_job.submit(JobNo, 'BEGIN
    DEVLOE();
    END;', sysdate, 'sysdate + 1/24/60'); commit; end;
    The job status shows failures every minute.
    dbms_job.run(job_no);
    It gave : ORA-00900: invalid SQL statement

    First of all I don't see a procedure header.
    Secondly I see you commit inside your procedure. This is a bug.
    Thirdly I see you also commit inside a loop. This is also a bug, and needs to be removed asap.
    The error indicates a statement doesn't parse. As you don't post the error stack, nor a table definition no one can reproduce the problem.
    You need to isolate the statements, one by one, and run them through sql*plus to see what happens.
    Sybrand Bakker
    Senior Oracle DBA

  • Executing DI jobs through commnad line

    Hi all,
    I have been reading some post that seemed similar to what I am about to ask, but I did not find anything that could solve my problem.
    I am trying to run the DI jobs through the command line in the production environment, but never using the console.
    The process would be as follows:
    In the dev environment, we do export execution command for every job, then we move all the files to the production machine and make the proper changes (server name...),then the jobs would be run through the command line. The thing is that the al_engine process has a -G option to write the id that identifies the job, but I cannot see an option to specify the name of the job instead of the id.
    Does anyone know if there is a way to specify the name of a job?
    Thanks a lot

    -s jobname
    is used instead of -G GUID

  • Can not see running jobs from, package

    I have a problem with processing parallely runing jobs:
    I am creating another immediately runned jobs in a main job. Those two parallel jobs (2 loads from different databases) have to be finished before I run next operation (working out loaded data). Problem is that, after starting those 2 parallel jobs, I can not see them by select from ALL_SCHEDULER_RUNNING_JOBS that is executed immediately after I create those jobs in a package. If I take a look into ALL_SCHEDULER_RUNNING_JOBS from anonymous statement I can see all my running jobs. Let's sum it up:
    1/ Start of main job
    2/ Running 2 immediately created jobs (load data)
    3/ Checking in loop if jobs created in step 2 are still running
    3.1/ Jobs are running (ALL_SCHEDULER_RUNNING_JOBS check) - sleep for a
    while - It never happens - can't see any running jobs from select executed in
    package but can see them in
    anonymous statement
    3.2/ Jobs finished - start processing loaded data
    Can somebody help me with this task?
    Thanks alot!
    Jakub

    Hi,
    There is no reason a job should be visible from an anonymous block but not from inside a job. There are two things that may be happening here.
    - jobs scheduled to run immediately my not start running as soon as they are created/enabled, you may need to wait a bit before they start running (they will appear in all_scheduler_jobs immediately but maybe not all_scheduler_running_jobs immediately)
    - you may be running into privilege issues. Is the user that executes the anonymous block the same as the user that the job is running as (the job's schema) ? If not maybe the job user does not have privileges to see the job (you can grant alter on the job to the user to ensure this).
    Can you see the jobs in the all_scheduler_jobs view from within the job with status RUNNING ? If you can see jobs in all_scheduler_jobs as RUNNING but not in all_scheduler_running_jobs then this is a bug of some sort.
    Thanks,
    Ravi.

  • Cannot get my iphone5 to synch with my new computer. i am running itunes through a virtual box, Every time I try a box appeares telling me to enter security code- ? anyone know how to solve this ?

    Cant get my iphone 5 to sync with my computer (new operating system). Am running XP through a virtual box. When I try to sync the phone it keeps asking for auto lock code, there is no box to type it into and I can find nothing on the phone itself to solve the problem.
    This makes it impossibble to sync with my itunes account. Anyone out there able to help ?

    Have you tried contactint the app's developer?

  • ERROR WHILE RUNNING REPORT THROUGH FORMS.....!

    hi all,
    ive designed one form in Forms 9i...I'm tryin to run report through a Push button .....report is running well in paper layout through report builder 9i...The problem I'm facing is dat when i pressed button it is giving me error initially as FRM-41214 cannot run report and after that FRM-40735 When button pressed unhandled exception ora-06502.....What could go wrong??... Ive started OC4J instance ....created report object in object nevigator as well and defined basic properties for diff.parameters HTMLCSS,CACHE..etc.,mentioned report path in complete i.e.c:\reports\genbill.rdf ...Can anybody help me out ??? Thnx.!
    -----------------------CODE ON BUTTON----------------------------------
    DECLARE
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    BEGIN
    repid := FIND_REPORT_OBJECT('REPORT5');
    v_rep := RUN_REPORT_OBJECT(repid);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    IF rep_status = 'FINISHED' THEN
    /*Display report in the browser*/
    WEB.SHOW_DOCUMENT('<HOSTNAME>:8889/reports/rwservlet/getjobid'||
    substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=myrepserver','_blank');
    ELSE
    message('Error when running report');
    END IF;
    PAUSE;
    END;

    When a report terminates with an error, REPORT_OBJECT_STATUS returns the value "TERMINATED_WITH_ERROR", which is 21 bytes of data, but rep_status is defined as 20 bytes. The 6502 error is due to the data not fitting the variable.
    I recommend wrapping the REPORT_OBJECT_STATUS function with a SUBSTR that limits the data returned to 20 bytes, which will ensure the results fit.
    For example:
    rep_status := SUBSTR(REPORT_OBJECT_STATUS(v_rep), 1, 20);

Maybe you are looking for