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.

Similar Messages

  • How to use PL/SQL table

    Hi all,
    can you guys suggest me how can I use pl/sql tables for the below query to incresing the performance.
    DECLARE
        TYPE cur_typ IS REF CURSOR;
        c           cur_typ;
        total_val varchar2(1000);
        sql_stmt varchar2(1000);
        freeform_name NUMBER;
        freeform_id NUMBER;
        imgname_rec EMC_FTW_PREVA.EMC_Image_C_Mungo%rowtype;
        imgval_rec  EMC_FTW_PREVA.EMC_Content_C_Mungo%rowtype;
        CURSOR imgname_cur IS
            select * from EMC_FTW_PREVA.EMC_Image_C_Mungo
            where cs_ownerid in (
                        select id from EMC_FTW_PREVA.EMC_Image_C
                        where updateddate > '01-JUN-13'
                        and path is not null
                        and createddate != updateddate)
            and cs_attrid = (select id from EMC_FTW_PREVA.EMC_ATTRIBUTE where name = 'Image_Upload');
    BEGIN
        OPEN imgname_cur;
        LOOP
          FETCH imgname_cur INTO imgname_rec;
          EXIT WHEN imgname_cur%NOTFOUND;
          total_val := 'EMC_Image_C_' || imgname_rec.cs_ownerid;
          sql_stmt := 'SELECT instr(textvalue,''' || total_val || '''), cs_ownerid FROM EMC_FTW_PREVA.EMC_Content_C_Mungo a Where cs_attrid = (select id from EMC_FTW_PREVA.EMC_ATTRIBUTE where name = ' || '''' || 'Body_freeform' || '''' || ')';
            OPEN c FOR sql_stmt;
            LOOP
              FETCH c INTO freeform_id,freeform_name;
              EXIT WHEN c%NOTFOUND;
                                      IF freeform_id > 0 THEN
                dbms_output.put_line (imgname_rec.cs_ownerid || ',' || total_val || ',' || freeform_id || ',' || freeform_name);
                                      END IF;
            END LOOP;
            CLOSE c;     
       END LOOP;
       CLOSE imgname_cur;
    END;
    Thanks in Advance.

    can you guys suggest me how can I use pl/sql tables for the below query to incresing the performance.
    There would be absolutely no point at all in improving the performance of code that has NO benefit.
    The only result of executing that code is to possibly produce some lines of output AFTER the entire procedure if finished:
    dbms_output.put_line (imgname_rec.cs_ownerid || ',' || total_val || ',' || freeform_id || ',' || freeform_name);
    So first you need to explain:
    1. what PROBLEM you are trying to solve?
    2. why you are trying to use PL/SQL code to solve it.
    3. why are you using 'slow by slow' (row by row) processing and then, for each row, opening a new cursor to query more data?
    You should be using a single query rather than two nested cursors. But that begs the question of what the code is even supposed to be doing since the only output is going to a memory buffer.

  • Huge memory leaks in using PL/SQL tables and collections

    I have faced a very interesting problem recently.
    I use PL/SQL tables ( Type TTab is table of ... index by binary_integer; ) and collections ( Type TTab is table of ...; ) in my packages very widely. And have noticed avery strange thing Oracle does. It seems to me that there are memory leaks in PGA when I use PL/SQL tables or collections. Let me a little example.
    CREATE OR REPLACE PACKAGE rds_mdt_test IS
    TYPE TNumberList IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
    PROCEDURE test_plsql_table(cnt INTEGER);
    END rds_mdt_test;
    CREATE OR REPLACE PACKAGE BODY rds_mdt_test IS
    PROCEDURE test_plsql_table(cnt INTEGER) IS
    x TNumberList;
    BEGIN
    FOR indx IN 1 .. cnt LOOP
    x(indx) := indx;
    END LOOP;
    END;
    END rds_mdt_test;
    I run the following test code:
    BEGIN
    rds_mdt_test.test_plsql_table (1000000);
    END;
    and see that my session uses about 40M in PGA.
    If I repeat this example in the same session creating the PL/SQL table of smaller size, for instance:
    BEGIN
    rds_mdt_test.test_plsql_table (1);
    END;
    I see again that the size of used memory in PGA by my session was not decreased and still be the same.
    The same result I get if I use not PL/SQL tables, but collections or varrays.
    I have tried some techniques to make Oracle to free the memory, for instance to rewrite my procedure in the following ways:
    PROCEDURE test_plsql_table(cnt INTEGER) IS
    x TNumberList;
    BEGIN
    FOR indx IN 1 .. cnt LOOP
    x(indx) := indx;
    END LOOP;
    x.DELETE;
    END;
    or
    PROCEDURE test_plsql_table(cnt INTEGER) IS
    x TNumberList;
    BEGIN
    FOR indx IN 1 .. cnt LOOP
    x(indx) := indx;
    END LOOP;
    FOR indx in 1 .. cnt LOOP
    x.DELETE(indx);
    END LOOP;
    END;
    or
    PROCEDURE test_plsql_table(cnt INTEGER) IS
    x TNumberList;
    empty TNumberList;
    BEGIN
    FOR indx IN 1 .. cnt LOOP
    x(indx) := indx;
    END LOOP;
    x := empty;
    END;
    and so on, but result was the same.
    This is a huge problem for me as I have to manipulate collections and PL/SQL tables of very big size (from dozens of thousand of rows to millions or rows) and just a few sessions running my procedure may cause server's fall due to memory lack.
    I can not understand what Oracle reseveres such much memory for (I use local variables) -- is it a bug or a feature?
    I will be appreciated for any help.
    I use Oracle9.2.0.1.0 server under Windows2000.
    Thank you in advance.
    Dmitriy.

    Thank you, William!
    Your advice about using DBMS_SESSION.FREE_UNUSED_USER_MEMORY was very useful. Indeed it is the tool I was looking for.
    Now I write my code like this
    declare
    type TTab is table of ... index binary_integer;
    res TTab;
    empty_tab TTab;
    begin
    res(1) := ...;
    res := empty_tab;
    DBMS_SESSION.FREE_UNUSED_USER_MEMORY;
    end;
    I use construction "res := empty_tab;" to mark all memory allocated to PL/SQL table as unused according to Tom Kyte's advices. And I could live a hapy life if everything were so easy. Unfortunately, some tests I have done showed that there are some troubles in cleaning complex nested PL/SQL tables indexed by VARCHAR2 which I use in my current project.
    Let me another example.
    CREATE OR REPLACE PACKAGE rds_mdt_test IS
    TYPE TTab0 IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
    TYPE TRec1 IS RECORD(
    NAME VARCHAR2(4000),
    rows TTab0);
    TYPE TTab1 IS TABLE OF TRec1 INDEX BY BINARY_INTEGER;
    TYPE TRec2 IS RECORD(
    NAME VARCHAR2(4000),
    rows TTab1);
    TYPE TTab2 IS TABLE OF TRec2 INDEX BY BINARY_INTEGER;
    TYPE TStrTab IS TABLE OF NUMBER INDEX BY VARCHAR2(256);
    PROCEDURE test_plsql_table(cnt INTEGER);
    PROCEDURE test_str_tab(cnt INTEGER);
    x TTab2;
    empty_tab2 TTab2;
    empty_tab1 TTab1;
    empty_tab0 TTab0;
    str_tab TStrTab;
    empty_str_tab TStrTab;
    END rds_mdt_test;
    CREATE OR REPLACE PACKAGE BODY rds_mdt_test IS
    PROCEDURE test_plsql_table(cnt INTEGER) IS
    BEGIN
    FOR indx1 IN 1 .. cnt LOOP
    FOR indx2 IN 1 .. cnt LOOP
    FOR indx3 IN 1 .. cnt LOOP
    x(indx1) .rows(indx2) .rows(indx3) := indx1;
    END LOOP;
    END LOOP;
    END LOOP;
    x := empty_tab2;
    dbms_session.free_unused_user_memory;
    END;
    PROCEDURE test_str_tab(cnt INTEGER) IS
    BEGIN
    FOR indx IN 1 .. cnt LOOP
    str_tab(indx) := indx;
    END LOOP;
    str_tab := empty_str_tab;
    dbms_session.free_unused_user_memory;
    END;
    END rds_mdt_test;
    1. Running the script
    BEGIN
    rds_mdt_test.test_plsql_table ( 100 );
    END;
    I see that usage of PGA memory in my session is close to zero. So, I can judge that nested PL/SQL table indexed by BINARY_INTEGER and the memory allocated to it were cleaned successfully.
    2. Running the script
    BEGIN
    rds_mdt_test.test_str_tab ( 1000000 );
    END;
    I can see that plain PL/SQL table indexed by VARCHAR2 and memory allocated to it were cleaned also.
    3. Changing the package's type
    TYPE TTab2 IS TABLE OF TRec2 INDEX BY VARCHAR2(256);
    and running the script
    BEGIN
    rds_mdt_test.test_plsql_table ( 100 );
    END;
    I see that my session uses about 62M in PGA. If I run this script twice, the memory usage is doubled and so on.
    The same result I get if I rewrite not highest, but middle PL/SQL type:
    TYPE TTab1 IS TABLE OF TRec1 INDEX BY VARCHAR2(256);
    And only if I change the third, most nested type:
    TYPE TTab0 IS TABLE OF NUMBER INDEX BY VARCHAR2(256);
    I get the desired result -- all memory was returned to OS.
    So, as far as I can judge, in some cases Oracle does not clean complex PL/SQL tables indexed by VARCHAR2.
    Is it true or not? Perhaps there are some features in using such way indexed tables?

  • Ps/sql Table in Forms

    Hi all ..
    I am using Forms 6i ....
    on WHEN-BUTTON-PRESSED Trigger i am calling a procedure ..
    pkg_test.display_proc( Code_ID     IN varchar2,
    keyword IN varchar2,
    v_tab_ret OUT tab_type )
    The procedure is returning a PL/SQL table type .... which consist of 5 fields.....
    Problem :- How can i display this v_tab_ret ( PL/SQL Table) in the Display Item in the form canvas ... This v_tab_ret is supposed to return variable number of rows depending on the conditions in the procedure ...
    Thanks ,

    HI,
    In forms6i, you can define the variable based on the PL/SQL table as you do in the packages.
    In the WHEN-BUTTON-PRESSED trigger, do the following
    DECLARE
    v_tab_ret tab_type
    BEGIN
    -- call your procedure:
    pkg_test.display_proc( Code_ID ,
    keyword,
    v_tab_ret
    -- Now you have the pl/sql table populated from the procedure.
    END;
    Depends on the type of block (single / multi record), you can decide how to manipulate and show the value you got in the PL/SQL tabe.
    Regards,
    Venkat

  • Design question on using PL/SQL table

    Hi I am doing some data extract and write it to a file. The main table is over 100 million rows. It is is partition by ID. So I am thinking of paralleling it.
    We are on 10g so we can not use the dbms_parallel.
    I would like to use dbms_scheduler or the table function like the Oracle MapReduce example
    However, I am not quite sure how to control the degree of parallism using the Oracle MapReduce
    Moreover the company has the own unix scheduler and I am 90% sure the old-timer would shoot down my idea and urge to use the in-house built scheduler to this kind of parallel job.
    So I would create a procedure that takes a list of ID and then run the extract, write out the file
    and this procedure will call by sqlplus on unix.
    Once all the threads are done, then the unix script will combine all the files produced into one file.
    So my question is how to go about passing IN/OUT of the PL/SQL table and how I can put that PL/SQL table inside of a cursor
    Can someone kind enough to give me some example/sample
    -Thanks so much

    Handle:      vxwo0owxv
    Status Level:      Newbie
    Registered:      Mar 14, 2011
    Total Posts:      88
    Total Questions:      54 (39 unresolved)
    Long on buzz words & short on knowledge to implement ideas!
    vxwo0owxv wrote:
    Hi I am doing some data extract and write it to a file. The main table is over 100 million rows. What % of rows need to be extracted?
    Exactly how do plan on "write it to a file"?
    It is is partition by ID. So I am thinking of paralleling it.Exactly what type of partitioning exists?
    We are on 10g so we can not use the dbms_parallel.
    I would like to use dbms_scheduler or the table function like the Oracle MapReduce examplepost URL to this MapReduce example
    However, I am not quite sure how to control the degree of parallism using the Oracle MapReduce
    Moreover the company has the own unix scheduler and I am 90% sure the old-timer would shoot down my idea and urge to use the in-house built scheduler to this kind of parallel job.
    So I would create a procedure that takes a list of ID and then run the extract, write out the file
    and this procedure will call by sqlplus on unix.Going back out to the OS just to access the DB induces overhead
    >
    Once all the threads are done, then the unix script will combine all the files produced into one file.
    Does order of records in resultant file matter?
    So my question is how to go about passing IN/OUT of the PL/SQL table and how I can put that PL/SQL table inside of a cursor
    Pass from where to where?
    Why PL/SQL table?
    Realize that SQLPLUS knows nothing about PL/SQL table
    Can someone kind enough to give me some example/sampleI could but then we'd both look unprofessional.

  • How can i use the nested table in form 6i

    how can i use the nested table in the form 6i
    ( i.e i want to insert record into the nestred table field ).
    bye siddharth singh

    Nested tables are not supported in Forms 6i, only simple object tables.

  • Use PL/SQL Table values as a comma delimited list in a in (...) clause

    Hi,
    One my procedure's parameters is a PL/SQL table of id's (NUMBER) that the GUI sends it, based on the user's selections.
    Now, I want to use the table's values in my select's where clause to return only the correct records.
    However,
    select ......
    from ....
    where id in (i_array_ids)
    doesn't work of course, and my attempts of transfering the ids to a comma delimited list of numbers (as opposed to a lenghty varchar2 string) that could work between the ( ) have all failed.
    Thanks

    And here's an example I gave with some more up-to-date syntax than in that old AskTom thread:
    Re: DYNAMIC WHERE CLAUSE in PROCEDURE

  • Using an SQL table in a Java program?

    Hello, I am quite new to programming and would like to know if it is possible to have an SQL database as a backend, linked to my Java program?
    If it is pobbible, could someone give me breif overview of the procedure.
    Much appriciated.
    Thankyou

    Yes, use JDBC:
    http://java.sun.com/docs/books/tutorial/jdbc/
    MOD

  • Global Temp Table or PL/SQL Table

    I am trying to determine if this can be done only using PL/SQL table. If not, will the usage of the global temp table affects the performance.
    Here is the situation,
    I have a data block that is based on a stored procedure. This stored procedure will return table of records from different database tables with join conditions. Some of the fields within the table of records will not have data returned from database tables. They will be the fields displayed on the form and the data will be entered by user.
    For example:
    Records will look like:
    Id          (will be populated by procedure)
    Hist_avg     (will be populated by procedure)
    My_avg     (will be used as field on the form so that user can enter their own avg)
    Cheked     (will be populated by procedure)
    My questions are:
    1.     Is this doable in form using a data block based on PL/SQL table?
    2.     Will users be able to manipulate (update) the data that based on the PL/SQL table in the memory as they wish and invoke the procedure to update the underlying table when clicking on a button (Update Avg)?
    3.     What is the advantage of using PL/SQL table and global temp table from database and form point of views?
    Any info is appreciated.

    Hi there...
    Here is the Reference...
    http://asktom.oracle.com/pls/ask/f?p=4950:8:2939484874961025998::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:604830985638
    Best Regards...
    Muhammad Waseem Haroon

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

  • Please find solution for this problem ...pl/sql table problem

    Hi
    I am using forms 6i. Now i am having a form to insert purpose. which contain 70 fields to enter. that is there are 10 screens contain 10 fields each. Each screen contains two buttons 'next' and 'previousscreen'. Now what my problem is after entering the 20 fields and i am entering 27th field in 3rd screen i noticed that i did a mistake in 2nd field value which is in 2nd screen. when i moved from third scrren to first screen by using pushbutton previous screen. all data in second and third screen has gone. For this i used a pl/sql table and put the code in 'nextscreen' button. the code is
    declare
    type emptabtype is table of :emp%rowtype
    index by binary_integer;
    emptab emptabtype;
    begin
    insert into emptab values(:emp.eno,:emp.ename.....so on);
    commit;
    end;
    The above is the approach i used. but not successful. Is the approach followed by me is correct (I strongly believe that some mistake is there). If not, pls tell me what to do for my problem. What my ultimate requirement is i should not loss the data entered in the fields even when i modify any data on any screen.
    I hope you people understand my problem
    Thanks in Advance,
    bigginner in forms
    prasanth a.s.

    Hi there,
    I have a form which has over 150 fields (from 4 tables). I have used a tab-canvas form to handle all the input - 2 screens for the fields from the first table and 1 screen each for the remaining 3 tables. I can navigate between the tabs without trouble. When everything is done, the contents of the screens are saved to the database via a menu item. Most of the fields are database items.
    My point is that Oracle Form has no problems in handling
    such processing and I am only using its normal default capabilities.
    What type of canvas are you using? There should be no reason to use buttons to navigate betweeen screens if you are using a tab-canvas form. You should not have to use PL/SQL table to handle the data if the fields are normal database columns.
    Regards,
    John

  • Value retrieve from PL/SQL Table

    Hi all,
    I am using PL/SQL Table to store the data. In table type p_table which I declared in a Package PCK.
    I am storing the value as follows
    pck.p_table(p_count)
    Here p_count is the counter.
    Values are storing the tables. Like
    Counter Values
    1 1
    2 2
    3 1.
    But when I retrieved the values from the table like pck.p_table(p_counter_1).
    Then for first Counter its giving me 0 value instead of 1.
    Can you please tell me why this is happening.
    Thanks in advance.

    Ok,here is the code.
    if(nvl(values1,0) >= nvl(:cf_qty,0)) then
         return (nvl(value1,0)-nvl(value2,0));
    else
         pck.p_count_first := pck.p_count_first + 1 ;
         pck.p_FGI(pck.p_count_first):= nvl(value2,0) - nvl(value1,0);
    end if;
    Here for First counter value stored as 1,
    Second value stored as 1.
    When I am retriving the values. like
    if (pck.p_FGI.count > 0) then
    PCK.p_count_second := pck.p_count_second + 1 ;
    v_total := pck.p_FGI(pck.p_count_second) – VALUE3;
    end if;
    Here Value pck.p_FGI(pck.p_count_second) comes as 0 instead of 1.
    Can you tell us why is this show value 0.

  • How to fetch the data from a pl/sql table and varray, with some example

    I want to fetch the data using a cursor from Pl/sql table and varry and I want to update the data.
    Please provide me some example.

    PL/SQL Table  - please note that, right term is Associative Array.
    Presumably you are referring to the 'often heated' back-and-forth that sometimes goes on in the forums when people refer to ANY PL/SQL type using a term with the word 'table' in it?
    Curious that you then show an example of a nested table!
    type emp_tab is table of employees%rowtype;
    The 'right term' for that is 'nested table'. The following would be an 'associative array' or 'index-by table'
    type emp_tab is table of employees%rowtype INDEX BY PLS_INTEGER;
    Those used to be called 'PL/SQL tables' or 'index-by tables' but 'associative array' is the current term used.
    Associative Arrays
    An associative array (formerly called PL/SQL table or index-by table) is a set of key-value pairs. Each key is a unique index, used to locate the associated value with the syntax variable_name(index).
    The data type of index can be either a string type or PLS_INTEGER.
    Since the Oracle docs often use 'PL/SQL table' or 'index-by table' it isn't unusual for someone asking a question to use those terms also. Technically the types may not be 'tables' but it's clear what they mean when they use the term.
    In PL/SQL the term 'nested table' is still used even though the PL/SQL collection is not really a table. SQL does have nested tables where the data is actually stored in a table. The PL/SQL  'nested table' type can be used as the source/destination of the SQL data from a nested table so that may be why Oracle uses that term for the PL/SQL type.
    The doc that SKP referenced refers to this use:
    Nested Tables
    In the database, a nested table is a column type that stores an unspecified number of rows in no particular order. When you retrieve a nested table value from the database into a PL/SQL nested table variable, PL/SQL gives the rows consecutive indexes, starting at 1.

  • User tables default forms

    Hello,
    I want to use the user tables default forms (after adding the user table in Uer Tables menu, it's generated a form to view that table: add, delete, update info).
    I'd like to lauch this form from my add-on menu. I know how to do that, but I wonder if that MenuID of the menu depends on the SBO installation (on what other tables were added before in SBO). Also, I'd like to put Choose from list capabilities in that form. I know also how to do this (just like a system form), but I also don't now if the FormID is the same on each installation.
    Thank you for your answer.
    I hope I made myself clear.
    Irina Stanca

    You may try this to find the MenuUID of your UDT:
    Start Saved Query through menuitem
    Have you checked Application.ResourceData? I'm not sure whether UDT forms are considered system forms, though. Anyway, you should be able to get the FormID of your UDT form on the fly by iterating the Application.Forms collection and checking the Title property, which equals the UDT Description.
    HTH
    Juha

  • Obiee 11g Noob question - bring in one sql table

    I am a new to obiee.
    Using version 11g and trying to bring in one sql table. I created my db and table, then I create the data source in odbc. Everything tests fine.
    I then open up the oracle BI administration tool, and 'import metadata'. Everything imports fine - under the 'physical' side I see my sql table and if I hit 'view data' I can see my data just fine.
    I think my problem is that under 'business model and mapping' the icon isn't green it has what looks like a red 'no' type icon. My guess is there is something I have to make that green before I will be able to create a report using my sql table. (diagram?)
    This is just one sql table with no foreign keys or even a pkey. How can I bring in just this one table?

    I created the key in the physical layer...
    then I dragged over the table and then dragged it over again (into the BMM) this created a table called (IT_Metric #1)..
    now I right click and select 'business model diagram', 'whole diagram' which opens a new window with my one table (IT_Metric) then the mouse cursor just shows waiting (hourglass) ...it never stops the hourglass..

Maybe you are looking for

  • Some questions on the 5800 GPS

    Hi folks i am debating at the moment whether to upgrade from my N95 to a N95 8GB or the lovely 5800, i prefer the symbian OS so im glad to stay with these two phones. now i had tomtom 6 working fine on my N95 and i know it will work ok on the N95 8GB

  • "This window only" option missing from Show View Options

    Hi, When trying to create a background image for a disk image for distribution, the radio button for "This window only" is missing. I read instructions on the web on how to set the background image, make the file invisible in the Terminal. It will wo

  • I'm having trouble updating to iOS 7 on my iPhone

    I continue to get messages stating that i don't have enough storage.  When I have increased the storage size, it still contines to give me this error.

  • I have iphone 5 but can't connect iTunes

    I have iPhone 5, but can't connect iTunes. My type of iPhone model ND300ZP/A, model on back iPhone is : A1429 (GSM & CDMA). Serial Number : DNPJC0C6D*** I use win 7 sp 1 error when connect windows : iphone 5 I need solution for it. Please, i want to

  • Calling an Account CRM iView from a URL

    Is there anyway i can send Account Id Parameter as a part of URL and bring the result back. I was able to use the URL http://hostname:8001/sap/bc/bsp/sap/crm_bsp_frame/maindh.do?APPL=CRMM_ACCOUNT to bring up the Account iView. But I would like to pas