SQL%Rowcount in Forms 9i

How can I get number of rows which was REALLY updated in database?
I want to use VPD with select allowed and update restricted policy, so when I update rows from SQL*Plus, I can see if no rows was updated, but when I update the same table from Forms, it says "Transaction complete 5 rows were updated". Requery shows that nothing was changed.
I want to use something like SQL%RowCount in post-update trigger in forms. Any suggestions?

Hi guys,
You could create a Global variable or a Non base table item, from Post-Update keep incrementing the variable. At the end of the commit, you will have how many records were updated. But, keep in mind of resetting the variable back to Zero.
This is the first thing which struck my mind, does anyone has good idea?
Regards,
Momen.

Similar Messages

  • Need help on Dynamic SQL Cursor in Forms

    Hi All,
    I am trying to execute Dynamic SQL Cursor in forms using EXEC_SQL built in.
    I have a cursor for example:
    'select * from supplier where supplier = '||p_supplier||' and processing_order = '||p_order
    My code is
    cur_num := Exec_SQL.Open_cursor;
    sql_order := 'select * from supplier where supplier = '||p_supplier||' and processing_order = '||p_order;
    EXEC_SQL.PARSE(cursor_number, sql_order);
      EXEC_SQL.DEFINE_COLUMN(cur_num ,1,ln_Supp_Id);
      EXEC_SQL.DEFINE_COLUMN(cur_num ,2,ls_Suppl_Name,30);
    EXEC_SQL.DEFINE_COLUMN(cur_num ,24,ls_exchange,20);
      sql_count := EXEC_SQL.EXECUTE(cur_num );
      While EXEC_SQL.FETCH_ROWS(cur_num ) > 0 Loop
            EXEC_SQL.COLUMN_VALUE(cur_num ,1,ln_Supp_Id);
            EXEC_SQL.COLUMN_VALUE(cur_num ,2,ls_Suppl_Name);
            EXEC_SQL.COLUMN_VALUE(cur_num ,24,ls_exchange);
    End Loop;
    EXEC_SQL.CLOSE_CURSOR(cur_num );
    In this case I have to write 24 Define Columns and 24 Column value. Is there any way to assign them to %rowtype at one time as I need all coulmn of the table.
    I had similar case on multiple tables.
    Please help me
    Thanks,
    Maddy

    I need this dynamic sql because p_supplier and p_order values changes at run time
    I do not understand. Is this a simplified sample or the real thing? You do know that you can pass variables to cursors:
    cursor test is
    select * from supplier where supplier = p_supplier and processing_order = p_order;
    or does e.g. p_supplier hold other parts of the query?
    cheers

  • Using PL/SQL Table in Forms

    Hi,
    I am populating a PL/SQL table by fetching data through a explicit cursor. But when i am accessing the PL/SQL table after population, i am getting a "NO DATA FOUND" error.
    I am attaching the Forms local progam units which have the logic.
    PACKAGE f_get_bike_makers IS
    TYPE prectype_maker_dtls_pll IS RECORD (
    country_code ad_bike_maker_details.abmd_country_code%TYPE,
    country_name table_values.tvs_description%TYPE,
    manu_code ad_bike_maker_details.abmd_manufacturer_code%TYPE,
    maker_name ad_bike_maker_details.abmd_maker_name%TYPE,
    maker_name_kana ad_bike_maker_details.abmd_maker_name_kana%TYPE,
    const_by ad_bike_maker_details.abmd_constructed_by%TYPE,
    const_time ad_bike_maker_details.abmd_construction_time%TYPE,
    update_by ad_bike_maker_details.abmd_updated_by%TYPE,
    update_time ad_bike_maker_details.abmd_updated_time%TYPE
    TYPE ptabtype_maker_dtls_pll IS TABLE OF prectype_maker_dtls_pll
    INDEX BY BINARY_INTEGER;
    FUNCTION f_get_bike_makers_pll RETURN ptabtype_maker_dtls_pll;
    END;
    PACKAGE BODY f_get_bike_makers IS
    FUNCTION f_get_bike_makers_pll
    RETURN ptabtype_maker_dtls_pll
    IS
    CURSOR cur_maker_dtls
    IS
    SELECT abmd.abmd_country_code,
    tvs.tvs_description,
    abmd.abmd_manufacturer_code,
    abmd.abmd_maker_name,
    abmd.abmd_maker_name_kana,
    abmd.abmd_constructed_by,
    abmd.abmd_construction_time,
    abmd.abmd_updated_by,
    abmd.abmd_updated_time
    FROM ad_bike_maker_details abmd,
    table_values tvs
    WHERE abmd.abmd_country_code = tvs.tvs_code
    AND tvs.tvs_tad_code = 'COUNTRIES'
    ORDER BY abmd.abmd_country_code;
    ln_tab_index BINARY_INTEGER := 0;
    ltab_maker_dtls ptabtype_maker_dtls_pll;
    BEGIN
    FOR lcur_maker_dtls IN cur_maker_dtls
    LOOP
    ln_tab_index := ln_tab_index + 1;
    ltab_maker_dtls (ln_tab_index) := lcur_maker_dtls;
    END LOOP;
    RETURN ltab_maker_dtls;
    END f_get_bike_makers_pll;
    END;
    PROCEDURE f_populate_maker_names
    IS
    ltab_maker_dtls f_get_bike_makers.ptabtype_maker_dtls_pll;
    lb_record_group BOOLEAN;
    ln_ltab_maker_dtls_index BINARY_INTEGER;
    BEGIN
    -- read all the vehicle types from table_values
    -- get makers and countries
    ltab_maker_dtls := f_get_bike_makers.f_get_bike_makers_pll ;
    DELETE_GROUP_ROW ('REC_MAKER_NAME', all_rows);
    ln_ltab_maker_dtls_index := ltab_maker_dtls.FIRST;
    begin
    WHILE ln_ltab_maker_dtls_index IS NOT NULL
    LOOP
    lb_record_group := l_record_group.insert_value ('REC_MAKER_NAME',
    'ABMD_MANUFACTURER_CODE',
    ltab_maker_dtls (ln_ltab_maker_dtls_index).manu_code,
    ln_ltab_maker_dtls_index
    lb_record_group := l_record_group.insert_value ('REC_MAKER_NAME',
    'ABMD_MAKER_NAME',
    ltab_maker_dtls (ln_ltab_maker_dtls_index).maker_name,
    ln_ltab_maker_dtls_index
    lb_record_group := l_record_group.insert_value ('REC_MAKER_NAME',
    'COUNTRY_NAME',
    ltab_maker_dtls (ln_ltab_maker_dtls_index).country_name,
    ln_ltab_maker_dtls_index
    lb_record_group := l_record_group.insert_value ('REC_MAKER_NAME',
    'ABMD_COUNTRY_CODE',
    ltab_maker_dtls (ln_ltab_maker_dtls_index).country_code,
    ln_ltab_maker_dtls_index
    ln_ltab_maker_dtls_index := ltab_maker_dtls.NEXT (ln_ltab_maker_dtls_index);
    end;
    END LOOP;
    exception when no_data_found then
    message('ln_ltab_maker_dtls_index :'||ln_ltab_maker_dtls_index);
    message(' ');
    end;
    ltab_maker_dtls.DELETE;
    END;
    SQL> desc ad_bike_maker_details
    Name Null? Type
    ABMD_COUNTRY_CODE NOT NULL VARCHAR2(2)
    ABMD_MANUFACTURER_CODE NOT NULL VARCHAR2(2)
    ABMD_MAKER_NAME VARCHAR2(60)
    ABMD_MAKER_NAME_KANA VARCHAR2(60)
    ABMD_CONSTRUCTED_BY NOT NULL VARCHAR2(20)
    ABMD_CONSTRUCTION_TIME NOT NULL DATE
    ABMD_UPDATED_BY VARCHAR2(20)
    ABMD_UPDATED_TIME DATE
    SQL> desc table_values
    Name Null? Type
    TVS_TAD_CODE NOT NULL VARCHAR2(15)
    TVS_CODE NOT NULL VARCHAR2(15)
    TVS_DESCRIPTION NOT NULL VARCHAR2(70)
    Oracle Database Version
    =======================
    Oracle8 Enterprise Edition Release 8.0.6.1.0 - Production
    PL/SQL Release 8.0.6.1.0 - Production
    Forms Version
    ==============
    Forms [32 Bit] Version 5.0.6.8.0 (Production)
    PL/SQL Version 2.3.4.0.0 (Production)
    Please do let know what could be the possible source of error.
    Thanks in advance.
    Nitin

    But we have to use the PL/SQL table as per our design standards.
    We are implementing the population logic of the PL/SQL table in the database as a
    package function. We are then accessing the PL/SQL table in Forms to populate the record group.It is curious that you would have such a unique requirement -- something that might make forms run a tiny bit faster -- yet you are using an ancient version of Forms.
    Also the "NO DATA FOUND" error is not raised everytime the PL/SQL table is accessed.
    What could be the reason for this erratic behaviour?I wonder if there may be a bug in SQL Net in the Oracle-to-Forms communication where PL/SQL tables are passed as out parameters. I know there is one in Web Forms 6 (6.0.8.19.1) when passing a pl/sql table from the form to Oracle -- I had to write the pl/sql table to a database table to get my process to work.

  • Error while calling "sql Type" in forms

    Hi all,
    I have created a SQL TYPE in user schema and call it through form.While compiling form following error message arise:
    Implementation restriction [may be temporary] ADT or schema level collection not supported at client side with non-OCI mode.
    My user has dba rights and i m using 9.0.4.
    Any idea ???
    Regards

    All,
    The problem is in Oracle Forms. The PL/SQL engine in Forms is not the same as the PL/SQL Engine in the database. Consequently, there will be features available in the Database that are not available in Forms. I suggest you alter your design so it doesn't use a database TYPE. There are a few Metalink articles that discuss this difference.
    Craig..

  • SQL%ROWCOUNT problem in Oracle 9i

    We have migrated our application from 8i to 9i. There is a PL/SQL procedure which returns number of rows inserted in the table. In Oracle it was returning correct number of rows but when we have migrated same procedure on Oracle9i it is returning 0 (ZERO) number of records even though procedure inserts successfully more than 100,000 rows in the table. It is used as:
    tmpCount := SQL%ROWCOUNT;
    Is there any change on Oracle9i?

    From MetaLink
    The behaviour you are observing is due to bug 2286387. You can set event 10943 to level 4194304 in your init<SID>.ora to get the old Oracle 8i behaviour.
    NOTE : The new behaviour in which SQL% attributes are affected by commit and rollback will be the DEFAULT behaviour going forward (Oracle 10i) so it is recommended to change the code so that you check the SQL% attrubutes before a commit or rollback.
    The event 10943 will also be removed in the future releases.

  • How can I display SQL%ROWCOUNT in the "Process Success Message"

    Hi all;
    I am trying to display SQL%ROWCOUNT in the "Process Success Message" of a custom update Process.
    Any ideas?

    Chris,
    I assume,
    ORDER_ITEM_LOAD.MERGE_INTELLI_LABS ( in_DEPARTMENT_UID );
    is a package / procedure you call to do something. Change the procedure and add an
    out parameter to it, which will get the
    SQL%ROWCOUNT
    value. Then, call this package like this:
    DECLARE
      in_DEPARTMENT_UID NUMBER;
    BEGIN
      in_DEPARTMENT_UID := :P4_DEPARTMENT_UID;
      ORDER_ITEM_LOAD.MERGE_INTELLI_LABS ( in_DEPARTMENT_UID,  :P4_ROW_COUNT );
    END;Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to connect to SQL Server from Forms 10g?

    Hello all,
    How do we connect to SQL Server database from Forms 10g?
    In Oracle Metalink site they have suggested using Transparent Gateway for SQL Server as a solution.
    But is there a way we can connect directly to SQL Server from Forms using an ODBC connection
    without installing anything on the database server?
    Pls help!
    Regards,
    Sam

    Hello all,
    I was able to connect to SQL Server from Oracle using Generic Connectivity (HSODBC).
    Transparent gateway was not required.
    Followed metalink note 109730.1
    So, after I created a dblink to SQL Server, I created a synonym for the dblinked SQL Server table.
    When I used the synonym as the table source in Oracle Forms, I got the following error while querying.
    "ORA-02070 - ROWID is not supported in this context."
    This is because Forms has an invisible ROWID field and when data is fetched from SQL Server table
    no Rowid is fetched since SQL Server table doesn't have one.
    Is there a way to overcome this issue or do we have populate the block manually using a SQL query ?
    Pls suggest.
    Regards,
    Sam

  • How to run recordset SQL query in FORM DATA event

    How can I run recordset SQL query in FORM DATA event upon clicking on Add button in the document?

    Hi Slamet,
    When you receive a form data event you have a class containing inside it a ObjectKeys xml info regarding the object added/modified,...
    With the objects keys you can then use the DI API method called GetByKeys to obtain the DI Object.
    There is some information about it in the SDK Help file, mainly in the "FormDataEvent" class definition:
    <i>The event provides the unique ID (BusinessObjectInfo.ObjectKey) of the modified business object. You can use the value of this property as an input parameter in the DI API DataBrowser.GetByKeys method to get a DI object.</i>
    Pay attention you don't have this information in the Before=True event of the Add as it is not yet in the database.
    Hope it helps
    Trinidad.

  • Dyn sql execute immediate  A plsql block returning sql%rowcount of rows inserted

    I would like to get the number of rows inserted in a dynamic sql statement like following.
    execute immediate
    'begin insert into a(c1,c2,c3)
    (select ac1,ac2,ac3 from ac where ac1=:thekey
    UNION select tc1,tc2,tc3 from tc where tc1=:otherkey); end;' using in key1,in key2;
    I have tried per the oracle8i dyn sql chapter in doc RETURN sql%rowcount won't compile.
    also add this to statement 'returning sql%rowcount into :rowcount'
    no luck.
    any ideas.?
    thanks.

    Quick comment first - I'm not sure why you are even using dynamic SQL here. There is nothing dynamic about your statement. It is equivalent to just:
    insert into a (c1, c2, c3)
      select ac1, ac2, ac3
        from ac
       where ac1 = key1
      UNION
      select tc1, tc2, tc3
        from tc
       where tc1 = key2;Unless you are really dynamically changing a table or column name here and just didn't show it in your example, you certainly don't want the overhead of NDS for this insert in this situation.
    In any case, you just need to evaluate SQL%ROWCOUNT in the next statement.
    insert ...;
    if sql%rowcount = 0 then
      -- nothing was inserted
    end if;

  • SQL Types in Forms

    Hi,
    Are SQL Types supported in Oracle Forms 10.1.2.0.2 ?
    Today I had a problem with them . I used a SQL type in forms , I compiled it, tested it, everything was fine but once I used a different database other than the one I used for the compilation, I start getting "ORA-06508 PL/SQL: could not find program unit being called" errors for my form's program unit in which I used the SQL type.
    Anybody has an idea about this ?
    Thanks

    I meant the user defined sql types. Here is an example
    CREATE OR REPLACE
    TYPE myType AS OBJECT ( char_Column VARCHAR2(32000) )
    CREATE OR REPLACE TYPE myTypeTable AS TABLE OF myType;Then In form
    procedure myProc is
    vMyTypeTable myTypeTable;
    begin
    null;--Some code here ..having the above decalarition is enough to reproduce the problem
    end;

  • Getting windows error during running the sql scripts from form 6i

    I made a little form application. The purpose of this application is to generate explain plan for a particular SQL. Some sql scripts run internally in order to populate the result on form’s screen after pressing the form’s button but I am getting windows error during running the sql scripts from form 6i.
    I am using forms 6i with patch 17 with Oracle 10G database on windows 2000 professional on same computer.
    This application runs fine with 8i.
    Please inform me where the problem is and how to overcome it.
    Zafri.

    I am using Text_IO in my form's when button press trigger , inorder to create the
    text file, then in the same when button press triger
    I am calling RMAN via host command in order to run the script which was created by text_IO.
    Below you find some of the code. I will appreciate if you solve the problem.
    when button press trigger:
    Declare
    in_file3 Text_IO.File_Type;
    linebuf3 VARCHAR2(1800);
    output11 varchar2(1000);
    BEGIN
         output11:='C:\EXPLAIN_PLUS\misc\rm_file.bat ';
    Host(output11,no_screen);
    :sql.execution_plan:= 'Working........................';
    synchronize;
    in_file3 := Text_IO.Fopen('c:\explain_plus\misc\create_table.txt', 'w');
    Text_IO.Put_Line(in_file3, linebuf3);
    Text_IO.put_line(in_file3,' ');
    Text_IO.put_line(in_file3,' run { sql "create table PLAN_TABLE (statement_id,...object_name varchar2(30),object_instance numeric,object_type varchar2(30),optimizer varchar2(255),search_columns number,id .....partition_start varchar2(255),partition_stop  varchar2(255),partition_id numeric,other long,distribution varchar2(30)) "; } ');
    Text_IO.put_line(in_file3,' ');
    Text_IO.put_line(in_file3,' ');
    Text_IO.FCLOSE(in_file3)
              Declare
    un VARCHAR2(80);
    pw VARCHAR2(80);
    cn VARCHAR2(80);
    output VARCHAR2(1000);
    output2 VARCHAR2(1000);
    dummy varchar2(40);
    in_file Text_IO.File_Type;
    linebuf VARCHAR2(1800);
    BEGIN
         Get_Connect_Info(un,pw,cn);
         /* for Plan_table Begg. Second INNER BLOCK */
         declare
              dummy2 varchar2(40);
         begin
         select table_name into dummy2 from all_tables where table_name='PLAN_TABLE';
         if dummy2 = 'PLAN_TABLE' then
         output2:='rman target/ nocatalog @C:\EXPLAIN_PLUS\MISC\TRUNC2.txt ' ;
    Host(output2,no_screen);
         end if;
         exception
         when no_data_found     then
    output2:='rman target/ nocatalog @C:\EXPLAIN_PLUS\misc\create_table.txt ';
    Host(output2,no_screen);
         end; --

  • Calling SQL*Loader from Forms

    Hi,
    I was wondering if anyone has called SQL*Loader from Forms?
    What I am wanting to do is use Oracle Forms as the interface where you can specify a file that you can import into the database and it will use a set control file. Push the import button and SQL*Loader does the rest.
    Is using Java code to call SQL*Loader from Forms a viable option, or is there an easier way to achieve the desired outcome.
    Any ideas or guidance will be much appreciated.
    Thanks,
    Scott.

    Scott,
    In forms, there's a HOST built-in command which is supposed to execute any o/s commands.
    What you have to do is :
    1. Bult up the string exacltly in the fashion which you will run in o/s
    2. Call the HOST Built-in and pass in the string
    Here's a example :
    Declare
    lOsCmd Varchar2(1000) := Null;
    Begin
    lOsCmd := 'sqlldr user-id=userid/passwd@connectStr '
    || ' control=c:\temp\abc.ctl log=c:\temp\abc.log '
    || ' bad = c:\temp\abc.log';
    Host (lOsCmd, No_Screen);
    End;
    -- Shailender Mehta --

  • 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

  • Sqlcode and sql%rowcount as test conditions

    I am translating a procedure from Ingres to oracle. I use the Oracle sqlcode and sql%rowcount
    variables in place of Ingres's iierrornumber and iirowcount.
    I replaced the ingres names with the oracle names, and now am wondering how how oracle uses these
    values.
    I am using DBMS_OUTPUT.PUT_LINE to display the contents of sqlcode and sql%rowcount.
    What happens when I get "no rows selected". I run the same query in standalone command line
    and get no rows selected .. and it's correct because I don't have data that matches).
    But when I run it in the procedure, I don't get any values in sqlcode or sql%rowcount ... the
    program just exits. The author was using the ingres code to test if there was data there and then
    continue to do something else.
    If you get no rows returned, does that mean, the sqlcode is 0 ? and the sql%rowcount is emtpy?
    which is why my DBMS_OUTPUT.PUT_LINE doesn't display anything ?
    my example........
    before this section in the procedure ... after running a different select that returns data ...
    I am using the DBMS to debug the values I have going in ...
    DBMS_OUTPUT.Put_line ('BEFORE sqlcode is' || sqlcode);
    DBMS_OUTPUT.Put_line ('BEFORE sqlrowcount is' || sql%rowcount);
    Select value from table
    where condition ='Y'; > this select will product "no rows return" and ignore the 2 DBMS_OUTPUTS beow ---
    DBMS_OUTPUT.Put_line ('AFTER sqlcode is' || sqlcode);
    DBMS_OUTPUT.Put_line ('AFTER sqlrowcount is' || sql%rowcount);
    When i run the procedure... I get the DBMS BEFORE statements, and nothing afterwards ...
    BEFORE sqlcode is 0
    BEFORE sqlrowcount is 1 >>>> that is all that displays
    Since I am getting the "no rows returned" ... how does oracle handle it to anyone's experience ?
    Thank you. I am learning much from your comments and information.

    Thanks to your answers .... The procedure is below. I've had to hand type it in, so typos are my mistakes.
    The procedure compiles . When there is data to be found, I get the DBSM_OUTPUT lines of code ....
    msg_read is Y
    sql_error is 0
    row_count is 1
    p_vol_id is 880091
    When I enter in a file name that does not return ANY rows back I will get the msg_read
    DBMS_OUTPUT line
    msg_read is Y
    Call completed.
    It doesn't show any 0 for sqlcode or sql%rowcount
    The original author used the Ingres return codes as input to process the rest of the code...
    It seems like oracle bounces the procedure once there are no rows to be found.
    I just added this part ....
    having an exception in the clause shows that Oracle is bouncing it to the WHEN OTHERS
    exception ...
    Any ideas of how to get Oracle not to do this ?
    I am trying to keep things simple, and all I am testing for is if I get records back the code does things,
    if not, I do something else
    create or replace procedure userfile(vms_fil_name IN varchar2, msg_read IN Varchar2)
    authid current_user
    is
    p_vms_file_name varchar2(255);
    p_vol_id varchar2(255);
    p_orig_id varchar2(255);
    p_incoming_message varchar2(255);
    sql_error number;
    n_count number;
    begin
    p_vms_fil_nam :=vms_fil_nam;
    DBMS_OUTPUT.PUT_LINE ('msg read is '|| msg_read); >> verify incoming parameter
    IF (msg_read ='Y')
    then
    select vol_id,
    orig_id,
    incoming_message
    into p_vol_id,
    p_orig_id,
    p_incoming_message
    from
    table one_table a
    where
    a.vms_fil_nam = p.vms_fil_nam
    and incoming_msg ='I';
    n_count :='sql%rowcount';
    sql_error :='sqlcode;
    DBMS_OUTPUT.PUT_LINE ('row count is '|| n_count);
    DBMS_OUTPUT.PUT_LINE ('sql_error is '|| sql_error);
    DBMS_OUTPUT.PUT_LINE ('p_vol_id is '|| p_vol_id);
    end if;
    exception >>>> just added this part as the last test....
    when others
    DBMS_OUTPUT.PUT_LINE ('other condition has been met');
    end;
    call userfile ('GEORGE','Y');

  • SQl%rowcount problem

    i have created a function, in pl/sql to check the diffrence betwenn 2 similar tables having same columns . if it has diffrence tha is if select query returns row then it shoul go in error log table but this is not happening could you solve my problem.
    thanks in advance
    CREATE OR REPLACE FUNCTION CAL_BETWEEN_TABLES(
    source_name IN VARCHAR2,
    target_name IN VARCHAR2)
    RETURN number
    IS
    v_success CONSTANT NUMBER := 0;
    v_failure CONSTANT NUMBER := -1;
    V_SQL VARCHAR2(10000);
    v_rows_processed NUMBER :=0;
    p_err_modul error_logs.err_modul%TYPE := 'NULL';
    p_err_function error_logs.err_function%TYPE := ' CAL_BETWEEN_TABLES';
    p_err_type error_logs.err_type%TYPE := 'SN';
    BEGIN
    V_SQL:= 'SELECT * from '||source_name||' minus select * from '||target_name||'';
    v_rows_processed:=sql%rowcount;
    IF v_rows_processed>0
    THEN
         p_err.insert_error(p_err_modul,
    p_err_function,
    p_err_type,
    SQLCODE,
    USER,
    'Failed in the function CAL_BETWEEN_TABLES' ||
    SQLERRM);
    RETURN(v_failure);
    --dbms_output.put_line('failure');
    ELSE
    RETURN(v_success);
    --dbms_output.put_line('success');
    END IF;
    END CAL_BETWEEN_TABLES;

    You are missing EXECUTE IMMEDIATE or it is cut and paste problem. also
    Declare variable
    v_row source_name%rowtype;
    V_SQL:= 'SELECT * from '||source_name||' minus select * from '||target_name||'';
    EXECUTE IMMEDIATE v_sql INTO v_row;
    v_rows_processed:=sql%rowcount;
    HTH

Maybe you are looking for

  • How do i know if a page is bookmarked

    When I bookmark a page, I see the star turns blue; however, when I return to that page, how can I tell if the page has been bookmarked before. Before the update, there would be a yellow star on the address bar. That is no longer available. Thank you

  • F-53 / F-58 / F-44

    Dear All , While making vendor payment with Tcode F-53 / F-58 or while clearing Vendor with tcode F-44 , Profit center not dispaly. In Profit center field there is blank insted of actual Profit center. At the time of Bill booking (MIRO/FB60), We are

  • Quarterly sales reporting

    hi gurus,           I have a sales cube which maintains yearly sales.I would like to have Sales quarterly i.e for every 3 months.Suppose if it is monthly how can i do that. Thanks in advance.

  • SSIS 2012 working differently than 2008

    I am in the process of migrating my SSIS 2008 packages to SSIS 2012 and I've come across a problem.  I have a flat file connection manager that has the text qualifier set to " (double quote) and the column delimiter set to | (veritcal bar).  In 2008,

  • SMTP routing iMS 5.2

    A simple question, how can I specify the MX ip address of a particular destination domain ( bypassing dns MX lookup ) Ims version 5.2P1 Ids 5.1. This setting was possible in NMS 4.x editing local.conf file es : service.smtp.smtp-routernsmsghostrewrit