Creating procedures in forms

I ahve to create 4 proceduers and call them in WHEN BUTTON PRESSED trigger.
How can i create procedures at form level.
I can create them in the database by sqlplus but then the procedures would be server specific.

I can create them in the database by sqlplus but then
the procedures would be server specific.Why would that be a problem ?

Similar Messages

  • How to create a dynamic form with bind variables :schema & :table_name

    My application has two LOV's, one to select a schema, and the next to select a table within that schema. I then have a button which passes me to a report which displays the data in that table.schema.
    I now want to create a link to a form where I can edit the record based on the rowid of that table.schema, but it doesn't appear that I can create a dynamic form where I pass the schema.table_name and rowid. Is this possible? Can anyone advise how I can do this? The form builder only wants a fixed schema/table name.
    Thanks in advance.
    Stuart.

    Hi Stuart,
    In this sort of situation, you will need to be a bit creative.
    I would suggest a pipeline function called as if it was a report.
    Then you can pipe out the required fields.
    Since you will have a variable number of fields, you could use two of the multi row field names for your field names and values.
    Then after submit, you can create your own procedure to loop through the fields (stored for you in the Apex package) and update the table as required.
    Not very specific I'm afraid, but it should work.
    Regards
    Michael

  • Batch procedure in Forms 10g, calling rdf and send by mail

    Hi all,
    I need your advice regarding my task: i have a table with invoices of some clients. I have created a report in Oracle Reports 10g R2, so to have a pdf with all the data from this table.
    I have created a form in Forms 10g R2, displaying in a screen one field, where the user can choose the date of invoice. Then i will query by that date all my invoices in that table, and then i want to create a procedure in Forms, so that for every line in that table with the invoice date just chosen i will run HOST(rwrun ... all my parameters).
    My questions:
    1. I need to read some more about how to create a custom xml so to pass to my rwrun, and depending on the records fetched in my cursors in Forms 10g, i will pass a xml variable to my reports, so i will get the data from Forms 10g in the report created in Oracle Reports 10g. Is there any way that i can grep the errors? I need to create some insertions based on succes on failure, how can i accomplish this?
    2. Is the above described scenario way to complicated to loop throuh a cursor, create a pdf, and mail the pdf until the cursor is totally fetched? Do you recommend me a simpler way to accomplish this task?
    Thank you so much,
    Michael.

    Hello,
    I have a report with all my clients, with their email addresses in the same report. Each client as unique account number or invoice number.
    So i want to burst and distribute each invoice to the corresponding client:
    1. I have set REPEAT ON: INVOICE in oracle reports.
    2. From Oracle Reports, i click on Distribution list, and in the DESNAME i type email_address (which is the column from the table with the invoices).
    3. Then, File >> Distribute. Says: distribution completed succesfully, but nothing happens.
    Question:
    1. Where am i mistaking?
    2. Is there any log activity file that i could see what the application is doing, step by step?
    Thank you,
    Michael

  • 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

  • How to out Dynamic ref cursor from Procedure to Forms

    Hi
    I am trying to out Dynamic ref cursor from Procedure to Forms, But I am unable to do so. however cursor return the value within procedure but I am failed to capture the same in Forms
    Pl advice suggestion if any, Here I am attaching full procedure for reference
    CREATE PACKAGE winepkg
    IS
    TYPE wine IS RECORD ( mynumber number);
    /* Define the REF CURSOR type. */
    TYPE wine_type IS REF CURSOR RETURN wine;
    END winepkg;
    CREATE procedure find_wine
    (col1_in in number,
    c1 out winepkg.wine_type) as
    vsql varchar2(1000);
    cur sys_refcursor;
    x number;
    BEGIN
    vsql:='select bo_id from bo_details where bo_details.bo_id = '||col1_in ;
    open cur for vsql;
    c1:=cur;
    --fetch c1 into x;
    --dbms_output.put_line(x);
    END find_wine;
    In front end forms
    Declare
    TYPE F is REF CURSOR;
    CUR_F F;
    rec number;
    Begin
    break;
    find_wine( 1601480000011078,cur_f ) ;
    Loop
    fetch cur_f into rec ;
    Message(rec ) ;pause;
    exit when cur_f%notfound ;
    End loop ;
    exception
    when others then
    Message(sqlerrm) ;pause;
    End ;

    yo can use
    declare
    c_cursor EXEC_SQL.CursType;
    v_stmt varchar2(2000) = 'select a, b, c from mytab where cond1'; -- you can create this value dynamically
    begin
    c_cursor := Exec_SQL.Open_cursor;
    EXEC_SQL.PARSE(c_articulos, v_stmt);
    EXEC_SQL.DEFINE_COLUMN(c_articulos,1, v_colchar1, 30);
    EXEC_SQL.DEFINE_COLUMN(c_articulos,2, v_colchar2, 15);
    EXEC_SQL.DEFINE_COLUMN(c_articulos,3, v_colchar3, 30);
    v_exec := EXEC_SQL.EXECUTE(c_cursor);
    WHILE EXEC_SQL.FETCH_ROWS(c_cursor) > 0 LOOP
    EXEC_SQL.COLUMN_VALUE(c_cursor,1,v_colchar1);
    EXEC_SQL.COLUMN_VALUE(c_c_cursor,2,v_colchar2);
    EXEC_SQL.COLUMN_VALUE(c_c_cursor,3,v_colchar3);
    assign_values_to_block;
    END LOOP;
    EXEC_SQL.CLOSE_CURSOR(c_cursor);
    end;
    and WORKS IN FORMS 6

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

  • 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

  • Error Handling on procedure based forms

    Hi all,
    I have seen examples of error handling on table based forms like
    the following:
    begin
    doInsert;
    exception
    when others then
    --redirect to some error page
    I have tried the same with a procedure based form by wrapping
    the doSubmit procedure, but when the procedure returns an
    exception, it doesn't execute my exception handling code.
    Any ideas on why this is happening or at least how I can catch
    these exceptions with my own exception handler?
    Thanks,
    Curt

    Chetan, Antonio,
    I opened a TAR on this issue with Oravle and they got the same
    results. Thay suggested a work around of creating an error table
    that gets written to and then dispaly and new page to retrieve
    the error from the table.
    What I ended up doing is creating a dummy procedure that does
    nothing (NULL). The form based on the dummy procedure allows me
    to get the values I need from the user.
    The procedure always returns succesful since it doesn't do
    anything. So in the form success code area I call the real
    procedure, check the return value, and now I can redirect back
    to the orignal form on error, or direct to another paqe on
    success.
    Not the most elegant solution, but it is working for now.
    Curt

  • Can i get result of procedure in Forms

    i create procedure to get multiple records
    of employee its working in pl/sql plus
    can i get same result in oracle forms
    null

    CREATE PROCEDURE drop_table (table_name IN VARCHAR2) AS
    BEGIN
    EXECUTE IMMEDIATE 'DROP TABLE ' | | table_name;
    END;
    null

  • How Create procedure or function with ADO ?

    Hello,
    How Create procedure or function with ADO?It's my question.
    Thanks.
    Henri

    This message if post by Taiwan-ChangHaw-Oracle-Stored-Procedure-For-Business-Rule-Club
    public bool ConnectDatabase()
    try
    { string strConnectionString =
    "Provider=OraOLEDB.Oracle" +";"+
         "Data Source=" + ConnectionParams.Datasource +";"+
    "User Id =" + ConnectionParams.Username +";"+
    "Password =" + ConnectionParams.Password;
         m_conn=new ADODB.Connection();
         m_conn.ConnectionString=strConnectionString;
         m_conn.Open("","","",0); //i_"YYAOl Open the connection
    catch(Exception e)
    {     System.Windows.Forms.MessageBox.Show(e.Message);
         return false;
    return true; //YYAOl_B>3I9&connected successfully
    public void InsertDescription(string p_product,string p_language,string p_tname,string p_tdescription)
    { string sql="{Call inserttranslateddescription(?,?,?,?,?)}";
    try
    { ADODB._Command cmd=new ADODB.Command();//Create a command object
    cmd.ActiveConnection=m_conn; //Set its active connection to open connection
    ADODB.Properties properties=cmd.Properties;//Get the command properties into ADODB Properties object
    IEnumerator ienum=properties.GetEnumerator();//Get an enumerator on above properties
    ADODB.Property singleprop;
    while(ienum.MoveNext()) //iterate through the enumerator
         {singleprop=(ADODB.Property)ienum.Current;//Get the current property from enumerator
         string propname= singleprop.Name; //Get the name of current property
         if(propname.Equals("NDatatype")) //if the property is 'NDatatype' set its value to true
         singleprop.Value=true;
    cmd.CommandType=ADODB.CommandTypeEnum.adCmdText;
    int pid=Int32.Parse(p_product);
    ADODB._Parameter langid     =cmd.CreateParameter("langid",          ADODB.DataTypeEnum.adChar,ADODB.ParameterDirectionEnum.adParamInput, 100,p_language);
    ADODB._Parameter productid =cmd.CreateParameter("productid",     ADODB.DataTypeEnum.adNumeric,ADODB.ParameterDirectionEnum.adParamInput, 100,pid);
    ADODB._Parameter tname =cmd.CreateParameter("tname",          ADODB.DataTypeEnum.adBSTR,ADODB.ParameterDirectionEnum.adParamInput, 50,p_tname);
    ADODB._Parameter tdescription=cmd.CreateParameter("tdescription",ADODB.DataTypeEnum.adBSTR,ADODB.ParameterDirectionEnum.adParamInput, 50,p_tdescription);
    ADODB._Parameter check          =cmd.CreateParameter("check",          ADODB.DataTypeEnum.adNumeric,ADODB.ParameterDirectionEnum.adParamOutput,100,0);
    cmd.Parameters.Append(langid);
    cmd.Parameters.Append(productid);
    cmd.Parameters.Append(tname);
    cmd.Parameters.Append(tdescription);
    cmd.Parameters.Append(check);
    cmd.CommandText=sql;
    //Execute the command to insert product details in database
    object recs;
    object param=p_language;
    cmd.Execute(out recs,ref param,1);
    ienum.Reset();
    while(ienum.MoveNext()) //iterate through enumerator
    { singleprop=(ADODB.Property)ienum.Current;//Get the current property in to Property object
    string propname= singleprop.Name; //Get the name of current property
    if(propname.Equals("NDatatype")) //if it is 'NDatatype' set its value to true
    singleprop.Value=false;
    IEnumerator iprop=cmd.Parameters.GetEnumerator();//Get the enumerator for command parameters
    while(iprop.MoveNext()) //loop through enumerator
    { //Get the current parameter in enumerator
    ADODB._Parameter checkval=(ADODB._Parameter)iprop.Current;
    if(checkval.Name.Equals("check")) //if the parameter is 'check'
    if(checkval.Value.ToString().Equals("0")) //If check's value is zero data was inserted
    System.Windows.Forms.MessageBox.Show("Product details Inserted successfully");
    else
    System.Windows.Forms.MessageBox.Show("Product Details Updated");//else data was updated
    catch(Exception e)
    System.Windows.Forms.MessageBox.Show(e.Message);//Display any error message
    }

  • Cant create procedure over OracleCommand. any HELP?

    Hi eweryone. This is my firs post here and i am new in oracle. I have a problem with .NET oracle commands. I want to create procedures or a package in run time. here is my simple c# code :
    OracleConnection con = new OracleConnection();
    Source=DBTEST_METUSSERVER";
    con.ConnectionString = "User Id=SYSTEM;Password=orcl;" + "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=metusserver)" + "(PORT=1521))(CONNECT_DATA=(SID=dbtest)));"; con.Open();
    string sqlstr = "CREATE PROCEDURE SA.ACTIONDELETEALL2 IS \r\n";
    sqlstr += "BEGIN \r\n";
    sqlstr += "DELETE FROM ACTION_HISTORY; \r\n";
    sqlstr += "END ACTIONDELETEALL2; \r\n/\r\n";
    OracleCommand cmd = new OracleCommand(sqlstr, con);
    cmd.ExecuteNonQuery();
    this code works and stores my procedure with errors as INVALID.
    the error is this :
    //Line # = 1 Column # = 33 Error Text = PLS-00103:
    Encountered the symbol "" when //expecting one of the following:
    // begin function package pragma procedure subtype type use // <an identifier> form // current cursor external language
    Also when I execute this code with sql plus it stores my procedure successfully and VALID.
    Any ideas?

    Also when I execute this code with sql plus it stores my procedure successfully and VALID.remove the use of \r and \n and also the last slash character that you are adding at the end. That is needed by the SQL*Plus to tell it to send the entire above string to the database. You do not need it when doing it via your program.

  • When creating my own form... is there a way to to link multiple drop down fields  to other drop down fields?

    when creating my own form... is there a way to to link multiple drop down fields  to other drop down fields?

    And in what program? You need to be more specific. Creating conditional forms is of course possible, but the procedures will depend on the actual program and target medium. HTML forms work differently from PDF...
    Mylenium

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

  • Procedure Based Forms( a little !)

    Freinds!
    I have mada a form based on a package:
    ======================================
    Create or Replace Package vchrpro AS
    TYPE glrec is RECORD (company_code varchar2(4),
    voucher_type varchar2(4),
    voucher_seq varchar2(6),
    user_code varchar2(8)
    TYPE glcur is REF CURSOR RETURN glrec;
    PROCEDURE glquery(resultset IN OUT glcur,
    v_company_code in varchar2, v_voucher_type in varchar2);
    END vchrpro;
    show errors;
    Create or Replace Package Body vchrpro AS
    PROCEDURE glquery(resultset IN OUT glcur,
    v_company_code in varchar2, v_voucher_type in varchar2) IS
    BEGIN
    OPEN resultset FOR
    SELECT a.company_code, a.voucher_type, a.voucher_seq, a.user_code
    FROM gl_voucher a,gl_voucher_type b
    WHERE a.company_code=b.company_code and
    a.voucher_type=b.voucher_type and
    a.user_code=b.user_code and
    a.company_code=v_company_code and
    a.voucher_type=v_voucher_type
    ORDER BY a.voucher_type;
    CLOSE resultset;
    END glquery;
    END vchrpro;
    show errors
    ========================================
    the package is succesfully created and also
    the form.But the prob. is that i am not sure
    about the "Query Data Source Arguments" of
    a form's block property. i.e what i will
    give "Type Name" and "Value" to my procedure's parameter "resultset" (i have given nothing)AND when i run the form and
    execute the query error says:
    FRM-40505 Oracle error: unable to perform
    query.
    Kindly help me it is very important & urgent!
    also let me know if i have conveyed properly.
    Many thaks!
    null

    Take a look at
    "Forms and Reports Feature/Benefit Demos"
    that you can also get from: http://technet.oracle.com/sample_code/products/forms/content.html
    There is a sample of a procedure based form there.

  • Does any one know how to Create MDI data form frame

    Has any one created MDI data form frame in JDev. Please tell me step-by-step procedure to create a MDI data form frame.
    Or any way to remove/add some menu item in BC4J default browser.
    Thanks
    null

    Hi jaya,
    What do you mean by creating URL for a word document?
    You can display all the files in ABAP by giving the location(u mean URL!).
    call function 'CALL_BROWSER'
            exporting
              url = 'http://www.sap.com'.
    or
    call function 'CALL_BROWSER'
            exporting
              url = 'c:/test.doc'.
    Rgds,
    Jothi.P
    *Reward pts if useful.

Maybe you are looking for

  • Using itunes library on 2 computers.

    I have about 15Gb of music in itunes and I put it on an external hard drive I will use the external hard drive with my desk top pc, I want to load playlists from the hard drive to itunes on my laptop pc so I don't have to lug the hard drive around wi

  • Movie bundle one at a time?

    If I buy a movie bundle, will I be able to load one movie at a time to my iPad to save memory? I plan to load one movie at a time on my iPad when I need it to save memory space at all times.

  • S-VIDEO black & white signal from VHS to PC using TV@where Plus. PLZ PLZ HELP.

    I have had TV@where plus now for a few months after having many many sound related problem recording from VHS to PC using TV@where master. Didn't know about this forum so after many months of AGONY i purchased TV@where plus hoping this would resolve

  • Cashflow statement with out activating cash management

    Dear Friends, With out activating CASH MANAGEMENT how to get cash flow statement, please suggest me how to define and get cash flow statement with some example and transaction codes. In my project there is no cash management active. My client is aski

  • Add integrated graphics to a laptop only with Intel graphics

    hi i have hp 4530s with Product Number: xu015ut#aba. Can I add a graphics card to my laptop(ati or nvidia)? This question was solved. View Solution.