%rowtype in Forms 4.5

We have discovered a problem using %rowtype in forms-PL/SQL where forms are compiled against our development database and then passed to a customer. The customer's instance of the database has the same tables and columns as our development db, but occasionally, (perhaps due to dbcr's being applied in a different order) describe presents the columns as being in a different order in a table. The result is that record.acolumn, now returns a value from record.anothercolumn. THIS IS CONFIRMED.
Our concern now is that the same problem could emerge with the use of 'cursor for loops' where the data returned by the cursor is given an implicit %rowtype. This is a form of code we use quite often.
Can we avoid these problems either by compiling forms in a different way, or is there a simple way of ensuring that columns are ordered repeatably on all instances of the database?
We originally discovered the problem using 'select *...' to create the record. Would we be any better off naming each column?
Are there likely to be any implications relating to versions of forms or target database? We use forms 4.5 with 8.0.6 and 7.3.4 databases.
Is this also going to be a problem with embedded PL/SQL in Pro*C's?
HELP !
null

IF v_value = 'Y'
THEN
lvl$std.copy_number(0,'BLK1.V_ITEM_NAME1');
ND IF;
I written in post-query.What does
lvl$std.copy_number(0,'BLK1.V_ITEM_NAME1');do that
:blk1.v_item_name1 := 0;doesn't?

Similar Messages

  • X-file with db function returning a rowtype to forms. Positional binding?

    How to explain this ...
    First things first:
    Forms [32 bits] Versión 11.1.2.1.0 (Producción)
    Oracle Database 11g Release 11.2.0.3.0 - 64bit Production
    Now the db testcase:
    I've got two schemas, quite similar, SCHEMA_A and SCHEMA_B
    Imagine the same table: mytable (colx varchar2, coly varchar2, colz varchar2) in both schemas,
    BUT in SCHEMA_B the order of the cols is not the same. In schema B it is
    mytable (colx, colz, coly).
    (Yeah, I know, I know, but leave it for the sake of the x-file)
    Let's suppose the table has only one row, and that I have a db function in both schemas such as this:
    function get_myrow return mytable%rowtype is
    l_row mytable%rowtype;
    begin
    select * into l_row from mytable;
    return l_row;
    end;
    Here, the forms testcase:
    I make a form, where I show the value in an item
    For example:
    :item := get_myrow().coly
    And now, the x-file:
    If I compile the form in the builder, connected as SCHEMA_A, when I run it in SCHEMA_B, the item shows colz value!!
    It is as if forms is doing some kind of positional binding in the fmx. Instead of asking for coly column to the record type variable, it shows "the second value" of the record type.
    Now, I will have to find this disordered tables and reorder them (dbms_redefinition? hints are welcome).
    Any thougts? Bug as feature?

    About the "select * is problematic" , I agree 99% of the times. But this time, as I'm storing the values in the rowtype variable, is the way to ensure that the estructure and the values fit.
    You said:
    What happens when your table changes (such as a new column) but your function hasn't been updated?  Your Function will produce an error because it can't handle the additional column.
    And it's just the opposite. My function will recompile itself, as the rowtype is perfectly capable of storing the values in the new rowtype.
    In fact, it's the MLBrown function the one that would produce an error if I change columns in the table, and that's the best case scenario, as the function could be lucky and work storing the values in the wrong places, leaving the bug hidden.
    Anyway, I understand this "select *" issue is arguable, so forget about the select * , I'll take it out of this thread with a more simple testcase:
    create table mytable (
    colx varchar2(10),
    coly varchar2(10),
    colz varchar2(10));
    Consider this "select free" version of the function:
    function get_myrow return mytable%rowtype is
      l_row mytable%rowtype;
    begin
    l_row.colx := 'a';
    l_row.coly := 'b';
    l_row.colz := 'c';
      return l_row;
    end;
    Forget also about schema_a and schema_b, I can reproduce it with just one schema!!!
    Now I build a form with just a button. When- button-pressed:
    message (get_myrow.coly);
    I compile and run it, and I get a b value. ok.
    Now I drop the table and recreate but like this:
    create table mytable (
    colx varchar2(10),
    colz varchar2(10),
    coly varchar2(10));
    Now run the form (without compiling) and see how the message shown is c !!!
    The result is different, depending on how whas the rowtype structure when I compiled the fmb.
    Are you indeed telling that is acceptable an escenary where I ask for get_myrow().coly value and I get colz value instead?
    How's that possible? Because somebody shortcutted in the fmx compiling process, and converted my call for named coly value to a call to "the second column of the record variable".
    I'm not asking for a numbered position , I'm asking for coly value, not for "the second column of the rowtype variable the day I compiled the form". Had I want a possitional binding, I'd use a frikkin varray.

  • Forms 6i, blocks and rowtype

    Is there a way to base a block on a table or view and then reference the data locally via a %rowtype. If my block has 25 items and I want to have a database procedure do the updates to the table, I can create the procedure to accept the 25 columns as parameters, or I can pass in a pl/sql table or record. If I want to pass in a record or pl/sql table, what's the easiest way to populate the pl/sql table or record. Can I reference the table name via the %rowtype and access the local values?
    Thanks

    Updating this thread...
    I see some people talking about Forms 6i and SQL Plus crashing when connecting to a database:
    APPCRASH Problem for plus80 and forms 6i builders
    Forms Developer 6i will crash if you try connecting to a database running the AL32UTF8 character set. Older systems require the UTF8 character set.
    Here are several very old threads with similar issues:
    <p>connecting form 6i  to oracle database 10G express edition
    <br>Forms 6i X 10g Database (the solution is here)
    More info: In Windows 7, I am running Forms 6i WITHOUT compatibility mode set to XP. It all seems to be running fine. I have had no problems with it since I first installed last year.
    Unfortunately, I don't have an Oracle 11 database available to try connecting to. I have only used this setup with Oracle 9 and 10 databases.

  • Dynamic IF statement in PL/SQL on-insert trigger in Forms 6.0

    I would like to build a dynamic IF statement for the on-insert trigger in a form... Users are restricted to which "projects" they are allowed to enter into the database. These restrictions are based on a security table. The same restrictions are used to build the dynamic where clause that limits which previously inserted records the users can see when they are in the form. Since the restrictions are identical, I want to use the same logic that I use to build a where clause to build a dynamic If statement instead... If the statement is true, the user can insert the record. If its false, they can't.
    I'm trying to this as follows:
    declare
    big_if varchar2(10000) :=' ';
    begin
    if :global.admin='YES'
    then
    insert_record;
    else
    declare
    cursor cur1 is
    select paren1, field, comparison_operator, value, paren2, and_or
    from rcdb.user_project_assign2
    where user_id = user;
    c1_rec cur1%ROWTYPE;
    begin
    for c1_rec in cur1 loop
    big_if:= big_if &#0124; &#0124; c1_rec.paren1 &#0124; &#0124; ':tbl_main_data.' &#0124; &#0124;c1_rec.field &#0124; &#0124;c1_rec.comparison_operator &#0124; &#0124; '''' &#0124; &#0124; c1_rec.value &#0124; &#0124; '''' &#0124; &#0124; c1_rec.paren2 &#0124; &#0124; ' '&#0124; &#0124; c1_rec.and_or &#0124; &#0124; ' ';
    end loop;
    end;
    if big_if
    then
    insert_record;
    else message('You are not allowed to insert this record');
    end if;
    end if;
    end;
    The problem is in the line
    IF big_if
    big_if is the variable that holds the text to my if statement (hense dynamic If statement) but I can't get the code to allow me to use that variable.
    Can anyone do this?
    null

    That code was great, but forms isn't allowing me to use the dbms_sql so I have to make a procedure out of forms and call it from the form. Both my form code and the procedure are compiling, but I"m still getting an error when the result is coming back to the form...
    the code in the form is:
    declare
    big_if varchar2(10000) :=' ';
    result varchar2(5) :=' ';
    check_state varchar2(2):=:tbl_main_data.state_abr;
    check_region varchar2(3):=:tbl_main_data.region_abr;
    check_program varchar2(25):=:tbl_main_data.program;
    begin
    if :global.admin='YES'
    then
    insert_record;
    else
    declare
    cursor cur1 is
    select paren1, field, comparison_operator, value, paren2, and_or
    from rcdb.user_project_assign2
    where user_id = user;
    c1_rec cur1%ROWTYPE;
    begin
    for c1_rec in cur1 loop
    big_if:= big_if &#0124; &#0124; c1_rec.paren1;
    if c1_rec.field = 'state_abr' then
    big_if:=big_if &#0124; &#0124; 'check_state' &#0124; &#0124;c1_rec.comparison_operator &#0124; &#0124; '''' &#0124; &#0124; c1_rec.value &#0124; &#0124; '''' &#0124; &#0124; c1_rec.paren2 &#0124; &#0124; ' '&#0124; &#0124; c1_rec.and_or &#0124; &#0124; ' ';
    elsif c1_rec.field = 'region_abr' then
    big_if:=big_if &#0124; &#0124; 'check_region' &#0124; &#0124;c1_rec.comparison_operator &#0124; &#0124; '''' &#0124; &#0124; c1_rec.value &#0124; &#0124; '''' &#0124; &#0124; c1_rec.paren2 &#0124; &#0124; ' '&#0124; &#0124; c1_rec.and_or &#0124; &#0124; ' ';
    elsif c1_rec.field = 'program' then
    big_if:=big_if &#0124; &#0124; 'check_program' &#0124; &#0124;c1_rec.comparison_operator &#0124; &#0124; '''' &#0124; &#0124; c1_rec.value &#0124; &#0124; '''' &#0124; &#0124; c1_rec.paren2 &#0124; &#0124; ' '&#0124; &#0124; c1_rec.and_or &#0124; &#0124; ' ';
    end if;
    end loop;
    end;
    message(big_if); pause;
    message(check_state); pause;
    message(check_region); pause;
    message(check_program); pause;
    rcdb.check_if(big_if,result,check_state,check_region,check_program);
    message('resulte = &#0124; &#0124;result&#0124; &#0124;');
    if result = 'TRUE' then insert_record;
    else
    message ('you cant enter');
    end if;
    end if;
    end;
    AND THE CODE IN THE PROCEDURE IS....
    create or replace procedure check_if (
    big_if in varchar2,
    result out varchar2,
    check_state in varchar2,
    check_region in varchar2,
    check_program in varchar2
    IS
    v_indx binary_integer := 0;
    v_sql_syntax varchar2(32767);
    root_cursor number;
    ignore integer;
    your_if_statement VARCHAR2(32767);
    v_check VARCHAR2(5);
    BEGIN
    your_if_statement := ' if '&#0124; &#0124;big_if&#0124; &#0124;' then :v_check := ''TRUE''; end if;';
    v_sql_syntax := 'begin '&#0124; &#0124;your_if_statement&#0124; &#0124;' end;';
    root_cursor := dbms_sql.open_cursor;
    v_sql_syntax := replace(replace(REPLACE(v_sql_syntax,chr(10),' '),chr(13),' '),chr(9),' ');
    dbms_sql.parse(root_cursor,v_sql_syntax,dbms_sql.v7);
    dbms_sql.bind_variable( root_cursor, ':v_check',v_check,5);
    ignore := dbms_sql.execute(root_cursor);
    dbms_sql.variable_value(root_cursor, ':v_check', v_check);
    if v_check = 'TRUE' then result:='TRUE';
    else
    result:='FALSE';
    end if;
    dbms_sql.close_cursor(root_cursor);
    END check_if;
    DO YOU KNOW WHATS WRONG?

  • How to get a values from one form to another form

    Hi All,
    I am using oracle forms 10g.
    I have created two forms. First form named as Hotel reservation req and second form named as Hotel Res Summary.
    I the first form i have one field named Requisition_number and I have one button and when i press the button in the first form the summary form is called and it need to bring all the data regarding that requisition_number in first form.
    I have written a query in when button pressed Like this
    declare
    :Global.V_REQ_NO := :XXMBHOTRESREQ_DB.REQUISITION_NO
    type r_cursor is ref cursor;
    c_XXMBHIS r_cursor;
    V_xxmbht XXMB_DOMHTRS_REQ%rowtype;
    begin
    open c_xxmbhis for select * from XXMB_DOMHTRS_REQ where requisition_number=:Global.V_REQ_NO
    loop
    fetch c_xxmbhis into v_xxmbht;
    exit when c_xxmbhis%notfound;
    --dbms_output.put_line (V_XXMBHT.REQUISITION_NUMBER);
    end loop;
    close c_XXMBHIS;
    end;
    And how to refer this to the calling form.
    But now the form is opening and record is not querying can any one correct me where i went wrong.
    Thanks & Regards
    Srikkanth
    Edited by: Srikkanth.M on Aug 19, 2011 6:43 PM

    I the first form i have one field named Requisition_number and I have one button and when i press the button in the first form the summary form is called and it need to bring all the data regarding that requisition_number in first form.If more than 1/4 of your Forms will need the REQUISITION_NUMBER then using a GLOBAL variable makes scense. However, if it is only your Hotel Reservation and Hotel Res Summary forms that will use the REQUISITION_NUMBER then use a Parameter List instead. Global variables are always of type CHAR so you could encounter conversion errors if you don't explicitly cast the value to the correct data type. Parameter object can be of type CHAR, NUMBER and DATE and offer greater flexibility. If you need an example of how to use a parameter list, open the Forms Help system, go to the Search tab and search on "Creating a Parameter List." This article give a brief overview and a list of all the built-ins associated with Parameter Lists. You will need to create a Parameter object in your Hotel Req Summary form to catch the parameter passed via the Parameter List. Then you will need to write code to do something with the value passed (usually in the When-New-Form-Instance trigger).
    Craig...

  • Button based on data is not working in form/ report / region

    create or replace procedure "BUT2"
    is
    begin
    declare
    cursor c1 is select plot_id,plot_status from re_plot;
    tno number;
    v1 varchar2(500);
    c2 c1%rowtype;
    begin
    open c1;
    loop
    tno := nvl(tno,0) + 1;
    fetch c1 into c2;
    exit when c1%notfound;
    if c2.plot_status='BLOCKED' then
    v1 := v1 || ' ' ||'<input inline type =submit style="color:BLUE;background-color:RED" value='||c2.plot_id||'>';
    else
    v1 := v1 || ' ' ||'<input inline type =submit style="color:ORANGE;background-color:GREEN" value='||c2.plot_id||'>';
    end if;
    if mod(tno, 4)= 0 then
    --v1 := v1 || '<br/>' || ' ';
    htp.p(v1);
    v1 := null;
    end if;
    end loop;
    close c1;
    htp.p(v1);
    end;
    end;this above procedure works fine in SQL Command browser. I am unable to make it as page form / report.
    My requirement is i want to bring this images in form / report. Based on click button, the value need to be parsed to other page?
    how to do it?
    yours
    andi_raj

    is not working Insufficient information. In what way is it "not working"? The page doesn't render as required? There's an error message? The browser crashes? The server room has been trampled into dust by a herd of buffalo?
    >
    I am unable to make it as page form / report.
    v1 := v1 || ' ' ||'<input inline type =submit style="color:BLUE;background-color:RED" value='||c2.plot_id||'>';
    ...It is not possible to generate form elements in an APEX page in this way. The [APEX_ITEM API|http://download.oracle.com/docs/cd/E14373_01/apirefs.32/e13369/apex_item.htm#CACEEEJE] is the only way to create APEX items in PL/SQL. However it contains no procedures to generate button items, so an alternative design is required in this case, e.g. a report with links.
    (Also what is the intention of "inline" in the above code? [There is no *inline* attribute|http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#h-17.4].)

  • Sharing Package level variables in PL/SQL Libraries in Forms 6i and 10g

    We have a Forms 6i Application, where we share variables between Forms in the following way:
    In scheme A_PROMATA is a table called T_GLOBAL_VAR, where we define our variables as Columns of the table. That means there is no record in the table, just columns, that represent our “global” variables, we want to share between Forms.
    Then we have a PL/SQL Library called NAV, where we have only the Package Specifiation:
    PACKAGE NAV
    IS
    VAR A_PROMATA.T_GLOBAL_VAR%ROWTYPE;
    END;
    This works fine for years, but when we try to migrate to Forms 10g, this does not work anymore, because we always get the following error message:
    ORA-06508 PL/SQL: could not find program unit being called
    But when we create a Dummy-Package Body with a Dummy Procedure in the Package NAV in the library, it works again...
    Does anybody know the reason for this???
    Regards and Thanks.
    Udo
    p.s.:
    Database is 10g (10.1.0.4.0)
    Application Server is 10g (10.1.2.0.0) on Red Hat

    Have you generated (compiled) the runtime .plx from your PLL library using the 10g compiler? I use the command:
    f90genm LIBNAME un/pw@xyz Module_Type=LIBRARY Output_File=LIBNAME Strip_Source=YESI tried out your situation, creating a PLL library with ONLY a package spec, and only a table%Rowtype record within the spec. While I had problems getting the Forms 10 Builder to generate the PLL Library, I was able to create a test form that sets, and then displays the columns within the record within the package spec.
    I had problems generating the .plx from the .pll within the Forms Builder. It kept giving me errors:    FRM-91507: Internal Error: Unable to generate library.
    and
        PDE-CCR003 Library TMP3 is currently in use.The only way I could create the .plx was from a cmd.exe window, with the batch compiler command above.

  • ORA 04067 %rowtype and "PUBLIC". does not exist

    Hi I have an error ORA-04067 for %rowtype in oracle 10g while running a form in turn it is calling a package. But the same thing is running fine with oracle 8i.
    Is there any code changes we need to made to upgrade to oracle 10g. Is that not backward compatable to cursors. procedure is using rowtype variables.
    can any one tell me the problem while migrating to oracle 10g from oracle 6i.
    Basically I am getting two errors I am not sure whether these two are realted or not.
    The error is Error code - 4067 and the Error - ORA 04067: not executed, Stored procedure "PUBLIC". does not exist.
    We have applied a patch to solve "PUBLIC" issue but form is still not working.
    procedure GetInventory
    (p_inventory_rec in out INVENTORY%ROWTYPE,
    p_lock BOOLEAN,
    p_found out boolean,
    p_locked out boolean) is
    I will really appreciate your help.
    Thanks
    Sandy

    Perhaps this link can give you some basic idea - i guess ->
    db function throws ORA-04067 Procedure does not exist error in forms
    Regards.
    Satyaki De.

  • 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

  • GL Account Form - Oarcle 11i (11.5.10.2)

    I have some code combinations which are directly inserted in gl_code_combinations table through custom program. When I am trying to query these code combinations through GL Account Form, it gives me a message "Record not found" and when I try to add through GL Account Form it gives me a message "This combination of segment already exists" dfvcc
    It seems the link is not there between flexfield and the codes that are created in gl_code_combinations table. However I do see those accounts in gl_code_combinations_kfv table as well. Those sagment values for such accounts are existing in Value sets that validates each segment of code combinations ID.
    So I am not sure how to handle this. Could you please give me some idea how can I be able to maintain such codes in GL Account Form.

    Hi,
    at first, I dosn't hope you have make direkt insert for new CCID into the GL_code_combinations.
    Use the fnd_flex_ext.get_ccid procedure to create or get the CCID (example see below).
    This procedure will get you the CCID for a combination of segment value or will create the CCID (incl. Validation).
    FUNCTION create_ccid (
    p_segment1 VARCHAR2,
    p_segment2 VARCHAR2,
    p_segment3 VARCHAR2,
    p_segment4 VARCHAR2,
    p_segment5 VARCHAR2 := '000',
    p_segment6 VARCHAR2 := '0000'
    RETURN NUMBER
    IS
    vv_chart_of_accounts_id NUMBER;
    vv_msg VARCHAR2 (2000);
    retval NUMBER;
    vv_coa_delimiter VARCHAR2 (80);
    vv_rec_gcc gl.gl_code_combinations%ROWTYPE;
    v_ccid gl.gl_code_combinations.code_combination_id%TYPE;
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    SELECT a.chart_of_accounts_id
    INTO vv_chart_of_accounts_id
    FROM gl_sets_of_books a
    WHERE a.set_of_books_id = g_set_of_books_id;
    IF g_debug = 'Y'
    THEN
    apps.fnd_file.put_line (apps.fnd_file.LOG,
    'message:'
    || 'Konto '
    || p_segment1
    || '.'
    || p_segment2
    || '.'
    || p_segment3
    || '.'
    || p_segment4
    || '.'
    || p_segment5
    || '.'
    || p_segment6
    END IF;
    vv_rec_gcc.segment1 := p_segment1;
    vv_rec_gcc.segment2 := p_segment2;
    vv_rec_gcc.segment3 := p_segment3;
    vv_rec_gcc.segment4 := p_segment4;
    vv_rec_gcc.segment5 := p_segment5;
    vv_rec_gcc.segment6 := p_segment6;
    vv_coa_delimiter :=
    fnd_flex_ext.get_delimiter
    (application_short_name => 'SQLGL',
    key_flex_code => 'GL#',
    structure_number => vv_chart_of_accounts_id
    fnd_message.CLEAR;
    v_ccid :=
    fnd_flex_ext.get_ccid ('SQLGL',
    'GL#',
    vv_chart_of_accounts_id,
    TO_CHAR (SYSDATE, 'DD-MON-YYYY'),
    vv_rec_gcc.segment1
    || vv_coa_delimiter
    || vv_rec_gcc.segment2
    || vv_coa_delimiter
    || vv_rec_gcc.segment3
    || vv_coa_delimiter
    || vv_rec_gcc.segment4
    || vv_coa_delimiter
    || vv_rec_gcc.segment5
    || vv_coa_delimiter
    || vv_rec_gcc.segment6
    vv_msg := fnd_message.get;
    IF g_debug = 'Y'
    THEN
    apps.fnd_file.put_line (apps.fnd_file.LOG,
    'message:' || SUBSTR (vv_msg, 1, 512)
    END IF;
    RETURN v_ccid;
    END create_ccid;

  • My form showing an alert after prcessin the bill report

    I m sending my code and i want to remove message and run the biill process easly bill is not processing and show msg--: bill already processed
    my code is
    declare
    cursor c_agcd is
         select distinct bilagcd,nvl(trde_disc,0),agty,fedn,f_typ from cr_agmast
         where unit=:block3.unit and bilagcd is not null
         and bilagcd in( select distinct oldagcd from cr_dbksup
         where unit=:block3.unit and publ=:block3.ppubl and supdate between :frdt and :todt and rsup<>0
         and BTYP='Y' ---and agty=:block3.agty or :block3.agty is null)
         and (oldagcd =:block3.pagcd or :block3.pagcd is null))
         order by cr_agmast.f_typ desc,cr_agmast.bilagcd;
         sup_rec c_agcd%rowtype;
         v_typ varchar2(5);
         vagty varchar2(5);
         vagcd varchar2(15);
         vtrde_disc number(7,2):=0;
         v_rec_cnt number:=0;
    cursor c_supply is
    select sum(rsup),oldagcd ,supdate,sor,publ,comm from cr_dbksup
         where unit=:block3.unit and publ=:block3.ppubl and oldagcd is not null
         and oldagcd = vagcd and supdate between :frdt and :todt and rsup<>0
         group by oldagcd,supdate,sor,publ,comm
         order by supdate;
         ppubl      varchar2(6);
         vedtn      varchar2(5);
         tot_sup                     number(8)          :=0;
         rate                               number(7,2)     :=0;
         vcomm                          number(7,2)     :=0;
         gross_amt                number(12,2):=0;
         v_gross_amt           number(12,2):=0;
         v_disc_amount      number(12,2):=0;
         net_amt                     number(12,2):=0;
         disc_amount           number(12,2):=0;
         bagcd varchar2(20);
         billno varchar2(20);
         pdate date;
         pcopy number(10):=0;
    /*cursor      c_rate is
         select distinct amtr from cr_rate where edtn =vedtn;*/
    /*     cursor c_rate is
    select distinct sor from cr_dbksup where unit=:block3.unit and
              edtn=sup_rec.fedn and glcode = sup_rec.glcode;
         cn number(5);*/
         cursor c_rate is
         select distinct sor from cr_dbksup
              where unit=:block3.unit and publ=:block3.ppubl and
                             edtn=sup_rec.fedn and oldagcd = sup_rec.bilagcd;
         cn number(5);
    cursor c_dt is
         select distinct fr_date FROM fin.freeze_type
              where divn=:block3.unit AND fr_typ='SCR';
    v_fdt date;
    begin
         select count(*) into v_rec_cnt from cr_bill
              where unit=:block3.unit and publ=:block3.ppubl and bldate = :block3.bill_dt;
         if nvl(v_rec_cnt,0)>0 then
              message('Bill Already processed for this Publication '||:block3.ppubl);
              message('Bill Already processed for this Publication '||:block3.ppubl);
              raise form_trigger_failure;
         end if;
         :system.message_level :=25;
         -----check validationfor freeze Voucher
         open c_dt;
         fetch c_dt into v_fdt;
         close c_dt;
         if v_fdt>:block3.bill_dt then
              message('Freeze date '||v_fdt||' Not allowed to Enter/Update/Delete Data of Freeze Date ');
              message('Freeze date '||v_fdt||' Not allowed to Enter/Update/Delete Data of Freeze Date ');
              raise form_trigger_failure;
         end if;
         --message('i m here ');message('i m here ');
         open c_agcd;
         loop
              fetch c_agcd into vagcd,vtrde_disc,vagty,vedtn,v_typ;
              exit when c_agcd%notfound;
              pcopy                     :=0;
              v_disc_amount     :=0;
              gross_amt           :=0;
              disc_amount      :=0;
              net_amt                :=0;
              --message('i m here c_supply');message('i m here c_supply');
              open c_supply;
              loop
                   fetch c_supply into tot_sup,bagcd,pdate,rate,ppubl,vcomm;
                   exit when c_supply%notfound;
                   v_gross_amt           :=      tot_sup*rate;
                   v_disc_amount      := v_gross_amt*vcomm/100;
                   pcopy                          :=     pcopy                    +     tot_sup;
                   gross_amt                :=      gross_amt      + v_gross_amt;
                   disc_amount               :=     disc_amount     +     v_disc_amount;
                   tot_sup     :=0; rate :=0;vcomm:=0; v_disc_amount     :=0;
              end loop;
              net_amt           := round((gross_amt - disc_amount),0);
              select nvl(count(1),0) into cn from cr_bill
              where unit=:block3.unit and publ=:block3.ppubl
              and agcd =bagcd and bldate = :block3.bill_dt;
              if nvl(cn,0) = 0 then
                   billno := bill();
              end if;
              synchronize;
              :block3.dagcd := bagcd ;
              :block3.amount:= net_amt;
              synchronize;
              --message('i m here net_amt '||bagcd||' , '||billno);message('i m here net_amt '||bagcd||' , '||billno);
              if net_amt is not null and net_amt >0 then
                        update cr_bill set totblamt = gross_amt , copr =pcopy, amtr = net_amt, comm_per =vtrde_disc, comm_amt = disc_amount,
                                                                     frdt =:block3.frdt , todt = :block3.todt, agty =vagty ,surt =rate,doctyp='SCR'
                        where unit=:block3.unit and publ=:block3.ppubl and agcd = bagcd and bldate = :block3.bill_dt; --and edtn = vedtn;
                   if sql%notfound then
                        insert into cr_bill(unit,bldate,bill,agcd,glcode,totblamt,publ,edtn,copr,amtr,comm_per,comm_amt,frdt,todt,agty,surt,doctyp)
                        values(:block3.unit,:block3.bill_dt,billno,bagcd,bagcd,gross_amt,ppubl,vedtn,pcopy,net_amt,vtrde_disc,disc_amount,
                        :block3.frdt,:block3.todt,vagty,rate,'SCR');
                   end if;
                   update cr_outmast set amount =net_amt,balance = net_amt
                        where unit=:block3.unit and doctyp='BIL' and publ=:block3.ppubl and agcd =bagcd and billdt = :block3.bill_dt;--and edtn =vedtn;
                   if sql%notfound then
                        insert into cr_outmast(unit,agcd,glcode,doctyp,billno,billdt,voucherno,voucherdt,publ,amount,balance,edtn)
                        values(:block3.unit,bagcd,bagcd,'BIL',billno,:block3.bill_dt,billno,:block3.bill_dt,ppubl,net_amt,net_amt,vedtn);
                   end if;
              end if; -- for o balance entry
              close c_supply;
         end loop;
         close c_agcd;
         commit;     
         forms_ddl('commit');
         message('Bill has been Processed');
         message('Bill has been Processed');
         --set_item_property('process',visible,property_false);
         go_item('exit');
    end;

    The data form should show exactly what is in essbase so if you query essbase with the Excel Add-in you should see the same number.
    Seems like either your data is not what you expect it to be or the form definition is incorrect.
    Regards,
    -John

  • How to use BULK COLLECT in Oracle Forms 11g

    Forms is showing error that "Feature is not support in Client Side Program" when i am trying to impliment Bulk collect in Forms 11g.
    i need to load full data from DB to my form becuase using cursor is very slow....
    Is there any method/Work around to achieve this ....

    declare
    type arr is table of emp%rowtype ;
    lv_arr arr;
    begin
    select * bulk collect in to lv_arr from emp;
    /*written code here to process the data and write in to file*/
    end;Unless you are inserting/updating the data you are holding in the array into a database table I don't think there is much peformance gain in using bulk-collect in conjunction with writing a file. Bulk processing will increase performance by minimizing context switches from the SQL to the PL/SQL engine, nothing more, nothing less.
    In any case bulk processing is not available in forms, if you really need to make use of it you need to do it in a stored procedure.
    cheers

  • [Forms10g (9.0.4)] error 310 with %ROWTYPE

    I have a package specification in which i declare a user defined type and a function:
    SUBTYPE services_record_type IS services%ROWTYPE;
    FUNCTION services(services_record IN OUT services_record_type) RETURN BOOLEAN;
    When i compile, i am getting this error:
    Error 310 with %ROWTYPE attribute. 'SERVICES' must name a table, cursor or cursor-variable.
    I've tried with the schema name:
    SUBTYPE services_record_type IS star.services%ROWTYPE;
    And it compiles with no error.
    But, i rather prefer using my public synonym instead of an absolute reference 'schema-name.table_name'.
    I also thought changing my function name 'services' to something else, and it also works.
    In the Oracle Forms Developer online help, it is written that:
    Unique Names Required within a Package
    In PL/SQL V1, when you created a variable with the same name as a procedure or function in the same package, the variable was always used; the identically named procedure or function was ignored. In versions after V1, variables, functions, and procedures within the same package must be unique.
    To avoid an error, make sure all procedures within a package have unique names, either by doing so explicitly, or by appending the word Unused to the procedure name.
    In the White Paper : Upgrade Developer Forms 4.5 to Oracle Forms 6, it is stated that:
    VARIABLES AND PROGRAM UNITS WITH SAME NAME IN SAME PACKAGE
    It is no longer legal to have program units and variables with the same name in the same package.
    The compiler cannot resolve which to reference. With PL/SQL V1 you may have gotten unexpected results at runtime, meaning that while coding you may have meant to reference the value of a variable, but intead got the return value of a function with the same name.
    Oracle recommends prefixing all variable whith a 'v_'.
    It seems to me that Forms Builder considers type declarations as being like variable or subprogram declarations and applies the same restriction on the naming of objects.
    Yet in the reference books, no where there're issues uppon this restriction on type definition ?
    Could someone help me please !
    Message was edited by:
    [email protected]
    null

    We can not have object with same name in same schema
    I agree with you, but in my case, i'm dealing with a packaged program unit :
    PackageName.services.
    In the naming space of my user star schema there cannot be conflict between all my object names. On one hand i have a table 'services' and on the other a package 'PackageName' in which i have a function 'services'.
    Meanwhile, if i replace my public synonym services%ROWTYPE by an absolute reference to my table star.services%ROWTYPE, we're still in the same schema so same name space, no problem it compiles pretty well !
    What do you think about it ?
    .

  • On the web how can I check the user role to display the form suitable for this role i

    Hello
    How can I check on the web the use role to display the a form for each role
    Example
    If the admin login I display admin_form.fmb and if user login I display
    user_form.fmb
    Thankx
    Tamer

    In my forms I hide tab pages according the role using something like the following script in the WHEN_NEW_FORM_INSTANCE trigger.
    So the user can not navigate to tabs which are vorbiden by his role.
    CURSOR users_roles_cur IS SELECT granted_role FROM user_role_privs
    WHERE username=(SELECT user FROM dual);
    user_roles_rec users_roles_cur%ROWTYPE;
    IF users_roles_cur%ISOPEN
    THEN
    CLOSE users_roles_cur;
    END IF;
    OPEN users_roles_cur;
    LOOP
    FETCH users_roles_cur INTO user_roles_rec;
    EXIT WHEN users_roles_cur%NOTFOUND;
    MESSAGE (user_roles_rec.granted_role);
    PAUSE;
    IF RTRIM(user_roles_rec.granted_role,' ') = 'BLA-BLA'
    THEN
    tb_pg_id := FIND_TAB_PAGE('activity');
    IF GET_TAB_PAGE_PROPERTY(tb_pg_id, visible) = 'FALSE' THEN
    SET_TAB_PAGE_PROPERTY(tb_pg_id, visible, property_true);
    END IF;
    END IF;
    END LOOP;
    CLOSE users_roles_cur;
    Other solution may be is to use an initial form which only will detect the user role and run the appropriate form.
    Other solutions are also possible.
    Joseph

  • Procedure in master/detail form

    NOTE: The basic purpose of this procedure is to return records from another table that match records that were just inserted in the detail table.
    My problem is that this procedure processes one set of values at a time. I would like to adapt this procedure to execute after processing a master/detail form that inserts multiple detail records. How and where in the form should I call this procedure to process all the detail records?
    INDT IN VARCHAR2,
    PRIM_REPORTER IN VARCHAR2,
    SEC_REPORTER IN VARCHAR2 DEFAULT NULL)
    as
    begin
    DECLARE
    cursor rpt_cursor is
    SELECT
    F_NAME,
    L_NAME,
    INDT,
    CO_DEFT,
    REPORTER,
    PROCD,
    PROCD_DATES
    FROM NYSPCR.RETURNED_TRANSCRIPTS
    WHERE NYSPCR.RETURNED_TRANSCRIPTS.INDT=INDT
    AND REPORTER=PRIM_REPORTER
    OR REPORTER=SEC_REPORTER;
    rpt_record rpt_cursor%ROWTYPE;
    BEGIN
    OPEN rpt_cursor;
    LOOP
    fetch rpt_cursor into rpt_record;
    exit when rpt_cursor%NOTFOUND;
    htp.p('Our records show that one or more of the transcripts you have just requested may already exist.<P>It appears that co-defendants '||rpt_record.F_NAME||' '|| rpt_record.L_NAME||' or '||rpt_record.CO_DEFT||' already had these minutes transcribed by Court Reporter '||rpt_record.REPORTER||' for this '||rpt_record.PROCD||'proceeding on these dates '||rpt_record.PROCD_DATES||'.<P> Get up off your ass and look for it!');
    end loop;
    end;
    end;

    UPDATE!!!!! I tried to amend the code to loop thru the detail records. Here it goes..feel free to jump in at any time.lol..
    // Set local variables to receive parameters being passed
    //from detail records
    declare
    INDTS VARCHAR2(15);
    PRIM_REPORTERS VARCHAR2(35);
    SEC_REPORTERS VARCHAR2(35);
    p_session portal30.wwa_api_module_session;
    i integer;
    rpt_record rpt_cursor%ROWTYPE;
    begin
    p_session := portal30.wwa_api_module_session.create_session
    ( p_module_id => 51078584518,
    p_version => 1
         i:=1;
    //Print first line of alert.
    htp.p('Our records show that one or more of the transcripts you have just requested may already exist.');
    //Loop through all details records to find any matches as long as INDTS is not null.
    while indts is not null LOOP
         INDTs:= p_session.get_value_as_varchar2
    p_block_name => 'DETAIL_BLOCK',
    p_attribute_name => 'A_INDT',
    p_index => i
    PRIM_REPORTERs:=p_session.get_value_as_varchar2
    p_block_name => 'DETAIL_BLOCK',
    p_attribute_name => 'A_PRIM_REPORTER',
    p_index =>i
         SEC_REPORTERs := p_session.get_value_as_varchar2
    p_block_name => 'DETAIL_BLOCK',
    p_attribute_name => 'A_SEC_REPORTER',
    p_index =>i
    cursor rpt_cursor is
    SELECT
    F_NAME,
    L_NAME,
    INDT,
    CO_DEFT,
    REPORTER,
    PROCD,
    PROCD_DATES
    FROM NYSPCR.RETURNED_TRANSCRIPTS
    WHERE NYSPCR.RETURNED_TRANSCRIPTS.INDT=INDTs
    AND REPORTER=PRIM_REPORTERs
    OR REPORTER=SEC_REPORTERs;
    OPEN rpt_cursor;
    LOOP
    fetch rpt_cursor into rpt_record;
    exit when rpt_cursor%NOTFOUND;<P>
    htp.p('It appears that co-defendants '||rpt_record.F_NAME||' '|| rpt_record.L_NAME||' or '||rpt_record.CO_DEFT||' already had these minutes transcribed by Court Reporter '||rpt_record.REPORTER||' for this '||rpt_record.PROCD||'proceeding on these date(s) '||rpt_record.PROCD_DATES||'.');
    i:=i+1;
    end loop;
    end;

Maybe you are looking for

  • Applet Parameters For Animated Gif Using AWT

    I need to have my applet except parameters to change from one type of animated gif (dog) to another animated gif (cat). There are two for each animal. If the animal parameter is "dog" the dog1.gif and the dog2.gif will be used for the animation. I'm

  • File Association, Open File, Edit File

    Vibe is told to support > 400 file formats and that the file viewing capabilities are provided by Oracle Outside In viewer technology that supports over 500 unstructured file formats. Testing with Firefox 33.1 on Linux desktops and Vibe 3.4 on SLES11

  • How to deactivate an iPad

    Hi! My uncle give me an iPad tha he bought it in USA, I live in Spain. He sync it with his computer the first time to give his photos and music. I configured it with a new iTunes account, mine, and I configure it the activation block code (4 numbers)

  • Functional Area - Balance sheet accounts

    Hi Friends, We are facing one problem with Functional area. Functional area is posting to Balance sheet accounts which should not happen. Note ; not activate Public sector. We foung when we do MIRO transaction.Can any one tell us is there any OSS not

  • Skip Installation option on DevSuite Installer

    Does any one know how to skip the "Select Installation Option" page of the Developer Suite installer.  See screen capture below. I have my installer setup to install the packages I want, and I want to skip this page for our and select the "evaluation