How to execute a statement in forms procedure like SQL EXECUTE IMMEDIATE

Hi to all,
In a form I have created this procedure:
PROCEDURE insert_rows (
tbName IN VARCHAR2,
list_of_fields IN VARCHAR2,
origin_table IN VARCHAR2,
wCondition IN VARCHAR2 DEFAULT NULL)
IS
where_clause VARCHAR2 (2000) := ' WHERE ' || wCondition ;
table_to_fill VARCHAR2 (30);
BEGIN
-- Exist the table ?
SELECT OBJECT_NAME INTO table_to_fill FROM USER_OBJECTS
WHERE OBJECT_NAME = UPPER(origin_table) AND OBJECT_TYPE = 'TABLE' ;
IF wCondition IS NULL THEN
where_clause := NULL;
END IF ;
EXECUTE IMMEDIATE 'INSERT INTO ' || table_to_fill || ' SELECT ' || list_of_fields || ' FROM ' || origin_table || where_clause ;
EXCEPTION
WHEN NO_DATA_FOUND THEN
-- Here the Alert
END;
But, when I compile this error is displayed:
Function not supported from client side application corresponding to SQL statement EXECUTE IMMEDIATE
How can to correct this script for my form ?
I hope in Your help.
Best Regards
Gaetano

You have two options:
1)To create this procedure in database
2)Yo use the forms built-in FORMS_DDL instead of execute immediate , altering the one provided
Sim

Similar Messages

  • Is it possible to override built-in forms procedures like call_form?

    hi, is it possible to override built-in forms procedures like call_form? i want to override an existing built-in procedure so i don't need to change all my .fmbs. thanks in advice

    Hi,
    You cannot override them. However, you can create a procedure within the package with the name call_form and use it as package_name.call_form instead of call_form (use the search and replace functionality to replace the call_form with package_name.call_form).
    -Arun

  • Does Oracle have Extended Stored Procedure like SQL Server and Sybase?

    Hi, i am new to Oracle. I want to know if...
    Does Oracle have Extended Stored Procedure like SQL Server and Sybase?
    If it does not have, then how can i call outside program written in C or JAVA from the Database stored procedure or trigger?

    refer to this link on external procedures
    http://download-west.oracle.com/docs/cd/A87860_01/doc/server.817/a76956/manproc.htm#11064

  • How to execute commit statement in a procedure optionally?

    We have a procedure which has DML operations and at the end there is a commit statement.
    I want to execute commit statement optionally.
    Like, when procedure runs directly it must execute commit statement, but when this procedure is called from a trigger don't run commit.
    As you know commit operation is not allowed in triggers.
    How can I understant the code is triggered from a trigger or any other (manuel exec or from another procedure).
    I am looking for the reserved word that solve my problem. Like INSERTING, DELETING ....
    Serkan
    Thanks.

    Hi oraserkan,
    You do of course know it's dangerous to have a commit inside a procedure?
    Consider this:
    SQL> create table t (text varchar2(25))
    Table created.
    SQL> create or replace procedure p
    as
    begin
       insert into t(text)
           values ('Insert PROCEDURE');
       commit;
    end p;
    Procedure created.
    SQL> insert into t(text)
        values ('Insert SQL')
    1 row created.
    SQL> exec p
    PL/SQL procedure successfully completed.
    SQL> rollback
    Rollback complete.
    SQL> select * from t
    TEXT                    
    Insert SQL              
    Insert PROCEDURE        
    2 rows selected.You should instead clearly state the procedure has a commit by making it autonomous, and then have two procedures, one that commits, and one that don't
    SQL> drop procedure p
    Procedure dropped.
    SQL> drop table t purge
    Table dropped.
    SQL> create table t (text varchar2(25))
    Table created.
    SQL> create or replace procedure p_transactional
    as
    begin
       insert into t(text)
           values ('Insert PROCEDURE');
    end p_transactional;
    Procedure created.
    SQL> create or replace procedure p_autonomous
    as
       pragma autonomous_transaction;
    begin
       p_transactional;
       commit;
    end p_autonomous;
    Procedure created.
    SQL> insert into t(text)
        values ('Insert SQL')
    1 row created.
    SQL> exec p_autonomous
    PL/SQL procedure successfully completed.
    SQL> rollback
    Rollback complete.
    SQL> select * from t
    TEXT                    
    Insert PROCEDURE        
    1 row selected.
    SQL> drop procedure p_transactional
    Procedure dropped.
    SQL> drop procedure p_autonomous
    Procedure dropped.
    SQL> drop table t purge
    Table dropped.Regards
    Peter

  • How to update session state from form field values without submitting page?

    Hi,
    I am new to Oracle APEX. I am using Oracle Apex 4.2 on Oracle 11g release 2. The problem is that when I am entering data on a form, when I enter a value in one field and move to the next field, how can I use the value of first field in the validation procedure of next field? I know that when we enter data in fields, the session state is not updated with these values until we submit the page... right... but I have seen that if there is a control of List box type, then Apex gives an option "Action When List changes" where we can choose option to update corresponding session state field with the value of list box item, without submitting the page.
    Now my questions is why this option is only available for List box items? why not for other item types like Text box, Check box,... ? can someone please help me with this?
    (the issue with update of session state depending on page submitting, is that we need a complete network round trip from client to server in order for it. However if we can update session state variables without submitting page, then we can avoid this network traffic).
    Any help will be greatly appreciated. Thanks in advance.

    Create a dynamic action on change and run a PL/SQL process there with the following code:
    BEGIN
       NULL;
    END;Page items to submit > your item.
    This will set the session state without submitting the form.
    Further examples here:
    http://apex.oracle.com/pls/apex/f?p=31517:229
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • How to use Update Statement in ODI Procedure

    Hi,
    How can I use an update statement inside an ODI procedure.
    Thanks

    Hi,
    You do not need the BEGIN and END. ODI procedures are free text, so you can simply write your update statement, as you would in toad/sql developer etc etc. Just make sure you set the Technology and the logical schema. It is how ever best practice to also use the API:
    <%=odiRef.getSchemaName("YOUR_LOGICAL_SCHEMA_NAME", "D")%>. to prefix tables. This way, you select data from different schema's in the same instance (as long a your user has the correct privs).
    Cheers
    Bos
    Edited by: Bos on Jun 22, 2011 3:09 PM

  • How to write if statement for knowing that user is executing in background.

    Hai Experts.
    I am having a report , in that i want two types of output say when i execute in foreground it should say " Hello it is foreground".
    when i execute it in background as a job it should display " Hello it is back ground".
    please tell me how to code this in the report.
    if forground.
    write : hello it is foreground.
    else if it is background.
    write : it is back ground.
    please tell me the code in ABAP

    if sy-batch = space
       write : 'hello it is foreground'.
    elseif sy-batch = 'X'.
       write : 'it is back ground'.
    endif.
    Regards,
    Rich Heilman

  • How to upload files from a form using pl/sql ?

    Hi
    Is it possible to upload the physical files outside the database (under UNIX server)using pl/sql? I already know how to store the files inside the database(wwwdoc_documents$) but I didn't find any documentation about storing the physical files outside the database.
    I have in my form the following component:
    <input type="file" name="upload">
    and I want to let the user browse for the file on his/her disc that he want to use. What I want to do next is to save a copy of that file on our file-server, and then use it in my application. How do I do that in pl/sql?
    Any help will be appreciated.
    Sebas.

    Thanks for the suggestion. I like this approach as Java is more familiar to me than other languages.
    Our DBA is out of touch today, so I could not grant the javauserpriv to my database user. I tried to run the script anyway in the chance that my user had the privs, and it seemed to have hung. I am now combing Oracle's site for more documentation so I can write some tests to see if I can get a basic Java object working. Under what heading would I find this?
    ajt

  • How to call javascript function when form load[like onload="fun()" in html]

    I have to call javascript function at the time of iview is loading. I am not able use onload event which is not working in SAP Portal environment. Please suggest me any other alternative to call the function at the time of iview is loading. I have to set some properties when form is loading.

    I will explain my scenario correctly
    Let us take two pages
    1. Main Page (A)
    2. Child page (B)
           I have displayed records in tableview and each having checkbox and two buttons "print" and "viewDetails"  at down in page A. If I clicked "print" button the records which i have selected checkboxes details will be displayed in new window( page B). In page B i have given this following code
      <script language="javascript">
          window.opener.setTarget('Search');
      </script>
    setTarget() function is in page A.
    function setTarget(opt) {
      if(opt=='print')
         opt="";     
         document.<%=strFormControl%>.target="_blank";
       else
            document.<%=strFormControl%>.target="_self";
    This code is executing after the content of all records details displayed.
    My condition is If i click print button new window is opened and details are displaying. And before displaying content in new page B (means after opened new window) if i click on "viewDetails" button that is also opening new window because <script> code is not executed not yet. but it should display in same window when i click "viewDetails" button.

  • How to handle weird characters in form fields (like bullet points from Word docs)

    hi there
    lots of my users copy and paste from MS Word documents into a
    text area
    my app takes that form.textarea data and inserts it in a
    MYSQL db.
    when we output that cell from the db, we often find there are
    ? [question marks] where there once were special characters in the
    Word doc text.
    it seems that bullet points in word docs are the worst
    offenders.
    each time i spot a new one i try to find out the chr() number
    for it and make a substitiution before the text is stored in the
    db, but its a bit hit and miss (relies on me spotting it) and its v
    time consuming
    ive tried using functions safetext and demoronize - but they
    dont seem to do what i need
    im sure im not the first person to run into this - any
    suggestions anyone?
    thanks very much indeed for any help you can give.
    kind regards
    Nick

    Thanks Paul and Azadi
    Paul - when you say "change it to unicode" do you mean the
    page or a setting in the db? forgive me if i'm being stupid but
    this is all new territory to me. Thank you ever so much for your
    help - does sound logical what you say :)
    Azadi - thanks very much for this (I'm pressuming that
    there's a charge for this udf) so i'll try to implement Paul's
    solution and if I can't do that I'll buy the the udf - thanks very
    much indeed for your help, really is much apprecaited.
    kind regards
    Nick

  • Stored procedure by using EXECUTE at the sender JDBC

    We have Scenario from JDBC to RFC (ASYNCH).We are using Oracle DB,at the database side we have a stored Procedure and inside the Procedure we are accessing multiple table.
    My query is how can we excecute update sql statement a stored procedure by using EXECUTE at the sender JDBC?
    EXECUTE SP_STUDENT_UPDATE
    ERROR: 'java.sql.SQLException: ORA-00900: invalid SQL statement '. For details, contact your database server vendor.

    Hi. Peter.
    yes , is possible to update your rows in your sp.
    If you want the data determined from the Query SQL Statement to remain in the database unchanged after being sent successfully, enter <TEST>.This is recommended if the data has not only been read, but also changed by a stored procedure entered under Query SQL Statement.
    http://help.sap.com/saphelp_nw73/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm?frameset=/en/48/465581929734d9e10000000a42189d/frameset.htm&current_toc=/en/ca/b977f1c7814201954f20bb87ad7aab/plain.htm&node_id=64
    Could you put your sp? Maybe something is  wrong .
    Regards
    Lucho

  • Exec sql Execute in Pro*C

    Hi,
    My ProC code works fine when I have Exec sql in it but when I include plsql block in it using EXEC SQL EXECUTE, it throws the following error:
    /tmp/cc88UGZa.o(.text+0x2c0): In function `main':
    : undefined reference to `ECPGget_sqlca'
    I have included all these below header files:
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <sqlca.h>
    #include <sqlda.h>
    #include <sqlcpr.h>
    and the path have been mentioned in pcscfg.cfg as well.
    what can be the reason and the solution to this please? Help is appreciated.
    Thanks in advance!
    Ash

    You have to use 'BEGIN procedure_name END' in the execute statement while calling PL/SQL Procedures
    EXEC SQL EXECUTE
    DECLARE
    BEGIN
    END;
    END-EXEC;

  • Testing procedure in SQL tools

    Coming from an ms sql background, I'm trying to figure out how to test my procedure using SQL Tools. I have the following procedure:
    CREATE OR REPLACE PACKAGE AuditInformation
    AS
    TYPE t_cursor IS REF CURSOR;
    PROCEDURE ro_getAuditTitles(outResultsRefCursor out t_cursor);
    PROCEDURE ro_getAuditYears(outResultsRefCursor out t_cursor);
    END AuditInformation;
    CREATE OR REPLACE PACKAGE BODY AuditInformation
    AS
    PROCEDURE ro_getAuditYears(outResultsRefCursor out t_cursor)
    AS
    BEGIN
    OPEN outResultsRefCursor FOR
    SELECT TO_CHAR(YrStart, 'YYYY'), TO_CHAR(YrEnd, 'YYYY') FROM tbl_audit_year;
    END ro_getAuditYears;
    PROCEDURE ro_getAuditTitles(outResultsRefCursor out t_cursor)
    AS
    BEGIN
    OPEN outResultsRefCursor FOR
    SELECT auditTitle FROM tbl_audit;
    END ro_getAuditTitles;
    END AuditInformation;
    I'm wanting to test the procedure like so:
    execute AuditInformation.ro_getAuditTitles();
    Not sure what the format is to do this. Any help appreciated.
    Ryan

    http://www.google.lv/search?num=100&hl=lv&q=test+ref+cursor+oracle&meta=
    First link will give you an example
    Gints Plivna
    http://www.gplivna.eu

  • Error in PL/SQL - execute immediate

    Hi ,
    I am getting this error when executing the procedure.Could you help me what wrong in it?
    SQL >create or replace procedure delete_emp_copy (tname in varchar2) is
    sql_stmt varchar2(200);
    begin
    sql_stmt :='delete from :1';
    execute immediate sql_stmt using tname;
    end;
    Procedure created
    .SQL> execute delete_emp_copy('EMPLOYEES_COPY');
    BEGIN delete_emp_copy('EMPLOYEES_COPY'); END;
    ERROR at line 1:
    ORA-00903: invalid table name
    ORA-06512: at "HR.DELETE_EMP_COPY", line 5
    ORA-06512: at line 1
    EMPLOYEES_COPY exists in my schema? what could be wrong?

    You can't bind in a table name. You would have to concatenate the table name. Youd can use bind variables for values in the where clause, for example, but not for object names.
    create or replace procedure delete_emp_copy (tname in varchar2) is
    sql_stmt varchar2(200);
    begin
    sql_stmt :='delete from ' || tname;
    execute immediate sql_stmt;
    end;I'd recommend you to validate the table name, using a select from all_tables to check if it exists, or using the DBMS_ASSERT if your Oracle version supports it.

  • How can I execute Dynamic SQL statement in Forms?

    Hi All,
    I have to execute dynamic SQL statement from Forms
    Below statement I have to execute
    "EXECUTE IMMEDIATE v_stmt INTO v_return;".
    Googled for the same got results saying, Better use Database function or procedures to execute these Dynamic Statements but We want to execute in forms only.
    Can any one help me..
    Thanks,
    Madhu

    So in short you are trading code obfuscation for maintainability and the ability to share code between tools? If from somewhere else you need a procedure already implemented in database PL/SQL (and now ported to forms) this would mean you'd need to implement it in every other tool. In times where you might want to integrate your forms with $other_technology and putting stuff on the database is the first step to share functionality you just go the opposite way? And all that because someone is afraid that somebody might steal your source code? I am sorry to be blunt, but this is just plain stupid.
    Leaving aside that some things like Analytic Functions, Bulk processing or execute immediate are not even available in forms your software consists of how many LOC? How long does it take to bring a new developer up to speed with your source code? Imagine how long that would take for a developer who doesn't have coleagues who know their way around.
    And just so you know: I work for a ISV selling a closed-source product as well. We have 200+ customers all over the planet. We are well aware that wrapped packages can be reverse engineered. The premise is: stored procedures can be reused in every tool we have, if it makes sense to put stuff on the database by all means do it. If someone would want to reverse engineer our software I'd wish him good luck as some parts are implemented in such a hilarious complicated way I have troubles understanding them (and quite frankly I refuse to understand certain parts, but that's another story). I do work for almost 10 years for that ISV.
    In any case the possible solutions have already been mentioned: you have exec_sql, create_group_from_query and forms_ddl to execute dynamic SQL in forms whereas forms_ddl is a one way street and most certainly not the thing you need or want. Take a look at the documentation for the other 2 things.
    cheers

Maybe you are looking for

  • How do I find photos without a keyword tag?

    How do I find photos without a keyword tag? And by the way a further question regarding keyword tags remains unanswered...Why is there a difference between the number next to the keyword and the actual index number in the keyword folder?

  • Third party Drop Ship

    Hi All, We have a scenario wherein we use third party drop ship for accessory material. Currently when a sales order is created with multiple line items, it generates multiple purchase requisitions against each line item. These PR's are in turn conve

  • Create a ALV Report without manual FieldCat definition (OO)

    Hi ABAP'ers!!! To use the class CL_GUI_ALV_GRID for display the content of a internal table (not a structure) i need to create a fieldcat object manually to perform it...??? Has a way to do it without a hand's on work...??? Can i inherit this class t

  • I would like to change the mouse shortcut for ctrl-click to be shift-click

    Hi, basically I would like to change the mouse shortcut for ctrl-click to be shift-click - that is I want to harmonize my browser shortcuts and there are other browsers out there that open a new tab on shift-click, not on ctrl-click. How can i custom

  • I get a warning, Your Flash Player may be out of date.  Please update to continue.

    When I try and open Facebook or Youtube on an Apple Macbook.  Flash player is up to date, and the website that opens when you click on the link in the message is not Adobe.  I've tried clearing history and cookies, and it still does this sometimes.