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

Similar Messages

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

  • Problem while submitting job from Forms

    Hi,
    i'm submitting a job in when button pressed trigger. This job will call a Backend Package(one procedure). But the job id is created in the backend but the job is not running. but if i run the job with DBMS_job.Run(jobid) from form itself after submitting the job, its working fine. Do we need to maintain any parameter to run job automatically?
    Thanks in advance.

    if there are four parameters passed then one of them is contradicting ur conditional statements. First check and debug those parameters if they consist the required value. also post ur code for further scrutiny.
    zaibi.

  • Problem in loading "SYSDATE" through the sql loader

    Hi experts,
    I have problems in inserting the sysdate while loading the data from the flatfile. The details of the control file is as follows:
    OPTIONS (ERRORS=100, SILENT=(FEEDBACK))
    LOAD DATA
    INFILE 'c:\sample.dat'
    APPEND
    INTO TABLE RTD_TMO_MODEL_SCORES_BI
    FIELDS TERMINATED BY ','
    --OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    (RECORD_ID "SQ_RTD_TMO_MODEL_SCORES_BI.NEXTVAL",
    MODEL_ID,
    BAN,
    MISDN,
    INSERT_DT date "SYSDATE",
    SCORING_JOB_ID,
    SCORE_ENTITY_ID,
    MODEL_SCORE_DECIMAL,
    MODEL_SCORE_INTEGER,
    MODEL_SCORE_CHAR,
    ANCHOR_DT date "YYYYMMDD",
    RUN_DT date "YYYYMMDD")
    The data values for columns RECORD_ID and INSERT_DT are not present in the data file. The first one is planned to insert with the sequence created in database. While the second one is inserted based on the SYSDATE function of the database.
    Please guide me how to specify so that I can insert the sysdate for the INSERT_DT column.
    Thanks in Advance
    Venkat

    Instead of this
    INSERT_DT date "SYSDATE",
    Try this
    INSERT_DT SYSDATE,

  • Number data-type saving problem through PL/SQL

    hi,
    I am having a field in my table called "amount" with type number(17,3). I am facing some problem while saving the data through pl/sql developer.
    while i am inserting data like 123456789012.567 its working fine but when I am inserting 1234567890123.567 for amount field its now showing any error while saving, but actually its storing "1234567890123.570" in DB. Similar thing is happening when I was saving "12345678901234.567",actually its saving "12345678901234.600".
    Whenever I was getting for 17 digits it's rounding last 3 and for 16 its rounding 2.
    I am using oracle10g as DB server.
    please suggest how to solve this particular problem as i am stuck or the alternate ways...
    Thanks,
    Shouvik

    It is a display problem, not a storage problem. i'm not sure what the equivalent in PL/SQL Developer is, but this sqlplus example seems to replicate your stated issue.
    SQL> create table t (num number(17,3));
    Table created.
    SQL> insert into t values (123456789012.567);
    1 row created.
    SQL> insert into t values (1234567890123.567);
    1 row created.
    SQL> insert into t values (12345678901234.567);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> set numwidth 16
    SQL> select * from t;
                 NUM
    123456789012.567
    1234567890123.57
    12345678901234.6
    SQL> set numwidth 25
    SQL> /
                          NUM
             123456789012.567
            1234567890123.567
           12345678901234.567You need to expand the display width for numbers.
    John

  • Problem in Submiting Background Job

    Hi,
    I am submitting a Program in Background  by using JOB_OPEN and SUBMIT Program and JOB_CLOSE.
    After submiting Job was terminated with following log.
    04/07/2009 11:34:05 Job started                                                                                00           516          S
    04/07/2009 11:34:05 Step 001 started (program YSDU_CUSTOMER_DUP_CHECK, variant &0000000000002, user ID JAGASEK)      00           550          S
    04/07/2009 11:34:05 Cannot perform frontend function in batch input mode                                             FES          002          E
    04/07/2009 11:34:05 Job cancelled after system exception ERROR_MESSAGE                                               00           564          A
    Please help me.
    Thanks,
    Sekhar.J

    Hi sekhar J,
    It looks to me like you may be calling a function from SFES (SAP FrontEnd Services) e.g. FM GUI_UPLOAD, these cannot be used in background mode for obvious reasons.  If the program is reading/writing a local file you will need to use a dataset on the application server instead.  If ths is the case there are plenty of posts cocerning datasets on sdn.
    Regards,
    Simon

  • Submitting XML Publisher Concurrent Program through PL/SQL

    Hi,
    I am trying to submit a XML Publisher concurrent program through PL/SQL API fnd_request.submit_request.
    The request gets fired and completes successfully but it doesn't pick up the default template attached to it. Its output is plain XML but expected output is PDF report.
    However when I submit this report from SRS, it picks up the default template and gives output in PDF.
    Please let me know what could be going wrong?
    Regards,
    Nitin

    Check out the FND_REQUEST.ADD_LAYOUT API. You need to call it before you submit your report.
    Cheers,
    Dave

  • Approval Notification through pl/sql

    Hi,
    We have a requirement to send the workflow approval notification through pl/sql.
    Please share which API needs to be used.
    thanks,
    Swathi

    There is no standard API with Oracle's default supplied PL/SQL packages that supports workflow.
    So I read this question as how IPC (Inter Process Communication) processing can be done in Oracle.
    There are a number of methods. You can use Advance Queues - queue a message to be de-queued and consumed by the message queue owner process. You can simply insert into a table and commit - and have a another process reading this table and process the events inserted into the table. You can create a database pipe between processes. You can submit a background job process and instruct it to perform the notification processing for you.
    The most appropriate method depends entirely on the requirements that need to be met, and problem to solve.

  • Problem in creating job

    Hey to all
    I wanted to create a job that shrink my temp tablespace after one week. Due to huge data loading I get filled. When i create job through EM I could not understand where I put Alter tablespace temp shrink space command . For database home page click server click job link and create button under the command section where I put this command. Plz help I tried to this IN Pl/Sql but job fail
    DECLARE
    SQLSTMT VARCHAR2 (500);
    Begin
    SQLSTMT:= ALTER TABLESPACE temp SHRINK SPACE';
    execute immediate (sqlstmt);
    END;

    I would not waste my time on creating such jobs.
    Main reason: they don't resolve anything. You shrink the tablespace and it will definitely start to grow again.
    You are only fighting symptoms. Maybe you want to earn your living out of fighting symptoms, I don't.
    Apart from the the syntax of execute immediate is
    execute immediate <variable>|<hard coded literal>;
    Before asking syntax questions please use the docs (in this case the PL/SQL reference manual) to verify your usage of a construct is syntactically correct.
    Also this line
    SQLSTMT:= ALTER TABLESPACE temp SHRINK SPACE';
    is lacking a '
    Sybrand Bakker
    Senior Oracle DBA

  • Invoking BPEL Process through pl/sql is failing

    Hi all,
    I am trying to invoke BPEL process through PL/SQL and its throwing following error.
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns="http://xmlns.oracle.com/pcbpel/adapter/file/ReadFile/"><faultcode xmlns="">null:Read_ptt</faultcode><faultstring xmlns="">Cannot figure out operation name. Bad SOAPAction or wsa:Action.</faultstring><faultactor xmlns="">initiate</faultactor></env:Fault></env:Body></env:Envelope>
    Following is code I am using to invoke BPEL PROCESS
    declare
    soap_request varchar2(30000);
    soap_respond varchar2(30000);
    http_req utl_http.req;
    http_resp utl_http.resp;
    begin
    soap_request:='<?xml version="1.0" encoding="UTF-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header/>
    <soap:Body xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/file/ReadFile/">
    --<ns1:Read_plt><ns1:input>leeg</ns1:input></ns1:Read_plt>
    </soap:Body>
    </soap:Envelope>';
    http_req:= sys.utl_http.begin_request('http://localhost/orabpel/default/BPELProcess1/v2007_12_03__65618','POST','HTTP/1.1' );
    sys.utl_http.set_header(http_req, 'Content-Type', 'text/xml') ;
    sys.utl_http.set_header(http_req, 'Content-Length', length(soap_request)) ;
    sys.utl_http.set_header(http_req, 'SOAPAction', 'initiate');
    sys.utl_http.write_text(http_req, soap_request) ;
    http_resp:= sys.utl_http.get_response(http_req) ;
    sys.utl_http.read_text(http_resp, soap_respond) ;
    sys.utl_http.end_response(http_resp) ;
    dbms_output.put_line(soap_respond);
    end;
    Any help would be appriciated.
    Thanks,
    Vipul

    Hi,
    Switching on or off a bpel is an admin job.
    u can stop an application but not one bpel.
    I doubt if there is any way to do it programatically.
    Let us get other opinons
    Regards

  • Problem while scheduling job in apex

    Hi All ,
    I have problem while creating job in apex .Let me explain my problem clearly.I have created a page in
    url: http://apex.oracle.com/pls/otn/
    Workspace : PREETHI_WORKSPACE
    User ID : [email protected]
    Password : bowova1
    Application :Parse and upload csv file -21007
    Page No:1
    Page Name :Parse csv file.
    Main functionality of this page is to upload csv file into oracle table .First user will browse a file from local machine and upload it in upload region.After that,user enters a table name and clicks create table button which creates a table in DB and also shows the report for the same .Creating table is happening through "create table " process when user clicks "create table" button.Code is working fine .One more things here is, in csv file the second row should have data type mentioned .
    My requirement is ,i have to schedule "htmldb_tools.parse_file" in create table process as a job .In this "create table process" we are calling htmldb_tools.parse_file(:P1_FILENAME,'P1_COLLECTION','P1_HEADINGS','P1_COLUMNS','P1_DDL',:P1_TABLENAME);
    Problem Iam facing here is that the scope of item :p1_filename is getting lost when we pass it to procedure .I think problem is due to different apex and database session .
    Tried a lot through various ways ..Not finding the solution.
    Please help...

    Hi Marco,
    I have tried with the setting what u have mentioned in htmldb_tools.parse_file procedure: wwv_flow_api.set_security_group_id(<workspace_id>);
    But Job Getting fail and giving error ""ORA-01400: cannot insert NULL into (ORA-01400: cannot insert NULL into ("FLOWS_020200"."WWV_FLOW_COLLECTIONS$"."SESSION_ID")
    ORA-06512: at "FLOWS_020200.WWV_FLOW_COLLECTION", line 319
    ORA-06512: at "DIMPLE3_HD_DEV.HTMLDB_SID_50", line 196
    ORA-06512: at line 2
    Please help me out in this issue.
    Regards
    Dhan

  • Running an Oracle Enterprise Manager job in Oracle SQL Developer

    Oracle9i Enterprise Edition Release 9.2.0.5.0 - Production
    Is it possible to run an Oracle Enterprise Manager job in Oracle SQL Developer? I have looked through the Oracle help documents for 9i and it does not seem to cover this topic.

    1007692 wrote:
    Oracle9i Enterprise Edition Release 9.2.0.5.0 - Production
    Is it possible to run an Oracle Enterprise Manager job in Oracle SQL Developer? I have looked through the Oracle help documents for 9i and it does not seem to cover this topic.DBA_JOBS resides in the database; not in any particular client.

  • 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

  • I bought iPhone 6 Plus few days ago and I have the following problems: 1) When entering through Safary to Google Images and tap on each on of them they do not enlarged nor I am able by click on them to enter into the connected website

    I bought iPhone 6 Plus few days ago and I have the following problems:
    1) When entering through Safary to Google Images and tap on each one of them they do not enlarge nor I am able by click on them to enter into their connected website
    2) When I receive an e-mail with images I cannot easily save them in my gallery. It needs more than 10 tabs to the window "save this image" or "save all 3 images" and if I am lucky it saves one image. This is very frustrating, I loose a lot of time trying and affects my job.
    I would highly apreciate any help
    Kind Regards

    I bought iPhone 6 Plus few days ago and I have the following problems:
    1) When entering through Safary to Google Images and tap on each one of them they do not enlarge nor I am able by click on them to enter into their connected website
    2) When I receive an e-mail with images I cannot easily save them in my gallery. It needs more than 10 tabs to the window "save this image" or "save all 3 images" and if I am lucky it saves one image. This is very frustrating, I loose a lot of time trying and affects my job.
    I would highly apreciate any help
    Kind Regards

  • Scheduling jobs through dbconsole

    Just trying to clear my concepts about automating jobs, my understanding is we can automate jobs through crontjobs (on unix) /taskscheduler (on windows)
    The other option is DBMS_SCHEDULER.
    any jobs like RMAN backups or sql scripts running should show up in below query(they are not running through Scheduled Tasks (its window box)
    but i see few jobs & RMAN backups running on one db but i can't see them in this query, what i am missing?
    SQL> SELECT owner, job_name, enabled FROM dba_scheduler_jobs;
    OWNER JOB_NAME ENABL
    SYS AUTO_SPACE_ADVISOR_JOB TRUE
    SYS GATHER_STATS_JOB FALSE
    SYS FGR$AUTOPURGE_JOB FALSE
    SYS PURGE_LOG TRUE
    ORACLE_OCM MGMT_STATS_CONFIG_JOB TRUE
    ORACLE_OCM MGMT_CONFIG_JOB TRUE
    6 rows selected.
    Edited by: DBA2011 on Jun 21, 2012 9:09 AM

    DBA2011 wrote:
    Just trying to clear my concepts about automating jobs, my understanding is we can automate jobs through crontjobs (on unix) /taskscheduler (on windows)
    The other option is DBMS_SCHEDULER.
    any jobs like RMAN backups or sql scripts running should show up in below query(they are not running through Scheduled Tasks (its window box)
    but i see few jobs & RMAN backups running on one db but i can't see them in this query, what i am missing?
    SQL> SELECT owner, job_name, enabled FROM dba_scheduler_jobs;
    OWNER JOB_NAME ENABL
    SYS AUTO_SPACE_ADVISOR_JOB TRUE
    SYS GATHER_STATS_JOB FALSE
    SYS FGR$AUTOPURGE_JOB FALSE
    SYS PURGE_LOG TRUE
    ORACLE_OCM MGMT_STATS_CONFIG_JOB TRUE
    ORACLE_OCM MGMT_CONFIG_JOB TRUE
    6 rows selected.
    Edited by: DBA2011 on Jun 21, 2012 9:09 AMdepends on how the job was scheduled. You should also check DBA_JOBS.
    And of course, there is no guarantee the job you expect to see actually exists in database B just becaue it existsin database A .....

Maybe you are looking for

  • Alerts for error in CC

    Dear All, I am currently working on a scenario in which I am getting error in the Receiver RFC adapter. I am able to monitor the error in Communication Channel Monitoring or in Message monitoring in RWB. I want to send the error to the administrator

  • Method Not Found Invoke Node error 1316 using Solid Works IEdm

    Hi Forum members, I have been having a problem with calling a function in a dll file.  I have attached the VI as example.  When I use the GetFile method I get a reference to that.  I then use the Invoke node and recieve a list of methods, the first o

  • Replace the ScrollBar of a ListView

    Hello, Can the internal ScrollBar of a ListView be replaced with an external ScrollBar ? I really mean to replace it, not updating its scroll value when changing the external ScrollBar. A further question is, if yes, can it be done for multiple ListV

  • HT1338 Is is safe to download Adobe Flash player. I am using OS X Lion 10.7.5. I have heard conflicting reports on it's reliability.

    Is it safe to download Adobe Flash Player? I am using OS X Lion 10.7.5. I have heard conflicting reports on it's reliabilty.

  • Flash Export Artifacts

    I'm creating a widescreen (581 x 151) video montage for my website (video has to fit in that size box). When I export via Adobe Media Encoder, I adjust frame width & height (in video settings) to match the project settings of 581 x 151. The rendered