Call procedure from form which displays HTML

I have a form based on a table with three columns. When I press the insert button, I want to insert the data into the table and then pass the data to a procedure (wihtin a package), which will call an external java procedure and get a passcode returned to it. I then need to display the passcode to the user's screen (which I am currently attempting to do via htp/htf calls within a procedure in the package).
I tried to put the call to the package in a trigger. It succeeded in calling the external procedure, but did not display anything to the browser afterwords.
I then tried to put the call to the PL/SQL code on my Insert button. I have tried various flavors of this call, but here is the current version:
declare
v_user_key_id lcams_db.user_token_link.user_key_id%TYPE;
v_tkn_ser_no lcams_db.user_token_link.tkn_ser_no%TYPE;
v_actv_ind lcams_db.user_token_link.utl_actv_ind%TYPE;
blk varchar2(10):='DEFAULT';
begin
v_user_key_id:=p_session.get_value_as_number(
p_block_name=>blk, p_attribute_name=>'A_USER_KEY_ID');
v_tkn_ser_no:=p_session.get_value_as_varchar2(
p_block_name=>blk, p_attribute_name=>'A_TKN_SER_NO');
v_actv_ind:=p_session.get_value_as_varchar2(
p_block_name=>blk, p_attribute_name=>'A_UTL_ACTV_IND');
lcams_db.otp.set_otp_user_key_id(v_user_key_id);
lcams_db.otp.set_otp_tkn_ser_no(v_tkn_ser_no);
lcams_db.otp.set_otp_actv_ind(v_actv_ind);
doInsert;--- This is the default handler
lcams_db.otp.otp_utl('INSERTING');
end;
otp is the package. I have three variables in my package otp_user_key_id, otp_tkn_ser_no, and otp_actv_ind which I pull from session storage and put into the package variables. the otp_utl sets a variable and calls otp_add_user, which gets more data from the table and calls the pl/sql wrapper for the java routine to actually add the user into the external OTP database. The java routine returns the status and initial passcode and then I call a routine internal to the package to display the results to the user via htp and htf calls.
The best result was getting the table to update and the external database to update, but I never got the resulting html to diplay. With the current code, the browser goes away with a message of Connecting to... and nothing gets updated and my browser eventually comes back with a 'No data...' message.
Is there a way to do what I want? Ideally I would like to call the package, display the results, and provide a back link so the user can get back to the original form after the user has read the passcode message.
null

Okay. I put the following code in the 'On successful submission of the form...'
section of the form and I tinkered with it until it works; however, it currently assumes
the Insert button was the button clicked.
declare
v_user_key_id lcams_db.user_token_link.user_key_id%TYPE;
v_tkn_ser_no lcams_db.user_token_link.tkn_ser_no%TYPE;
v_actv_ind lcams_db.user_token_link.utl_actv_ind%TYPE;
blk varchar2(10):='DEFAULT';
my_url VARCHAR2(200);
return_url VARCHAR2(200);
begin
v_user_key_id:=p_session.get_value_as_number(
p_block_name=>blk, p_attribute_name=>'A_USER_KEY_ID');
v_tkn_ser_no:=p_session.get_value_as_varchar2(
p_block_name=>blk, p_attribute_name=>'A_TKN_SER_NO');
v_actv_ind:=p_session.get_value_as_varchar2(
p_block_name=>blk, p_attribute_name=>'A_UTL_ACTV_IND');
my_url := 'lcams_db.otp.otp_utl?' | |
'p_user_key_id=' | | TO_CHAR(v_user_key_id) | |
'&p_tkn_ser_no=' | | v_tkn_ser_no | |
'&p_actv_ind=' | | v_actv_ind;
call(my_url,return_url);
end;
How do I determine which button was clicked for the 'On successful submission...' section so I can call the correct routine?
null

Similar Messages

  • Problem with IN OUT parameters whiloe calling procedure from Form 6i

    Hi
    Could some help please? I have the following scenario.
    I am calling a stored procedure from form 6i by pressing a button on the form. Procedure has two IN OUT parameters, and I am passing these two IN OUT parameters and have declared them the way they are declared passed to the procedure. But I get an error when calling that procedure with these IN OUT parameters. the procedure works fine if parameters are IN only. The error says:
    PLS:00363: Expression '1' cannot be used as an assigment target.
    NO matter I pass some value or leave it blank, I get the same error message persistenetly.
    Please help.
    Thanks

    make sure you are calling your procedure with variables as parameters,
    i.e.
          l_v1 := 1 ;
          l_v2 := 'hello world' ;
          your_proc(l_v1, l_v2)
    not
          your_proc(1,'hello world')

  • Error when calling procedure from form personalization

    Hi every body
    I want to call a procudre using form personalization . I made the procedure and in form personalization i call it as follow:
    built in type : Execute a Procedure
    Argument :
    ='GAZ_EMP_ASSIGN_UPDATE(' || :ASSGT.ORGANIZATION_ID || ', ' || :ASSGT.ASSIGNMENT_ID || ', ' || FND_PROFILE.VALUE('USER_ID') || ', ' || FND_PROFILE.VALUE('DB_SESSION_ID') ||' )'
    but the following error raised when i click on Apply Now button :
    the string (='GAZ_EMP_ASSIGN_UPDATE(' || :ASSGT.ORGANIZATION_ID || ', ' || :ASSGT.ASSIGNMENT_ID || ', ' || FND_PROFILE.VALUE('USER_ID') || ', ' || FND_PROFILE.VALUE('DB_SESSION_ID') ||' )' )
    couldn't be evaluated because of error ORA-06550 :line 1 , column 43
    PLS-00103:encountered the symbol ")" while expecting one of the folowing (- + ...... etc
    can anyone have a solution to this problem because it made me mad .(urgent)
    Or if anyone have another way to call the procedure ??
    Note that i want to pass db_session_id to the procedure from the application so does anyone have a complian about the way of passing this parameter to the procedure ??

    See http://oracle.ittoolbox.com/groups/technical-functional/oracle-apps-l/forms-personalization-execute-a-procedure-1778674

  • Calling Stored procedure from Forms 6i

    Dear all,
    I have a stored procedure having INand INOUT parameters. I need to call it from Forms 6i triggers. Will you please tell me the syntax for calling stored procedure and stored function from Forms 6i and report 6i.
    Saibaldas
    [email protected]

    Just the same as for a local procedure, the only restrictions concern package public variables which are not visible from client side PL/SQL, and you probly want to keep the interfaces simple as client side PL/SQL (e.g. the Forms and Reports engines) don't support the same range of datatypes that the database does.

  • Call Stored Procedure from Forms 6i -- Urgent Plz...

    Dear All,
    I am first writing a stored procedure as:-
    CREATE OR REPLACE FUNCTION
    good_hire
    (birthdate_in IN DATE,
    reqsal_in IN NUMBER)
    RETURN BOOLEAN
    IS
    too_young BOOLEAN :=
    ADD_MONTHS
    (SYSDATE, -216) >
    birthdate_in;
    too_expensive BOOLEAN :=
    reqsal_in > fin.dept_bal;
    BEGIN
    RETURN NOT (too_young
    OR too_expensive);
    END;
    Now in my forms also i have the same function,which i defined in in my program unit i.e., with the same name good_hire,but with different parameters.
    If I want to call this stored procedure(good_hire)in my form
    I am writing this code in the pre-Insert trigger.
    IF good_hire
    (:newemp.birthdate,
    :newemp.proposed_sal)
    THEN
    SELECT empseq.NEXTVAL
    INTO :newemp.empno
    FROM dual;
    ELSE
    RAISE FORM_TRIGGER_FAILURE;
    END IF;
    Notice that i am sending bind variables from my form to the
    stored procedure. Now my question :
    1) Can i pass bind variables to the stored procedures from
    forms or is there any other way i can access the
    stored roceures from forms(Expecting a detailed answer) and
    from which triggers can I access the stored procedures(like pre-
    Insert here)?
    2) If at all I have the same parameters in my program unit
    function and with the same name good_hire, I know that the code
    in the pre-Insert trigger will call only the function in my
    program unit and not the stored procedure, but if I like to
    call my stored procedure instead of the local function good_hire
    then what should I do?
    2)As I said before if i have different parameters, for the
    stored procedure good_hire and local function good_hire and If
    I call good_hire from my pre-insert trigger .. Is it that the
    Forms will decide and call the Local function or stored
    procedure depending on the parameter list?
    I hope all my points are very clear.
    I am expecting the best and detailed answer for my
    Queries, I also hope these Quests will clear the doubts of many
    members in our esteemed group.
    Thnx in Advance...
    Regards
    siree....

    Dear Siree,
    Oh!! how many Questions? Each how much big??
    Ok First of all the answer to your first question.
    You can use the Stored procedures in the same way as the Forms procedures. You can pass bind variables to the stored procedures as well. You can also use the stored procedures in any triggers, I think there are no restrictions for that. The only thing is you should be connected to database while compiling the trigger where you are calling the stored procedure.
    Answer to your second question.
    You cannot direct Forms (I don't know about version 10g), untill 9i, you cannot tell forms to take the stored procedure and leave the local procedure. It will always take the local procedure, once a procedure is called. If not found locally then only it will go for the Stored procedures.
    For your third question.
    As I told you b4 forms searches for the procedure being called locally first, if locally present, does not go to the stored procedure. If declared by different paramaters in the stored procedure and it is called, then it will throw error (as it first searches for the name locally and if found will take up the one present locally and since that procedure is with different parameter, will throw up error). It is after all a stupid machine and can't think like us.
    Regards,
    Senthil .A. Perumal

  • How to call Pl/sql procedure from form ?

    Hi all,
    I need to call a procedure from form after the user has pressed the button to invoke the sql procedure, can anyone please advise me on how to do it ?
    Thanks.
    Lim

    Hi,
    Thanks for your reply.
    yes, I have include in when-button-pressed trigger as
    AIC_PROC_AR_CCID_UPD;
    Below is my procedure :-
    CREATE OR REPLACE PROCEDURE AIC_PROC_AR_CCID_UPD(errbuf out Varchar2,
              retcode out Number ) is
    VAR_BUF VARCHAR2(240);
    Cursor C1 is
    SELECT CONCATENATED_SEGMENTS ACCT,
    SEGMENT5 SEG5
    FROM AIC_GL_COA AGC
    WHERE AGC.CODE_COMBINATION_ID IS NULL;
    Rec1 C1%RowType;
    BEGIN
    FOR Rec1 IN C1 LOOP
         BEGIN
         UPDATE AIC_GL_COA A SET ( DESCRIPTION, CODE_COMBINATION_ID, SEGMENT5 )=
         ( SELECT FFVT.DESCRIPTION, GLA.CODE_COMBINATION_ID, GLA.SEGMENT5
         FROM GL_CODE_COMBINATIONS_KFV GLA,
         FND_FLEX_VALUES_TL FFVT,
         FND_FLEX_VALUES FFV
         WHERE GLA.CONCATENATED_SEGMENTS = REC1.ACCT
         AND FFV.FLEX_VALUE = REC1.SEG5
         AND FFV.FLEX_VALUE_ID = FFVT.FLEX_VALUE_ID
         AND FFV.FLEX_VALUE_SET_ID = 1002673 )
         WHERE A.SEGMENT5 = REC1.SEG5 ;
         EXCEPTION
         WHEN NO_DATA_FOUND THEN
         FND_FILE.PUT_LINE(FND_FILE.OUTPUT, 'NO RECORD UPDATE !!');     
         END;
    END LOOP;
    COMMIT;
    RETURN;
    END;
    However, when I try to compile it, error prompt :-
    Error 306 at line 1, column 1
    wrong number or types of arguments in call to 'AIC_PROC_AR_CCID_UPD'
    Error 0 at line 1, column 1
    statement ignored.
    By the way, my form 6i is running at client site and connection to procedure in unix server. Will this is ok ?
    Thanks
    Rgds
    Lim

  • Calling report from form. Need PDF output

    I am calling a report from a form using RUN_PRODUCT. I need to display the form in PDF format. When the user clicks the button in the form to run the report, acrobat reader should open up and the report displayed there. Please help.
    Thanks

    Thanks for the response. The first part worked. I am able to get the output in PDF format. In the 2nd part where I want to open acrobat and display the output, I am having some trouble with the code. When I compile, it says
    win_api_environment.read_registry must be declared. Is there some package I need to attach?
    Also, in the After reports trigger, how do I pass vFile (I am assuming this is the PDF file name)?
    Thanks
    The first thing you'll want to do is pass parameters to the report IE DESTYPE, DESNAME and DESFORMAT where these could be FILE, 'c:\temp\report' and PDF.
    Then, you can try this piece of code I wrote (with some help from other people at Metalink and here) sometime back. Now, I call it from forms, but in your case, you'd have to run it in the after report trigger. Since with RUN_PRODUCT you don't know when the report is finished, if you did it from the form, it wouldn't work correctly.
    PROCEDURE OPEN_PDF(vFile IN VARCHAR2)
    IS
    vcServerApp varchar2(40);
    vcServerTag varchar2(600);
    vcCommand varchar2(2000);
    iArgPos pls_integer;
    dummy NUMBER;
    BEGIN
    -- 1 get the Server App for .PDF files
    vcServerApp := win_api_environment.read_registry('HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\.PDF','',true);
    -- 2 get the executable
    vcServerTag := 'HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\'||
    vcServerApp||'\SHELL\OPEN\COMMAND';
    vcCommand:= win_api_environment.read_registry(vcServerTag,'',true);
    -- 3 Sort out how to specify the Filename
    iArgPos:= instr(vcCommand,'%1');
    if iArgPos = 0 then --no substitution Var on the command line
    vcCommand := vcCommand||' '||vFile;
    else
    vcCommand := substr(vcCommand,1,(iArgPos-1))||
    vFile||substr(vcCommand,(iArgPos+2));
    end if;
    -- 4 Run using Winexec (or Host if preferred).
    win_api_shell.winexec(vcCommand);
    EXCEPTION
    when no_data_found then
    abortt('Acrobat Reader was not found! Please consult with your help desk to install it and try again.','N');
    END;
    Chad
    I am calling a report from a form using RUN_PRODUCT. I need to display the form in PDF format. When the user clicks the button in the form to run the report, acrobat reader should open up and the report displayed there. Please help.
    Thanks

  • Calling Report From Form To Many Destinations

    Hi
    I am calling reports from forms using SET_REPORT_OBJECT_PROPERTY and then run_report_object.
    I dont know the destination until runtime of the report which is ok as I can pass this in via my procedure, but if that destination is many ie mail and file what is the best way to distribute the report?
    I could call my procedure for each destination but that seems a bit unefficient since the report would be created many times, is there another way?

    what about adding a drop-down-list near your report-button where you can choose the destination?
    when you click the report-button you simply read the value selected in the drop-down-list and send it to your reports-server too.

  • REP 110 & REP 0110 .calling reports from Form 10g(10.1.2.0.2)

    Hi All,
    We are migrating form from Oracle form 6i to Oracle 10g(10.1.2.0.2). I am calling reports from forms
    using Web.Show_Docment(). When we run reports in report builder 10g it works fine.
    But when we try to run reports from Forms 10g it throws error which is given below.
    We want to run reports from UNIX. After using this url to submit report we get error REP 110 and REP 0110
    URL
    http://GEM:7777/reports/rwservlet?server=rep_server&report=/u01/forms/QA_Forms10g/GEMREP.rdf+DESTYPE=CACHE+DESFORMAT=HTML+p_user_id=XYZ+p_client=2
    ERROR
    REP-110: File '/u01/forms/QA_Forms10g/GEMREP.rdf DESTYPE=CACHE DESFORMAT=HTML p_user_id=XYZ p_client=2' not found.
    REP-0110: Unable to open file '/u01/forms/QA_Forms10g/GEMREP.rdf DESTYPE=CACHE DESFORMAT=HTML p_user_id=XYZ p_client=2'.
    I will really appreciate your help.
    Thanks
    Sandy

    Hello,
    You are mixing 2 separators in the URL : & and +
    Use only one separator in the URL :
    Example :
    http://GEM:7777/reports/rwservlet?server=rep_server+report=/u01/forms/QA_Forms10g/GEMREP.rdf+DESTYPE=CACHE+DESFORMAT=HTML+p_user_id=XYZ+p_client=2
    Regards

  • Calling Report from Form Error ORA-06508

    Dear all,
    I want migrate from Fom6i to Oracle Developer Suite 10g (10.1).
    Folder Form = C:\APLIORA\IRS\FORM
    Folder Report = C:\APLIORA\IRS\REPORT
    I have modified file DEFAULT.ENV
    FORMS_PATH=C:\APLIORA\IRS\FORM;C:\APLIORA\IRS\REPORT
    i do not have problem call a form from form.
    but when i call report from form show error ORA-06508 : PL/SQL : could not find program unit being called ; -6508
    my procedure is
    PROCEDURE Call_Report IS
         list_id ParamList;
    BEGIN
    list_id := Get_Parameter_List('input_params');
    IF NOT Id_Null(list_id) THEN
    Destroy_Parameter_List(list_id);
    END IF;
    list_id := Create_Parameter_List('input_params');
    Add_Parameter(list_id,'MAXIMIZE',TEXT_PARAMETER,'YES');
    Add_Parameter(list_id,'ORACLE_SHUTDOWN',TEXT_PARAMETER,'YES');
    RP2RRO.RP2RRO_RUN_PRODUCT(REPORTS,'TESTREPORT.REP',SYNCHRONOUS,RUNTIME,FILESYSTEM,list_id,null);
    END ;
    Do I miss something ?
    Can any one help ?
    Thanks

    Hi,
    Thank you for your replay.
    The problem have solved.
    This my step :
    1. Install Windows XP SP2 and Form 10.1.2.0.2 on new pc.
    2. Install Jinit version 1.3.1.28.
    3. Create report server
    3. Compile form, report and pll
    4. call report from from with this procedure :
    PROCEDURE Call_Report (vFILENAME varchar2) IS
    report_id                Report_Object;
    ReportServerJob VARCHAR2(100);
    vc_rep_status      VARCHAR2(100);
    repsvr                          varchar2(21) := 'myserv';
    userid                         VARCHAR2(100);
    pass                          VARCHAR2(100);
    Host                    VARCHAR2(100);
    BEGIN
    userid          := Get_Application_Property(USERNAME) ;
    pass          := Get_Application_Property(PASSWORD) ;
    Host          := Get_Application_Property(CONNECT_STRING) ;
    report_id:= find_report_object('REPORT');
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_FILENAME,vFILENAME||'.jsp');
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER,repsvr);
    ReportServerJob:=run_report_object(report_id);
    vc_rep_status := REPORT_OBJECT_STATUS(ReportServerJob);
    WHILE vc_rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED', null)
    LOOP
    vc_rep_status:=REPORT_OBJECT_STATUS(ReportServerJob);
    END LOOP;
    IF vc_rep_status='FINISHED' THEN
    WEB.SHOW_DOCUMENT('/reports/rwservlet?report='||vFILENAME||'.jsp'||'&userid='||userid||'/'||pass||'@'||Host||'&destype=CACHE&desformat=PDF&paramform=yes','_blank');
    ELSE
    message ('Report failed with error message '|| vc_rep_status);
    END IF;
    END;
    Ok, but i have another strange error. I will post new thread.
    Thank you and regards
    Teguh S

  • Execute procedure from forms

    Dear all,
    i want to execute a procedure from forms. my code is below for calling procedure, this code is working fine from the SQLPLUS, but not working from forms.
    forms_ddl('execute audit_sessions('||''''||'et20'||''''||',sysdate,'||''''||'HELP'||''''||')');my procedure is below
    CREATE OR REPLACE PROCEDURE audit_sessions(uname varchar2,logon_date date,APP_USER VARCHAR2) is
    begin
    insert into admin.session_audit values(uname,logon_date,APP_USER);
    commit;
    end;my table is below
    SQL> desc session_audit
    Name                    Null?    Type
    ACTIVE_DIRECTORY_USER            VARCHAR2(30)
    LOGON_TIME              NOT NULL DATE
    APPLICATION_USER        NOT NULL VARCHAR2(30)kindly help. i am using oracle 10g database and forms version 9.0.4.0.19
    Regards.
    Edited by: Maahjoor on 09-Feb-2013 19:34
    Edited by: Maahjoor on 09-Feb-2013 19:35
    Edited by: Maahjoor on 09-Feb-2013 20:18

    Wa Alaikum Salam,
    Dear Ahmad Rafiq,
    it is compiled without error, so i think it should work, but now currently the forms is opened by some user,
    as soon as i am able to delete the old one and paste the current one, i will update you and will mark the answer correct accordingly.
    thank you so much dear.

  • Calling JSP from Forms and going back from JSP to Forms

    Hi,
    We are calling JSP from Forms 6i using show_document
    I'd like to go back to tha calling Form from the JSP.
    How can I construct the URL that would lead me back to the same Form and Forms session where the JSP was called from?
    Thanks,
    Arpad

    Thanks Shay,
    works for me too...
    Now:
    when I use the "Back" button of my IE to go back from JSP to the Forms session, it works for Jinitiator 1.1.8.19, but if I use Jinitiator 1.3 I got hung...
    Any ideas how could I make it work from Jinit 1.3?
    Thanks again/
    Regards,
    Arpad

  • Execute store procedure from form

    How do I execute a store procedure from FORM
    I have a store procedure in the database
    all it does insert a value to table test.
    in 'WHEN-NEW-INSTANT-TRIGGER' of the form MODLUE I put
    test_curor; (name of the store procedure)
    The module does have block or any thing it.
    There was no syntax errors or form error
    but it did not insert into the table.
    Why????

    I just tested this myself and you are right. If you have one block with no items in it the when-new-form-instance trigger will not be fired. I got a message back saying 'block had no items', though it ran OK. This kinda makes logical sense, since there is nothing for the form to do. I put a button onto the block and the procedure fired no problem. I must admit I have never tried creating a form with no items in it so I haven't seen this behaviour before.
    Shucks you live and learn every day!

  • Is possible to call procedure from vorowimpl class

    Hi,
    please tell me how to call procedure from vorowimpl class.
    Thanks in advance,
    SAN

    Hi cruz,
    Thanks for your reply.
    I checked that link and they given for controller.
    But i want to call that from the vorowimpl class. but i tried similar like calling in the controller.
    here my code, please correct it if it is mistake.
    public AssessmentsAMImpl xxam;
    public String getXXCompName() {
    //return (String) getAttributeInternal(XXCOMPNAME);
    OADBTransaction txn=(OADBTransaction)xxam.getDBTransaction();
    String compName=getCompName();
    String xxName="";
    CallableStatement cs=txn.createCallableStatement("DECLARE OUTPARAM VARCHAR2(100);begin apps.XX_COMP_ELEMENTSVO_PROC(:1,:2);end;",0);
    try{
    cs.setString(1,compName);
    cs.registerOutParameter(2,OracleTypes.VARCHAR,0);
    cs.execute();
    xxName=cs.getString(1);
    catch(Exception e){
    try{
    cs.close();
    catch(Exception e){
    return xxName;
    }

  • Calling server side procedures from forms

    Hi
    I am trying to add a server side procedure to a form. The procedure is held in a package which resides on a remote database and I have set-up database links to this database.
    When I run the form, calling the procedure, the oracle forms runtime session closes without displaying any error messages.
    I have successfully called the procedure from database triggers in different databases.
    Does anyone know whats going on?
    I am using forms 5.0 with a oracle 7.3 database
    Thanks!!
    null

    Check out the method:
    LibraryObject.invokeServerMethod(String, Serializable)
    I think this may be exactly what you're looking for.

Maybe you are looking for