Execute procedure from htp.form

Hi
How do i execute a procedure with the parameter value passed in from a form?? Please help.. thanks!
htp.formOpen(owa_util.get_owa_service_path||'procedure_name');
htp.formText('p_username', 10, 10);
htp.formSubmit;
htp.formClose;

The PL/SQL block above generates an HTML form. The HTML form is submitted from the browser to a URL, defined by the form's action. On the receiving end, you must have a PL/SQL procedure with the right name and parameter(s) that can process the request submitted by the form.
In your case, you must have a procedure, called "procedure_name", as specified in the formOpen call. It must take a parameter, called "p_username", as defined by your text input field (formText).
Hope this helps,
Peter

Similar Messages

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

  • Executing SQL From A Forms Procedure

    I am looking to execute a composed SQL command (ALTER USER ***** IDENTIFIED BY ****). The old execute immediate command in forms 5 would be the one I would have used, does any know the Forms 6i equivalent.
    Regards
    Stephen

    Hi John,
    What I was having a problem with is that the following code from a Forms 5 procedure isn't working with Forms 6i :
    Procedure dropSynonyms ()
    sql_stmt carchar2(2000);
    BEGIN
    sql_stmt := 'drop synonym RT_'| |rec.runtime_table_name;
    execute immediate sql_stmt;
    END;
    The method of executing the sql_stmt sees to have changed with Forms 6i but the help documentation isn't clear on the new syntax.
    Any help appreciated.
    Regards
    Stephen

  • Calling a procedure from Oracle Forms with OUT parameter

    HI,
    Can anyone tell me in detail how to call a procedure with OUT parameters from Oracle Forms 6i ?
    Thanks in advance.

    Hello,
    Just provide the out parameter in the call:
    Declare
      amount   number; -- OUT number argument populated by the procedure
    Begin
      -- call the X procedure --
      x( amount ) ;
    End;Francois

  • How to compile and execute procedure from hr to scott

    Hi all ,
    I am trying to compile and execute a stored procedure from hr user to scott user.
    first i gave grant command to hr.
    By using:- grant create any procedure to hr;
    After i compile a procedure from hr to scott.
    create or replace procedure scott.sp_hr
    is
    begin
    dbms_output.put_line('run by scott user');
    end;
    but it says :-
    ORA-01031: insufficient privileges
    01031. 00000 - "insufficient privileges"
    any one help me.

    it works for me
    20:29:29 SQL> 20:29:29 SQL> connect / as sysdba
    Connected.
    20:47:41 SQL> grant create any procedure to hr;
    Grant succeeded.
    20:48:01 SQL> connect hr/hr
    Connected.
    20:48:07 SQL> create or replace procedure scott.sp_hr
    is
    begin
    dbms_output.put_line('run by scott user');
    end;
    20:48:21   2  20:48:21   3  20:48:21   4  20:48:21   5  20:48:21   6 
    20:48:23   7  /
    Procedure created.
    20:48:25 SQL>

  • Trying to execute procedure from analoymous block

    Hi ,
    Iam trying to exeute the procedure from analymous block but I raising an exception
    Could you please help me on this scenario.
    Error report:
    ORA-01001: invalid cursor
    ORA-06512: at line 31
    01001. 00000 -  "invalid cursor"

    Hi,
    FMI
    <code>
       DECLARE
      pn_Result   NUMBER;
       pc_Cursor  SYS_REFCURSOR;
       SUBMIT_DATE DATE;
       REQUESTOR_NAME NVARCHAR2(200);
       approval_date DATE;
       APPROVER_NAME NVARCHAR2(200);
       REQUEST_TYPE_DESC NVARCHAR2(200);
       COMPANY_NAME NVARCHAR2(200);
        card_no NUMBER;
       card_user_name NVARCHAR2(200);
       company_embossed_name NVARCHAR2(200);
       auth_strat VARCHAR2(200);
       CARD_STATUS VARCHAR2(200);
       request_status VARCHAR2(200);
       BEGIN
       corporate.GET_CARD_REQUEST_SS
       (NULL,
       NULL,
       5,
       NULL,
       NULL,
       NULL,
       0,
       NULL,
       NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,pn_Result, pc_Cursor,NULL);
       FETCH pc_Cursor
       INTO
       REQUESTOR_NAME,
       approval_date,
       APPROVER_NAME,
       REQUEST_TYPE_DESC,
       COMPANY_NAME,
        card_no,
       card_user_name,
       company_embossed_name,
       auth_strat,
       CARD_STATUS,
       request_status;
       DBMS_OUTPUT.PUT_LINE( REQUESTOR_NAME);
       END;
    <code>
    My procedure is
    <code>
    create or replace
    PROCEDURE           GET_CARD_REQUEST_SS
       ps_Req_First_Name IN NVARCHAR2,
       ps_Req_Last_Name IN NVARCHAR2,
       pn_Request_Type IN NUMBER,
       pn_Request_Status IN NUMBER,
       pn_Ageing IN NUMBER,
       pn_Ageing_compare IN NUMBER,
       pn_Application_Id IN NUMBER,
       ps_Embossed_Name IN NVARCHAR2,
       ps_Structure_Point IN NVARCHAR2,
       ps_Date_From IN VARCHAR2,
       ps_Date_To IN VARCHAR2,
       ps_Approver_Name IN NVARCHAR2,
       ps_Processor_Name IN NVARCHAR2,
       pn_Company_Id IN NUMBER,
       pn_Requestor_Or_Approver IN PLS_INTEGER,
       pn_callingUserId IN CST.T_USER_ID,
       pn_Screen_output IN PLS_INTEGER,
       pn_Result   OUT NUMBER,
       pc_Cursor   OUT CST.CUR_TYPE
       ,pn_iso_code IN NUMBER DEFAULT 826)
    IS
       ls_Select varchar2(4000);
       ls_SelectFrom varchar2(4000);
       ls_Where varchar2(4000);
       ls_Order_By varchar2(4000);
       lb_Debug BOOLEAN := FALSE;
       ln_iso_code PLS_INTEGER ;
       C_CARD_REQUESTOR     CONSTANT PLS_INTEGER := 0;
       C_COMPANY_APPROVER   CONSTANT PLS_INTEGER := 1;
       C_BANK_APPROVER      CONSTANT PLS_INTEGER := 2;
    BEGIN
       --if lb_Debug then
          PLSQL_LOG('card_request_admin.get_card_request: ---- Start at'|| to_char(sysdate,'YYYY-MM-DD HH24:MI:SS')  );
          PLSQL_LOG('card_request_admin.get_card_request:scheme user '|| SYS_CONTEXT('USERENV', 'session_user') );
          PLSQL_LOG('card_request_admin.get_card_request:user '|| SYS_CONTEXT('Godot','user')  );
          PLSQL_LOG('card_request_admin.get_card_request:company '|| SYS_CONTEXT('Godot','company')  );
          PLSQL_LOG('card_request_admin.get_card_request:node '|| SYS_CONTEXT('Godot','node')  );
          PLSQL_LOG('card_request_admin.get_card_request:bank '|| SYS_CONTEXT('Godot','bank')  );
          PLSQL_LOG('card_request_admin.get_card_request:mgr '|| SYS_CONTEXT('Godot','mgr')  );
          PLSQL_LOG('card_request_admin.get_card_request:provider '|| SYS_CONTEXT('Godot','provider')  );
          PLSQL_LOG('card_request_admin.get_card_request:verif_code '|| SYS_CONTEXT('Godot','verif_code')  );
          PLSQL_LOG('card_request_admin.get_card_request:Restriction '|| SYS_CONTEXT('Godot','Restriction')  );
          PLSQL_LOG('card_request_admin.get_card_request:execute development.security_set_context.set_context('|| SYS_CONTEXT('Godot','user')||','|| SYS_CONTEXT('Godot','company')||','||SYS_CONTEXT('Godot','node')||','||SYS_CONTEXT('Godot','bank')||','||SYS_CONTEXT('Godot','mgr')||','||SYS_CONTEXT('Godot','provider')||','||SYS_CONTEXT('Godot','verif_code')||','||SYS_CONTEXT('Godot','Restriction')||');'  );
          PLSQL_LOG('card_request_admin.get_card_request:ps_Req_First_Name   = '||ps_Req_First_Name   );
          PLSQL_LOG('card_request_admin.get_card_request:ps_Req_Last_Name    = '||ps_Req_Last_Name    );
          PLSQL_LOG('card_request_admin.get_card_request:pn_Request_Type     = '||pn_Request_Type     );
          PLSQL_LOG('card_request_admin.get_card_request:pn_Request_Status   = '||pn_Request_Status   );
          PLSQL_LOG('card_request_admin.get_card_request:pn_Ageing           = '||pn_Ageing           );
          PLSQL_LOG('card_request_admin.get_card_request:pn_Ageing_compare   = '||pn_Ageing_compare   );
          PLSQL_LOG('card_request_admin.get_card_request:pn_Application_Id   = '||pn_Application_Id   );
          PLSQL_LOG('card_request_admin.get_card_request:ps_Embossed_Name    = '||ps_Embossed_Name    );
          PLSQL_LOG('card_request_admin.get_card_request:ps_Structure_Point  = '||ps_Structure_Point  );
          PLSQL_LOG('card_request_admin.get_card_request:ps_Date_From        = '||ps_Date_From        );
          PLSQL_LOG('card_request_admin.get_card_request:ps_Date_To          = '||ps_Date_To          );
          PLSQL_LOG('card_request_admin.get_card_request:ps_Approver_Name    = '||ps_Approver_Name    );
          PLSQL_LOG('card_request_admin.get_card_request:ps_Processor_Name   = '||ps_Processor_Name   );
          PLSQL_LOG('card_request_admin.get_card_request:pn_Company_Id       = '||pn_Company_Id       );
          PLSQL_LOG('card_request_admin.get_card_request:pn_Requestor_Or_Approver = '||pn_Requestor_Or_Approver);
          PLSQL_LOG('card_request_admin.get_card_request:pn_callingUserId = '||pn_callingUserId);
          PLSQL_LOG('card_request_admin.get_card_request:pn_Screen_output = '||pn_Screen_output);
       --end if;
    if pn_iso_code = 0 or pn_iso_code is NULL then
    ln_iso_code := 826 ;
    else
    ln_iso_code := pn_iso_code;
    end if;
       ls_Select := '
         select
              RM.SUBMIT_DATE
          ,DECODE(rm.requestor_super_user_id, NULL, NULL, ''Superuser on behalf of '') ||
              DECODE(RM.REQUESTOR_USER_ID, null, RD.FIRST_NAME || '' '' || RD.LAST_NAME, RU.FIRST_NAME || '' '' || RU.LAST_NAME ) as REQUESTOR_NAME
            ,DECODE(rm.request_status,
               '||cst.c_card_request_org_approve||', rm.company_approval_date,
               '||cst.c_card_request_bank_approve||', rm.bank_approval_date
               , NULL) as approval_date
            ,DECODE( RM.REQUEST_STATUS,
                :1, DECODE(rm.comp_apprvr_super_user_id, NULL, NULL, ''Superuser on behalf of '') ||CA.FIRST_NAME || '' '' || CA.LAST_NAME,
                :2, DECODE(rm.comp_apprvr_super_user_id, NULL, NULL, ''Superuser on behalf of '') ||CA.FIRST_NAME || '' '' || CA.LAST_NAME,
                :3, BA.FIRST_NAME || '' '' || BA.LAST_NAME,
                :4, BA.FIRST_NAME || '' '' || BA.LAST_NAME,
                null) as APPROVER_NAME
           ,nvl(L.TEXT_STRING, to_char(RM.REQUEST_TYPE))  as REQUEST_TYPE_DESC
            , decode(rm.bca_card_id,
                NULL,decode(rm.card_id, NULL,NULL ,(SELECT co_bca.name_desc FROM company co_bca,card bca WHERE bca.card_id = c.bca_card_id AND bca.company_id_external = co_bca.company_id )  ),
                (SELECT co_bca.name_desc FROM company co_bca,card bca WHERE rm.bca_card_id = bca.card_id AND bca.company_id_external = co_bca.company_id )
               )  as COMPANY_NAME
            ,SUBSTR(ENCRYPT_FD.decrypt_ext_company_id(co.external_company_id), 1, LENGTH(ENCRYPT_FD.decrypt_ext_company_id(co.external_company_id))-LENGTH(dp.data_provider))
            , DECODE(c.card_no,NULL,NULL,encrypt_fd.display_card_no(c.card_no)) AS card_no
            ,chu.first_name || '' '' || chu.last_name as card_user_name
            ,C.EMBOSSED_NAME || '' '' || C.EMBOSSED_LINE2 as company_embossed_name
            ,RD.HOME_ADDRESS_LINE_1, RD.HOME_ADDRESS_LINE_2, RD.HOME_ADDRESS_LINE_3, RD.HOME_ADDRESS_LINE_4 ||'' ''||RD.HOME_ADDRESS_LINE_5 as HOME_ADDRESS_LINE_4,
              RD.HOME_PHONE, RD.BUSINESS_PHONE ,RD.HOME_ADDRESS_COUNTRY
            ,decode (code.code,null,null,code.code||'' - ''|| code.description) as auth_strat
            ,RD.TOTAL_CREDIT_LIMIT
            ,code_card_status.description as CARD_STATUS
            ,rd.status_change_comment
            ,RM.CARD_REQUEST_ID
            ,decode (rm.request_status ,2,''For final approval'' ,3,''Approved'' ,4,''Rejected'' ,9,''Unsuccessful'' , -9, ''Reset failed'', to_char(RM.REQUEST_STATUS)) as request_status
            ,RM.REQUEST_TYPE
            ,rd.shipping_option
       IF pn_Screen_output = 1 THEN
        ls_Select := ls_Select || '
         ,TRUNC(SYSDATE, ''DD'') - TRUNC(RM.SUBMIT_DATE, ''DD'') as request_age
         , RM.UPDATE_TAG
         , c.card_id
         , rm.bca_card_id
         , rm.requestor_user_id
         , rm.request_status as request_status_int
         , decode(rm.bca_card_id, NULL,NULL, (SELECT ENCRYPT_FD.decrypt_ext_company_id(co_bca.external_company_id) FROM company co_bca,card bca WHERE rm.bca_card_id = bca.card_id AND bca.company_id_external = co_bca.company_id ) )  as external_company_id
       END IF;
       ls_SelectFrom := '
         FROM
          card_request_master rm
          ,card_request_data_view rd
          ,users ru
          ,users rsu
          ,users ca
          ,users ba
          ,company co
          ,provider dp
          ,product p
          ,card c
          ,request_type rt
          ,language_string l
          ,code
          ,users chu
          ,code code_card_status
       ls_Where := '
       WHERE RM.CARD_REQUEST_ID = RD.CARD_REQUEST_ID
          AND RM.REQUESTOR_USER_ID = RU.USER_ID(+)
          AND rm.requestor_super_user_id = rsu.user_id(+)
          AND RM.COMPANY_APPROVER_USER_ID = CA.USER_ID(+)
          AND RM.BANK_APPROVER_USER_ID = BA.USER_ID(+)
          AND RM.COMPANY_ID = CO.COMPANY_ID
          AND RM.CARD_ID = C.CARD_ID(+)
          AND C.PRODUCT_ID = P.PRODUCT_ID(+)
    -- predicate_PRODUCT trick for performance
            and p.product_id in ( select distinct product_id from card )
          AND P.DATA_PROVIDER = DP.DATA_PROVIDER(+)
          AND RM.REQUEST_TYPE = RT.REQUEST_TYPE
          AND RT.STRING_ID = L.STRING_ID
          AND l.iso_code = '||ln_iso_code||'
          AND rm.auth_strat_code_id = code.code_id(+)
          AND chu.user_id(+) = c.user_id
          AND code_card_status.code_id(+) = rm.card_state_code_id
      IF pn_callingUserId IS NOT NULL THEN
        ls_Where := ls_Where || ' AND C.USER_ID != '||pn_callingUserId||' ';
      END IF;
       CASE pn_Requestor_Or_Approver
       WHEN C_CARD_REQUESTOR   THEN ls_Where := ls_Where || ' and RM.Requestor_User_Id = :5 ';
       WHEN C_COMPANY_APPROVER THEN ls_Where := ls_Where || ' AND RM.REQUESTOR_USER_ID != SYS_CONTEXT(''Godot'', ''user'') ' ;
       WHEN C_BANK_APPROVER    THEN ls_Where := ls_Where || ' and RM.Bank_Approver_User_Id = :5 ';
       END CASE;
       if ps_Req_First_Name is not null then
          ls_Where := ls_Where || ' and ( UPPER(RD.FIRST_NAME) like ''' || common.fix_odd_quotes(ps_Req_First_Name) || ''' or UPPER(RU.FIRST_NAME) like ''' || common.fix_odd_quotes(ps_Req_First_Name) || ''') ';
       end if;
       if ps_Req_Last_Name is not null then
          ls_Where := ls_Where || ' and ( UPPER(RD.LAST_NAME) like ''' || common.fix_odd_quotes(ps_Req_Last_Name) || ''' or UPPER(RU.LAST_NAME) like ''' || common.fix_odd_quotes(ps_Req_Last_Name) || ''') ';
       end if;
       if pn_Request_Type is not null then
          ls_Where := ls_Where || ' and RM.REQUEST_TYPE = ' || pn_Request_Type || ' ';
       end if;
       if pn_Request_Status is not null then
          ls_Where := ls_Where || ' and RM.REQUEST_STATUS = ' || pn_Request_Status || ' ';
       end if;
       if pn_Ageing is not null then
          ls_Where := ls_Where || ' and TRUNC(SYSDATE, ''DD'') - TRUNC(RM.SUBMIT_DATE, ''DD'') ' ;
          CASE
            WHEN pn_Ageing_compare = 1 THEN  ls_Where := ls_Where || ' < ';
            WHEN pn_Ageing_compare = 2 THEN  ls_Where := ls_Where || ' > ';
            WHEN pn_Ageing_compare = 3 THEN  ls_Where := ls_Where || ' = ';
            ELSE   ls_Where := ls_Where || ' != ';
          END CASE;
          ls_Where := ls_Where || pn_Ageing || ' ';
       end if;
       if ps_Embossed_Name is not null then
          ls_Where := ls_Where || ' and ( UPPER(RD.EMBOSSED_LINE1) like ''' || common.fix_odd_quotes(ps_Embossed_Name) || ''' or UPPER(RD.EMBOSSED_LINE2) like ''' || common.fix_odd_quotes(ps_Embossed_Name) || ''') ';
       end if;
       if ps_Structure_Point is not null then
          ls_Where := ls_Where || ' and UPPER(S.DESCRIPTION) like ''' || common.fix_odd_quotes(ps_Structure_Point) || ''' ';
       end if;
       if ps_Date_From is not null then
          ls_Where := ls_Where || ' and RM.SUBMIT_DATE >= to_date(''' || common.fix_odd_quotes(ps_Date_From) || ''', ''DD/MM/YY'') ';
       end if;
       if ps_Date_To is not null then
          ls_Where := ls_Where || ' and RM.SUBMIT_DATE <= to_date(''' || common.fix_odd_quotes(ps_Date_To) || ''', ''DD/MM/YY'') ';
       end if;
       if ps_Approver_Name is not null then
          ls_Where := ls_Where || ' and  UPPER(DECODE( RM.REQUEST_STATUS, '|| CST.C_CARD_REQUEST_ORG_APPROVE ||', CA.FIRST_NAME || '' '' || CA.LAST_NAME, '||CST.C_CARD_REQUEST_BANK_WITHDRAW||', CA.FIRST_NAME || '' '' || CA.LAST_NAME, '||CST.C_CARD_REQUEST_BANK_APPROVE||', BA.FIRST_NAME || '' '' || BA.LAST_NAME, '||CST.C_CARD_REQUEST_AT_PROCESSOR||', BA.FIRST_NAME || '' '' || BA.LAST_NAME, null)) like ''' || common.fix_odd_quotes(ps_Approver_Name) || ''' ' ;
       end if;
       --if ps_Processor_Name is not null then
       --   ls_Where := ls_Where || ' and UPPER(DP.NAME) like ''' || ps_Processor_Name || ''' ';
       --end if;
       if pn_Company_Id is not null then
          ls_Where := ls_Where || ' and RM.COMPANY_ID = ' || pn_Company_Id || ' ';
       end if;
       if lb_Debug then
          PLSQL_LOG( 'select count(*) ' || ls_SelectFrom || ls_Where );
       end if;
       CASE pn_Requestor_Or_Approver
       WHEN C_CARD_REQUESTOR   THEN
            execute immediate 'select count(*) ' || ls_SelectFrom || ls_Where
            into pn_Result using SYS_CONTEXT('Godot','user');
       WHEN C_COMPANY_APPROVER THEN
            execute immediate 'select count(*) ' || ls_SelectFrom || ls_Where
            into pn_Result;
       WHEN C_BANK_APPROVER    THEN
            execute immediate 'select count(*) ' || ls_SelectFrom || ls_Where
            into pn_Result;
       END CASE;
       if lb_Debug then
          PLSQL_LOG( 'CORPORATE.CARD_REQUEST_ADMIN.GET_CARD_REQUEST count: ' || pn_Result );
       end if;
       if pn_Result > 0 then
          ls_Order_By := ' Order By RM.SUBMIT_DATE ';
          if lb_Debug then
             PLSQL_LOG( ls_Select || ls_SelectFrom || ls_Where || ls_Order_By );
          end if;
          CASE pn_Requestor_Or_Approver
          WHEN C_CARD_REQUESTOR   THEN
               open pc_Cursor for ls_Select || ls_SelectFrom || ls_Where || ls_Order_By
               using CST.C_CARD_REQUEST_ORG_APPROVE, CST.C_CARD_REQUEST_BANK_WITHDRAW,
               CST.C_CARD_REQUEST_BANK_APPROVE, CST.C_CARD_REQUEST_AT_PROCESSOR,SYS_CONTEXT('Godot','user');
          WHEN C_COMPANY_APPROVER THEN
               open pc_Cursor for ls_Select || ls_SelectFrom || ls_Where || ls_Order_By
               using CST.C_CARD_REQUEST_ORG_APPROVE, CST.C_CARD_REQUEST_BANK_WITHDRAW,
               CST.C_CARD_REQUEST_BANK_APPROVE, CST.C_CARD_REQUEST_AT_PROCESSOR;
          WHEN C_BANK_APPROVER    THEN
               open pc_Cursor for ls_Select || ls_SelectFrom || ls_Where || ls_Order_By
               using CST.C_CARD_REQUEST_ORG_APPROVE, CST.C_CARD_REQUEST_BANK_WITHDRAW,
               CST.C_CARD_REQUEST_BANK_APPROVE, CST.C_CARD_REQUEST_AT_PROCESSOR;
          END CASE;
       end if;
      for i in pc_Cursor
      loop
      dbms_output.put_line(i.REQUESTOR_NAME);
      end loop;
    EXCEPTION
       WHEN OTHERS THEN
          CORPORATE.COMMON.EXCEPTION_LOG( 'Procedure: CORPORATE.CARD_REQUEST_ADMIN.GET_CARD_REQUEST ', SQLCODE, SQLERRM, null, FALSE );
          pn_Result := SQLCODE;
    END GET_CARD_REQUEST_SS;
    <code>

  • Call an executable file from oracle forms 6i

    Hello ,
    i want to call a local .exe file from oracle forms 6i passing along a couple of parameters in the command line .
    Can anyone help me out here ?
    thanks
    C.
    Edited by: user539712 on Jan 21, 2011 11:55 AM
    Edited by: user539712 on Jan 21, 2011 11:55 AM

    that worked...now i am facing a different issue now which i didnt have without the start command . i am calling iexplorer.exe but i am passing a long a url in the command line . the 2nd parameter in the url is not working so when i do :
    "start c:\progra~1\intern~1\iexplore.exe" http://localhost/hello.jsp&a=ddd&b=333
    the &b=333 is not passed (some issue with the & character i am guessing). Would you know a workaround ?
    thanks

  • Execute Sql Server Procedure from Oracle Forms

    Hi,
    I have Forms6i and need to create a form that execute a procedure in a SQL Server Database. This procedure inserts records retrieves from our Oracle Database (i passed the fields as parameters of the SQL Server procedure).
    What did i need to do to achieve this task.-
    Thanks in advance.-

    See
    http://www.oracle.com/technology/products/forms/pdf/275201.pdf
    Also search the forum and you will find discussions on this topic.
    Message was edited by:
    Mark Roberts

  • Error while executing procedure from the web

    Hi,
    <p>
    I am developing some procedures that I want to execute from an html form. The problem is that when I am trying to execute it in SQL Developer I got the following error:<br>
    Connecting to the database oracle.<br>
    ORA-06502: PL/SQL: numeric or value error<br>
    ORA-06512: at "SYS.OWA_UTIL", line 325<br>
    ORA-06512: at "SYS.OWA_UTIL", line 366<br>
    ORA-06512: at "MMARTA.INSERTPROJECT", line 3<br>
    ORA-06512: at line 10<br>
    Process exited.<br>
    </p>
    <p>
    The procedure is the following:<br>
    create or replace <br>
    procedure insertproject(jnum j.j#%type, jname j.jname%type, city j.city%type) as <br>
    begin <br>
    owa_util.mime_header('text/plain');<br>
    if jpak.insertj(jnum,jname,city)<0 then<br>
    htp.print('The jnum already exists in the database!');<br>
    else <br>
    htp.print('Insert successfull!');<br>
    end if;<br>
    end;<br>
    <br>
    and the function has the following code:
    <br>
    function insertj(jnum j.j#%type, jname j.jname%type, city j.city%type)<br>
    return number is<br>
    x number;<br>
    begin<br>
    Select count(*) into x From J<br>
    Where J#=jnum;<br>
    if x=0 then<br>
    insert into J values(jnum,jname,city);<br>
    commit;<br>
    return 0;<br>
    end if;<br>
    return -1;<br>
    END insertj;<br>
    </p>
    <p>
    Does anyone have any idea why I get this error?
    </p>
    <p>
    Thanks!
    <p/>

    Hi,
    <p>
    The function has the following parameters:<br>
    function insertj(jnum j.j#%type, jname j.jname%type, city j.city%type)<br>
    where j# is varchar2(5), jname is varchar2(35) and city is varchar2(35)<br>.
    I was trying to insert the following values:<br>
    j#:='J11', jname:='JobName' and city:='Paris'.<br>
    </p>
    <p>
    The procedure just calls this function with the same parameters. It is very strange because it is hard to see what the problem is. The line 10 is return 0 in the function where I believe the error comes from. It starts in the procedure and then goes in the function body, if I am interpreting this right.
    </p>
    <p>
    Any idea?
    </p>
    Thanks!

  • Calling PLSQL Stored Procedure From HTML Form Submit Button

    Hi there,
    I am having a little difficulty with calling a stored procedure using an html form button. Here is the code I have right now...
    HTP.PRINT('<form action=ZWGKERCF.P_confdelete>');
    HTP.PRINT('<input type=''submit'' value='' Yes '' onClick=''document.getElementById("mypopup").style.display="none"''>');
    HTP.PRINT('</form></div>');Here is the issue - I need to find a way to pass variables to this stored procedure so it know what data to operate on. This stored procedure will delete data for a specific database record and I must pass three variables to this procedure to make it work.
    Lets call them class_number, term, conf These three variables will be passed and the data will be deleted and the person will see a confirmation screen once the delete query has been executed.
    So ideally I would want: ZWGKERCF.P_confdelete(class_number, term, conf) and then the stored procedure would handle the rest!
    Seems pretty simple but I am not sure how to make this happen... My thoughts were:
    Pass the data to this html form (the three fields I need) in hidden variables. Then somehow pass these using POST method to the procedure and read using GET?
    Can someone clarify what the best way to do this is? I have a feeling its something small I am missing - but I would really like some expert insight :-)
    Thanks so much in advance!
    - Jeff

    795018 wrote:
    I am having a little difficulty with calling a stored procedure using an html form button. Here is the code I have right now...
    HTP.PRINT('<form action=ZWGKERCF.P_confdelete>');
    HTP.PRINT('<input type=''submit'' value='' Yes '' onClick=''document.getElementById("mypopup").style.display="none"''>');
    HTP.PRINT('</form></div>');Here is the issue - I need to find a way to pass variables to this stored procedure so it know what data to operate on. This stored procedure will delete data for a specific database record and I must pass three variables to this procedure to make it work. The browser generates a POST or a GET for that form action, that includes all the fields defined in that form. Let's say you define HTML text input fields name and surname for the form. The URL generated for that form's submission will be:
    http://../ZWGKERCF.P_confdelete?name=value1&surname=value2The browser therefore submits the values of the form as part of the URL.
    The web server receives this. It sees that the base URL (aka location) is serviced by Oracle's mod_plsql. It passes the URL to this module. This module builds a PL/SQL block and makes the call to Oracle. If we ignore the additional calls it makes (setting up an OWA environment for that Oracle session), this is how the call to Oracle basically looks like:
    begin
      ZWGKERCF.P_confdelete( name=> :value1, surname =>  :value2 );
    end;Thus the PL/SQL web enabled procedure gets all the input fields from the HTML form, via its parameter signature. As you can define parameter values with defaults, you can support variable parameter calls. For example, let's say our procedure also have a birthDate parameter that is default null. The above call will still work (from a HTML form that does not have a date field). And so will the following URL and call that includes a birth date:
    URL:
    http://../ZWGKERCF.P_confdelete?name=value1&surname=value2&birthdate=2000/01/01
    PL/SQL call:
    begin
      ZWGKERCF.P_confdelete( name=> :value1, surname =>  :value2, birthdate => :value3 );
    end;There is also another call method you can use - the flexible 2 parameter interface. In this case the PL/SQL procedure name in the URL is suffixed with an exclamation mark. This instructs the mod_plsql module to put all input field names it received from the web browser into a string array. And put all the values for those fields in another string array. Then it calls your procedure with these arrays as input.
    Your procedure therefore has a fixed parameter signature. Two parameters only. Both are string arrays.
    The advantage of this method is that your procedure can dynamically deal with the web browser's input - any number of fields. The procedure's signature no longer needs to match the HTML form's signature.
    You can also defined RESTful mod_plsql calls to PL/SQL. In which case the call format from the web browser looks different and is handled differently by mod_plsql.
    All this (and more) is detailed in the Oracle manuals dealing with mod_plsql - have a search via http://tahiti.oracle.com (Oracle Documentation Portal) for the relevant manuals for the Oracle version you are using.
    Alternatively, simply download and install Oracle Apex (Application Express). This is a web development and run-time framework and do all the complexities for you - including web state management, optimistic locking, security and so on.

  • Passing parameter to stored procedure from windows form getting error

    I've written a procedure which shows the data in a table according to the table flag selected from the windows form. My code is:
    --- stored procedure ------
    CREATE PROC [dbo].[PROC_SELECT_TABLES]
    @TBL_FLAG INT
    AS
    BEGIN
    SET NOCOUNT ON;
    IF (@TBL_FLAG = 1)
    SELECT * FROM MHT_APPUSER ;
    IF (@TBL_FLAG = 2)
    SELECT * FROM MHT_ISA11 ;
    IF (@TBL_FLAG = 3)
    SELECT * FROM MHT_ISA22 ;
    SET NOCOUNT OFF;
    END
    GO
    Now, the module for calling the above procedure
    namespace DAL;
    public class DisplayData
    SqlLayer layer = new SqlLayer();
    public int tblFlag { get; set; }
    public DataTable GetData(int tblFlag)
    SqlParameter[] p = new SqlParameter[1];
    p[0] = new SqlParameter("@tblFlag", this.tblFlag);
    return layer.ExecuteDataSet("PROC_SELECT_TABLES", p).Tables[0];
    Now the SQL LAYER, containing the ExecuteDataSet and database connection code:
    namespace DAL;
    public class SqlLayer
    // sql connection code
    public DataSet ExecuteDataSet(string commandText, SqlParameter[] sqlParameter)
    SqlCommand cmd = new SqlCommand(commandText, this.conn);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.AddRange(sqlParameter);
    SqlDataAdapter sda = new SqlDataAdapter(cmd);
    DataSet ds = new DataSet();
    sda.Fill(ds);
    return ds;
    Now the windows form layer:
    using DAL;
    namespace BookKeepingSystem
    public partial class DisplayDataForm : Form
    DisplayData view = new DisplayData();
    private void GetData()
    view.tblFlag = 3;
    DataTable dt = view.GetData(view.tblFlag);
    dgvDisplayData.DataSource = dt;
    public DisplayDataForm()
    InitializeComponent();
    private void DisplayData_Load(object sender, EventArgs e)
    GetData();
    private void btnExit_Click(object sender, EventArgs e)
    Application.Exit();
    When I run the code I got the error:
    "Unhandled exception has occurred in your application...
    Procedure or function 'PROC_SELECT_TABLES' expects parameter @TBL_FLAG, which was not supplied"
    I can not figure what is missing with my code. Please can any one point out please.
    Thank You!!!

    Try something like this for starting -- do just this procedure to see if it works first.
    private DataTable GetDataTable(SqlConnection conn1)
    SqlDataAdapter daS1 = new SqlDataAdapter();
    daS1.SelectCommand = new SqlCommand();
    daS1.SelectCommand.Connection = conn1;
    if (conn1.State == ConnectionState.Closed) conn1.Open();
    daS1.SelectCommand.CommandType = CommandType.StoredProcedure;
    daS1.SelectCommand.CommandText = "yourStoredProcedureName";
    daS1.SelectCommand.Parameters.Add("@ParamName", SqlDbType.Int, 4);
    DataSet DS1 = new DataSet();
    daS1.Fill(DS1, "tbl1");
    return DS1.Tables["tbl1"];
    Note:  in the CommandText part place the name of your stored procedure.  In the Parameter part put the name of your parameter exactly as it is in the actual stored procedure.  Also, (if you have not done this already) make sure your stored
    procedure runs OK -- first -- test out your stored procedure in Sql Server Management Studio.  If the procedure runs OK in SSMS, then try it from you app.  Just create a simple form with one button .  Place GetDataTable() code under
    the button and call it something like this:
    private void button1_Click(object sender, EventArgs e)
    int i = GetDataTbl().Rows.Count;
    Console.WriteLine("i is {0}", i);
    Rich P

  • PLS-00306,problem while executing procedure from oracle e_comerce

    Hi
    I have writen a procedure in oracle.Tere i have a parameter with type varchar2.
    While i registered it in e_comerce i choosed the value set as 15characters.
    When i am runing the program from my ecomerce application it gives an error as below:
    ORACLE error 6550 in FDPSTP
    Cause: FDPSTP failed due to ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'PO_OUTPUT'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    there is no error when i am executing my procedure in toad/sql+ but this error comes only in e_comerce application.
    PLease tell what is the reason and what can be the solution?

    Hi,
    <p>
    The function has the following parameters:<br>
    function insertj(jnum j.j#%type, jname j.jname%type, city j.city%type)<br>
    where j# is varchar2(5), jname is varchar2(35) and city is varchar2(35)<br>.
    I was trying to insert the following values:<br>
    j#:='J11', jname:='JobName' and city:='Paris'.<br>
    </p>
    <p>
    The procedure just calls this function with the same parameters. It is very strange because it is hard to see what the problem is. The line 10 is return 0 in the function where I believe the error comes from. It starts in the procedure and then goes in the function body, if I am interpreting this right.
    </p>
    <p>
    Any idea?
    </p>
    Thanks!

  • Permisssion for executing procedure from different schema

    Hi ,
    I am executing following procedure in different package and, I am getting error. Following procedure and error:
    Procedrue:
    DECLARE
    l_tbl_timecard_info APPS.HXC_self_service_time_deposit.timecard_info;
    l_tbl_attributes_info APPS.HXC_self_service_time_deposit.app_attributes_info;
    l_tbl_messages APPS.HXC_self_service_time_deposit.message_table;
    l_new_timecard_id NUMBER;
    l_new_timecard_ovn NUMBER;
    l_time_building_block_id APPS.HXC_time_building_blocks.time_building_block_id%TYPE;
    begin
    --FND_GLOBAL.APPS_INITIALIZE( user_id => 12345,resp_id => 56789,resp_appl_id => 809 );
    APPS.HXC_timestore_deposit.create_time_entry ( p_measure=> 7, p_day => APPS.fnd_date.canonical_to_date ('2002/09/02'), p_resource_id=> 9389, -- Identifies a person on our DB, REPLACE WITH YOUR IDs
    p_app_blocks=> l_tbl_timecard_info, p_app_attributes=> l_tbl_attributes_info, p_time_building_block_id=> l_time_building_block_id);
    end;
    Error:
    Error starting at line 1 in command:
    DECLARE
    l_tbl_timecard_info APPS.HXC_self_service_time_deposit.timecard_info;
    l_tbl_attributes_info APPS.HXC_self_service_time_deposit.app_attributes_info;
    l_tbl_messages APPS.HXC_self_service_time_deposit.message_table;
    l_new_timecard_id NUMBER;
    l_new_timecard_ovn NUMBER;
    l_time_building_block_id APPS.HXC_time_building_blocks.time_building_block_id%TYPE;
    begin
    --FND_GLOBAL.APPS_INITIALIZE( user_id => 12345,resp_id => 56789,resp_appl_id => 809 );
    APPS.HXC_timestore_deposit.create_time_entry ( p_measure=> 7, p_day => APPS.fnd_date.canonical_to_date ('2002/09/02'), p_resource_id=> 9389, -- Identifies a person on our DB, REPLACE WITH YOUR IDs
    p_app_blocks=> l_tbl_timecard_info, p_app_attributes=> l_tbl_attributes_info, p_time_building_block_id=> l_time_building_block_id);
    end;
    Error report:
    ORA-00942: table or view does not exist
    ORA-06512: at "APPS.HXC_TIMESTORE_DEPOSIT_UTIL", line 1519
    ORA-06512: at "APPS.HXC_TIMESTORE_DEPOSIT_UTIL", line 1599
    ORA-06512: at "APPS.HXC_TIMESTORE_DEPOSIT", line 1233
    ORA-06512: at "APPS.HXC_TIMESTORE_DEPOSIT", line 1327
    ORA-06512: at line 10
    00942. 00000 - "table or view does not exist"
    *Cause:   
    *Action:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    The schema on which you are running this procedure do not have the access to the tables that you are referring in this procedure.

  • PL/SQL: Executing a procedure from within another procedure

    Hello, I'm a newbie and I need help on how to execute procedures from within another procedure. The procedure that I call from within the procedure have return values that I want to check.
    I tried: EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    but I get the error message:
    PLS-00103: Encountered the symbol "USER_GET_FORUM_INFO" when expecting one of the following::= . ( @ % ; immediate
    The symbol ":=" was substituted for "USER_GET_FORUM_INFO" to continue.
    And when I tried: EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    I get the error message:
    PLS-00222: no function with name 'USER_GET_FORUM_INFO' exists in this scope
    PL/SQL: Statement ignored
    The procedure USER_GET_FORUM_INFO exists. (don't understand why it says "no FUNCTION with name", it's a procedure I'm executing)
    I'm stuck so thanks for any help...
    Below is all the code. I'm using Oracle 9i on RedHat Linux 7.3.
    ================================================================================
    CREATE OR REPLACE PROCEDURE user_forum_requestsaccess (
    p_forumid IN NUMBER,
    p_requestmessage IN VARCHAR2
    AS
    var_forumid NUMBER;
    var_forum_exists NUMBER;
    var_forum_access NUMBER;
    request_exists NUMBER;
    var_forumname VARCHAR2(30);
    FORUM_DOESNT_EXIST EXCEPTION;
    FORUM_USER_HAS_ACCESS EXCEPTION;
    FORUM_REQUEST_EXIST EXCEPTION;
    BEGIN
    SELECT SIGN(NVL((SELECT request_id FROM forum.vw_all_forum_requests WHERE forum_id = p_forumid AND db_user = user),0)) INTO request_exists FROM DUAL;
    EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    IF var_forum_exists = 0 THEN
    RAISE FORUM_DOESNT_EXIST;
    ELSIF var_forum_access = 1 THEN
    RAISE FORUM_USER_HAS_ACCESS;
    ELSIF request_exists = 1 THEN
    RAISE FORUM_REQUEST_EXIST;
    ELSE
    INSERT INTO tbl_forum_requests VALUES (SEQ_TBL_FORUM_REQ_REQ_ID.NEXTVAL, SYSDATE, p_requestmessage, p_forumid, user);
    INSERT INTO tbl_forum_eventlog VALUES (SEQ_TBL_FORUM_EVNTLOG_EVNT_ID.NEXTVAL,SYSDATE,1,'User ' || user || ' requested access to forum ' || var_forumname || '.', p_forumid,user);
    COMMIT;
    END IF;
    EXCEPTION
    WHEN
    FORUM_DOESNT_EXIST
    THEN RAISE_APPLICATION_ERROR(-20003,'Forum doesnt exist.');
    WHEN
    FORUM_USER_HAS_ACCESS
    THEN RAISE_APPLICATION_ERROR(-20004,'User already have access to this forum.');
    WHEN
    FORUM_REQUEST_EXIST
    THEN RAISE_APPLICATION_ERROR(-20005,'A request to this forum already exist.');
    END;
    GRANT EXECUTE ON user_forum_requestsaccess TO forum_user;
    ================================================================================
    Regards Goran

    you don't have to use execute when you want to execute a procedure (only on sql*plus, you would use it)
    just give the name of the funtion
    create or replace procedure test
    as
    begin
        dbms_output.put_line('this is the procedure test');
    end test;
    create or replace procedure call_test
    as
    begin
        dbms_output.put_line('this is the procedure call_test going to execute the procedure test');
        test;
    end call_test;
    begin
        dbms_output.put_line('this is an anonymous block calling the procedure call_test');
        call_test;
    end;
    /

  • How to execute another schema procedure from toad?

    Hi,
    i want to execute procedure from another schema from toad. already i have created synonym for that procedure and provided execute permission.
    how to execute procedure from toad?
    Thanks,

    Hi,
    The vendor of that product is running their own forums
    http://toadfororacle.com/index.jspa
    Not sure how they feel about
    Handle:      user2017273
    Status Level:      Newbie
    Registered:      Oct 4, 2009
    Total Posts:      64
    Total Questions:      44 *(36 unresolved)*

Maybe you are looking for

  • How to import Mail rules from Lion to Mavericks?

    I tried importing my several dozen rules from OS X 10.7.5 to Mavericks 10.9.4. I tried the method described by SECollins7 here: Import Lion Mail rules into Mavericks Mail? It did not work. Nor does manually copying the text from «MessageRules.plist»

  • Bulk Insert CSV file in Oracle 9i

    Greetings all, Is there a similar way in Oracle to the Bulk Insert Command in SQL Server to bulk load a csv file in Oracle? Something else then the External Table and the SQL*Loader. Sincerely Dan

  • Getting error in SAP Authentication configuration for BO Edge 3.1 SP3

    Hi, I have installed BusinessObject Edge Series 3.1 SP3 and BusinessObject XI 3.1 SAP SP3 on Windows 2008 server. I am trying to configure SAP Authentication between BO and BI server. In CMC i have provided all the details under Entitlement System an

  • Getting fuego.web.exception.WapiInstancesException

    Using Oracle BPM 10.3 MP2, WL Version Build # 100486 There are 2 participants userA and userB with same roles, but with only change as - userA has Category set to 5 and userB has Category set to 9 An instance instanceX is assigned to userA, In worksp

  • Logic while reporting

    Dear Experts, Data in multi-provider is: u2018Schemeu2019 u2018Valid from Dateu2019 u2018valid to dateu2019 u2018S1u2019             u201801.June.09u2019     u201831.Dec.09u2019 In report requirement user will enter a date range and based on validity