Question about Table Function inside a Package

Hi … I am new in PL/SQL, I am trying to use a table function to create depending on a value passed to it (I am using 10g). Everything works great but the moment I add a parameter everything explode, I am creating it on a package.
SQL that work
CREATE OR REPLACE PACKAGE BODY financial_reports AS
FUNCTION Fund_Amount
RETURN financial_reports.Fund_Amount_Table
pipelined parallel_enable IS
cur_row financial_reports.Fund_Amount_Record;
BEGIN
FOR cur_row IN
SELECT
to_number(substr(bu5.usrdata, 1, 1)) As SECTION_ID
,to_number(substr(bu5.usrdata, 2, 1)) As SUB_SECTION_ID
,to_number(substr(bu5.usrdata, 4, 2)) AS LINE_NUMBER
,to_number(substr(bu5.usrdata, 7, 2)) As FUND_ID
,sum(be.amt) AS AMOUNT
FROM
linc.budgetdb_usr5@stjohnsfp bu5
JOIN linc.budgetdb_event@stjohnsfp be ON
bu5.keyvalue = be.acctno
WHERE
bu5.keyvalue like '__-__-__-____-____-_____'
AND bu5.usrdata like '__-__-__'
AND bu5.fieldnum = 1
AND bu5.ispecname = 'GLMST'
AND to_number(substr(bu5.usrdata, 7, 2)) = 1
GROUP BY
bu5.usrdata
ORDER BY
bu5.usrdata
LOOP
PIPE ROW(cur_row);
END LOOP;
END Fund_Amount;
END financial_reports;
SQL that do not work …
CREATE OR REPLACE PACKAGE BODY financial_reports AS
FUNCTION Fund_Amount (Fund_Id IN NUMBER)
RETURN financial_reports.Fund_Amount_Table
pipelined parallel_enable IS
cur_row financial_reports.Fund_Amount_Record;
fund_id_int NUMBER;
BEGIN
fund_id_int := Fund_Id;
FOR cur_row IN
SELECT
to_number(substr(bu5.usrdata, 1, 1)) As SECTION_ID
,to_number(substr(bu5.usrdata, 2, 1)) As SUB_SECTION_ID
,to_number(substr(bu5.usrdata, 4, 2)) AS LINE_NUMBER
,to_number(substr(bu5.usrdata, 7, 2)) As FUND_ID
,sum(be.amt) AS AMOUNT
FROM
linc.budgetdb_usr5@stjohnsfp bu5
JOIN linc.budgetdb_event@stjohnsfp be ON
bu5.keyvalue = be.acctno
WHERE
bu5.keyvalue like '__-__-__-____-____-_____'
AND bu5.usrdata like '__-__-__'
AND bu5.fieldnum = 1
AND bu5.ispecname = 'GLMST'
AND to_number(substr(bu5.usrdata, 7, 2)) = fund_id_int
GROUP BY
bu5.usrdata
ORDER BY
bu5.usrdata
LOOP
PIPE ROW(cur_row);
END LOOP;
END Fund_Amount;
END financial_reports;
Error … (This works without the parameter)
Error starting at line 43 in command:
select * from table(financial_reports.Fund_Amount(1) )
Error at Command Line:1 Column:14
Error report:
SQL Error: ORA-22905: cannot access rows from a non-nested table item
Any help would be greatly appreciated

try renaming your parameter so as not to confuse with what you are using in your column " to_number(substr(bu5.usrdata, 7, 2)) AS FUND_ID":
CREATE OR REPLACE PACKAGE BODY financial_reports AS
  FUNCTION Fund_Amount (pFund_Id IN NUMBER)
    RETURN financial_reports.Fund_Amount_Table
    pipelined parallel_enable IS
    cur_row financial_reports.Fund_Amount_Record;
    fund_id_int NUMBER;
  BEGIN
    fund_id_int := pFund_Id;
    FOR cur_row IN ( SELECT to_number(substr(bu5.usrdata, 1, 1)) As SECTION_ID,
                            to_number(substr(bu5.usrdata, 2, 1)) As SUB_SECTION_ID,
                            to_number(substr(bu5.usrdata, 4, 2)) AS LINE_NUMBER,
                            to_number(substr(bu5.usrdata, 7, 2)) As FUND_ID,
                            sum(be.amt) AS AMOUNT
                       FROM linc.budgetdb_usr5@stjohnsfp bu5
                              JOIN linc.budgetdb_event@stjohnsfp be ON bu5.keyvalue = be.acctno
                      WHERE bu5.keyvalue like '__-__-__-____-____-_____'
                        AND bu5.usrdata like '__-__-__'
                        AND bu5.fieldnum = 1
                        AND bu5.ispecname = 'GLMST'
                        AND to_number(substr(bu5.usrdata, 7, 2)) = fund_id_int
                     GROUP BY bu5.usrdata
                     ORDER BY bu5.usrdata ) LOOP
      PIPE ROW(cur_row);
    END LOOP;
  END Fund_Amount;
END financial_reports;

Similar Messages

  • Custom aggregate function inside a package.

    Hi there,
    I'm trying to write a custom aggregate function and group that function inside a package together with some other functions that I have. As an example (to simulate the problem I have) suppose my custom aggregation to do a summation of numbers looks like:
    CREATE OR REPLACE TYPE SUM_AGGREGATOR_TYPE AS OBJECT (
    summation NUMBER,
    STATIC FUNCTION ODCIAggregateInitialize(agg_context IN OUT
    SUM_AGGREGATOR_TYPE) RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateIterate(self IN OUT SUM_AGGREGATOR_TYPE,
    next_number IN NUMBER) RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateMerge(self IN OUT SUM_AGGREGATOR_TYPE,
    para_context IN SUM_AGGREGATOR_TYPE) RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateTerminate(self IN SUM_AGGREGATOR_TYPE,
    return_value OUT NUMBER, flags IN NUMBER) RETURN NUMBER
    CREATE OR REPLACE TYPE BODY SUM_AGGREGATOR_TYPE IS
    STATIC FUNCTION ODCIAggregateInitialize(agg_context IN OUT
    SUM_AGGREGATOR_TYPE)
    RETURN NUMBER IS
    BEGIN
    agg_context := SUM_AGGREGATOR_TYPE(NULL);
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateIterate(self IN OUT SUM_AGGREGATOR_TYPE,
    next_number IN NUMBER)
    RETURN NUMBER IS
    BEGIN
    IF self.summation IS NULL THEN
    self.summation := next_number;
    ELSIF summation IS NOT NULL THEN
    self.summation := self.summation + next_number;
    END IF;
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateMerge(self IN OUT SUM_AGGREGATOR_TYPE,
    para_context IN SUM_AGGREGATOR_TYPE)
    RETURN NUMBER IS
    BEGIN
    self.summation := self.summation + para_context.summation;
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateTerminate(self IN SUM_AGGREGATOR_TYPE,
    return_value OUT NUMBER, flags IN NUMBER)
    RETURN NUMBER IS
    BEGIN
    return_value := self.summation;
    return ODCIConst.Success;
    END;
    END;
    If I write the following function definition:
    CREATE OR REPLACE FUNCTION MY_SUM(input NUMBER)
    RETURN NUMBER PARALLEL_ENABLE AGGREGATE USING SUM_AGGREGATOR_TYPE;
    and corresponding type declaration to test:
    CREATE OR REPLACE TYPE VECTOR
    IS
    TABLE OF NUMBER;
    this statement:
    select my_sum(column_value) from table(vector(1, 2, 1, 45, 22, -1));
    gives the correct result of 70. However, creating a package with the function definition:
    CREATE OR REPLACE PACKAGE MY_FUNCTIONS AS
    FUNCTION MY_SUM(input NUMBER)
    RETURN NUMBER PARALLEL_ENABLE AGGREGATE USING SUM_AGGREGATOR_TYPE;
    END;
    and calling it via:
    select MY_FUNCTIONS.my_sum(column_value) from table(vector(1, 2, 1, 45, 22, -1));
    explodes with:
    ORA-00600: internal error code, arguments: [17090], [], [], [], [], [], [], [], [], [], [], []
    Is it possible to have custom aggregate functions nested inside package declarations?
    I'm using Oracle 11g, Release 2 (11.2.0.1.0).

    HiddenName wrote:
    Is it possible to have custom aggregate functions nested inside package declarations?Yes, it is possible, you have succesfuly created your function. Your problem is that the database throws ORA-600 on execute. And with ORA-600 you can do 2 things: 1) google ORA-600 17090 or 2) contact your Oracle Support.
    You could also try to declare the function without PARALLEL_ENABLE - just to try to see if it changes anything. You can also try to call your function against a regular table with rows and columns - not against an collection type with table() operator.
    Anyway - these 2 tests should be usefull for Oracle Support.
    I never tried to put a custom aggregate function into a package. First - the cases when you need a custom aggregate function to be written for your system are very rare. Second - even if I needed 1 then I never needed 2 or more custom aggregate functions on my system. And as I do not like to make my life more complex than necessary, I have created it as a stand-alone function. And it is works (slowly).I tried using a standard table as you suggested:
    CREATE TABLE TEST_DATA
    test_value NUMBER
    INSERT INTO TEST_DATA
    (SELECT column_value test_value from TABLE(vector(1, 2, 1, 45, 22, -1)));
    COMMIT;
    select my_sum(test_value) from test_data;
    select my_functions.my_sum(test_value) from test_data;
    I also tried removing the PARALLEL_ENABLE clause to create the package as follows:
    CREATE OR REPLACE PACKAGE MY_FUNCTIONS AS
    FUNCTION MY_SUM(input NUMBER)
    RETURN NUMBER AGGREGATE USING SUM_AGGREGATOR_TYPE;
    END;
    And unfortunately it still breaks with the following error: SQL Error: ORA-00600: internal error code, arguments: [17090]. This looks like an Oracle bug to me as the PL/SQL parsing engine should have disallowed me to even create this if it is not supported in Oracle. Instead, it allows me to create the package, and breaks when I call the function with this weird error (additionally cutting my connection from the database) instead of disallowing me to do this altogether and printing a nice error message telling me that Oracle doesn't support this. How would I go about logging a ticket for this?
    Edited by: wcmatthysen on Dec 1, 2010 12:51 PM

  • Running a function inside a package

    This is kind of a noob question: I have a function. I want to use this function inside a package. The function is not created inside the package.

    Here is an example;
      1  create or replace function test_func(v_one number, v_two number)
      2  return number
      3  as
      4  begin
      5  return v_one + v_two;
      6* end;
    SQL> /
    Function created.
    SQL> select test_funct(10,20) from dual
      2  /
    select test_funct(10,20) from dual
    ERROR at line 1:
    ORA-00904: "TEST_FUNCT": invalid identifier
    SQL> select test_func(10,20) from dual
      2  /
    TEST_FUNC(10,20)
                  30
    SQL> create or replace package test_pkg as
      2  procedure test_proc(v_name varchar2, v_one number, v_two number);
      3  end test_pkg;
      4  /
    Package created.
    SQL>
      1  create or replace package body test_pkg as
      2  procedure test_proc(v_name varchar2, v_one number, v_two number) is
      3  begin
      4     dbms_output.put_line(v_name || ' ' || test_func(v_one, v_two));
      5  end;
      6* end test_pkg;
    SQL> /
    Package body created.
    SQL> set serveroutput on
    SQL> exec test_pkg.test_proc('Krystian',10,20)
    Krystian 30
    PL/SQL procedure successfully completed.With kind regards
    Krystian Zieja

  • Question about the function module (RFC_READ_TABLE)

    Dear everyone
    Could I ask you a question about the function module (RFC_READ_TABLE)?
    I was asked if it's possible to create a report which compares the data between different SAP systems (both production systems).
    Now, the easiest way would be to use the function module (RFC_READ_TABLE) within a SAP infoset query (SQ01 type query).
    But I heard the rumor that using the function module (RFC_READ_TABLE) is not advisable due to the security reason.
    However, I am not exactly sure what sort of security problems this function module can possibly have...
    Would you help me on this?
    I also would like to know if using "remote enabled module" type function module can always overcome this possible security issue.
    Or, are there any points that I need to be careful about even when I use "remote enabled module" function module?
    Thank you very much in advance.
    Takashi

    Dear Fred-san
    Thank you very much for your support on this.
    But, may I double check about what you mentioned above?
    So, what you were mentioning was that if some user executes the query with
    the function module (RFC_READ_TABLE), under the following conditions, he can access to
    the HR data even when he does not have the authorizations for HR transactions?
    <Conditions>
    1. the user has the authorization for HR database tables themselves
    2. RFC_READ_TABLE is called to retrieve the data from HR database
    <example>
    Data: LF_HR_TABLE like  DD02L-TABNAME value 'PA0000'.
    CALL FUNCTION 'RFC_READ_TABLE'
       EXPORTING
        query_table                = LF_HR_TABLE
      TABLES
       OPTIONS                    =
       fields                     =
       data                       =    .
    But then, as long as we call this function module for a non-critical tables such as
    VBAP (sales order) or EKKO (purchase order) within our query, it wouldn't seem to be
    so security risk to use RFC_READ_TABLE...
    Besides, each query (infoset query) has got the concept of user groups, which limits
    the access to the queries within the user group.
    ※If someone does not belong to the user group, he cannot execute the queries within that
       user group, etc
    So, my feeling is that even infoset queries does have authorization concept...
    Would you give me your thought on this?
    I also thank you for your information for SCU0.
    That is an interesting transaction
    Kind regards,
    Takashi

  • How to find out list of procedures and functions inside a package

    How I can find out the list of Procedures and Functions inside a Package.

    Look at ALL_PROCEDURES and ALL_ARGUMENTS.

  • How to use the Table Function defined  in package in OWB?

    Hi,
    I defined a table function in a package. I am trying to use that in owb using Table function operator. But I came to know that, owb R1 supports only standalone table functions.
    Is there any other way to use the table function defined in a package. As like we create synonyms for functions, is there any other way to do this.
    I tryed to create synonyms, it is created. But it is showing compilation error. Finally I found that, we can't create synonyms for functions which are defined in packages.
    Any one can explain it, how to resolve this problem.
    Thank you,
    Regards
    Gowtham Sen.

    Hi Marcos,
    Thank you for reply.
    OWB R1 supports stand alone table functions. Here what I mean is, the table fucntion which is not inculded in any package is a stand alone table function.
    for example say sample_tbl_fn is a table function. It is defined as a function.It is a stand alone function. We call this fucntion as "samp_tbl_fn()";
    For exampe say sample_pkg is a package. say a function is defined in a package.
    then we call that function as sample_pkg.functionname(); This is not a stand alone function.
    I hope you understand it.
    owb supports stand alone functions.
    Here I would like to know, is there any other way to use the functions which are defined in package. While I am trying to use those functions (which are defined in package -- giving the name as packagename.functionname) it is throwing an error "Invalid object name."
    Here I would like know, is there any other way to use the table functions which are defined in a package.
    Thank you,
    Regards,
    Gowtham Sen.

  • Call a function inside a package from a stored procedure

    Hello:
    I am kind of new to the stored procedure. Does anyone know how to call a function inside a package from another stored procedure?
    I have a existing function (func_b) inside a package (pack_a) and it returns a cursor. I want to call this function from a stored procedure (proc_c) so that I use the data inside the cursor.
    can I do the following in proc_c:
    my_cursor1 SYS_REFCURSOR;
    begin
    my_cursor1 := exec pack_a.func_b
    end
    It will be very helpful if anyone can point me to any reading or example. Thank you very much for your information.

    guys:
    Thank you for your information so far. I need some more help here. I was able to run the function in my stored procedure. However, I was not able to print the result on the screen to view the cursor result, although I am using dbms_output.put_line statement inside my stored procedure.
    I use the following statement to execute my stored procedure on sql*plus. I can tell the stored procedure is executed successfully, but I did see anything printed:
    DECLARE TEMP VARCHAR2(100);
    BEGIN PROC_LAWS_CAD_NAME_SEARCH('LPD', 'TEST DEVICE ID', 'TEST LAST NAME', 'TEST FIRST NAME', 'F', '11112009', TEMP); END;
    I tried to use 'set serveroutput on' and got the following error:
    ERROR:
    ORA-06502: PL/SQL: numeric or value error: host bind array too small
    ORA-06512: at line 1
    I am kind of confused now. thank you for your help.
    Jack
    Here is my procedure:
    create or replace
    PROCEDURE PROC_SEARCH
    ( AGENCY_ID IN VARCHAR2,
    DEVICE_ID IN VARCHAR2,
    L_NAME IN VARCHAR2,
    F_NAME IN VARCHAR2,
    SEX IN VARCHAR2,
    DOB IN VARCHAR2,
    CAD_NAME_SCH_RESULT_STR OUT VARCHAR2)
    AS
    v_agy_id varchar2(10);
    v_device_id varchar2(20);
    v_l_name varchar2(25);
    v_f_name varchar2(15);
    v_sex varchar2(1);
    v_dob date;
    -- this cursor is going to be used to store a list of warrant matching
    -- name search criteria
    cad_srch_cursor sys_refcursor;
    objSrch SEARCH_RESULT_TEMP%ROWTYPE;
    BEGIN
    cad_srch_cursor := SEARCH_PKG.SEARCH('TESTING', 'TESTER', null, null,null, null, getPhonetic('TESTING'));
    LOOP
    FETCH cad_srch_cursor INTO objSrch;
    EXIT WHEN cad_srch_cursor%NOTFOUND;
    --insert into SEARCH_RESULT_TEMP (name_last) values (objSrch.name_last);
    CAD_NAME_SCH_RESULT_STR := objSrch.name_last;
    dbms_output.put_line('First:'||objSrch.name_first||':Last:'||objSrch.name_last||':Middle:'||objSrch.name_middle);
    end LOOP;
    END PROC_LAWS_SEARCH;
    -----------------------------------------

  • Can I use table function inside Dynamic query ?

    Dear Gurus,
    I have following code
    DECLARE
    TYPE CRITERIA_LIST_TABLE AS TABLE OF VARCHAR2(20);
    OtherNoList CRITERIA_LIST_TABLE; /* CRITERIA_LIST_TABLE is index by table*/
    QUERY_STRING VARCHAR2(4000);
    BEGIN
    OtherNoList := CRITERIA_LIST_TABLE();
    SELECT DISTINCT REGEXP_SUBSTR('1,5,6,4', '[^\,]+',1, LEVEL ) BULK COLLECT INTO OtherNoList
    FROM DUAL
    CONNECT BY LEVEL <= REGEXP_COUNT('1,5,6,4', '\,') + 1 ;
    QUERY_STRING := 'INSERT INTO TAB1 (C1,C2) '||
    'SELECT C1,'||
    'C2 '||
    'FROM TAB1 ,'||
    'TABLE( '||
              'CAST (OtherNoList AS CRITERIA_LIST_TABLE) '||
                   ') OTHRNOS '||
    'WHERE TAB1.C1 = OTHRNOS.COLUMN_VALUE ';
    DBMS_OUTPUT.PUT_LINE('Query String is '||QUERY_STRING);
    EXECUTE IMMEDIATE QUERY_STRING;
    END;
    Can I use Table function inside dynamic query.
    Thanking in advance
    Sanjeev

    Try:
    DECLARE
    TYPE CRITERIA_LIST_TABLE AS TABLE OF VARCHAR2(20);
    OtherNoList CRITERIA_LIST_TABLE; /* CRITERIA_LIST_TABLE is index by table*/
    QUERY_STRING VARCHAR2(4000);
    BEGIN
    OtherNoList := CRITERIA_LIST_TABLE();
    SELECT DISTINCT REGEXP_SUBSTR('1,5,6,4', '[^\,]+',1, LEVEL ) BULK COLLECT INTO OtherNoList
    FROM DUAL
    CONNECT BY LEVEL <= REGEXP_COUNT('1,5,6,4', '\,') + 1 ;
    QUERY_STRING := 'INSERT INTO TAB1 (C1,C2) '||
    'SELECT C1,'||
    'C2 '||
    'FROM TAB1 ,'||
    'TABLE( '||
    'CAST (:OtherNoList AS CRITERIA_LIST_TABLE) '||
    ') OTHRNOS '||
    'WHERE TAB1.C1 = OTHRNOS.COLUMN_VALUE ';
    DBMS_OUTPUT.PUT_LINE('Query String is '||QUERY_STRING);
    EXECUTE IMMEDIATE QUERY_STRING using OtherNoList;
    END;p.s. not tested
    Amiel Davis

  • Stragg Function inside a Package

    Hi Experts,
    When i tried to use Stragg Function inside package, it throws error
    CREATE OR REPLACE PACKAGE PKG_TEST AS
    FUNCTION STRAGG(INPUT VARCHAR2) RETURN VARCHAR2;
    END PKG_TEST;
    CREATE OR REPLACE PACKAGE BODY PKG_TEST AS
    FUNCTION STRAGG (INPUT VARCHAR2) RETURN VARCHAR2 PARALLEL_ENABLE AGGREGATE USING string_agg_type;
    END PKG_TEST;
    SHOW ERRORS
    Package created.
    Warning: compiled but with compilation errorsAny Suggestions...
    Thanks

    Thanks Frank.
    >
    Why do you need (or even want) STRAGG to be in a package? If it's a stand-alone function, you can call it from within a package whne you want to.
    >
    Actually my requirement is to have all code inside package and not in open.
    >
    The second example is not referencing pkg_test. Maybe you have two functions called STRAGG, one inside pkg_test (which has a bug) and one that is not in any package (which works correctly).
    >
    No...just only one function.
    >
    Whenever you have problems with a user-defined function, post the code that creates the user-defined function. (Make sure it's formatted.)
    Even if you just copied the function from AskTom, post exactly what's on your system. There may be a editing error of which you're not aware.
    >
    Here is what i have with me,
    Type Object and Body.
    CREATE OR REPLACE TYPE string_agg_type
    AS OBJECT
        total varchar2(4000),
        STATIC FUNCTION
            ODCIAggregateInitialize (sctx IN OUT string_agg_type )
        RETURN NUMBER,
        MEMBER FUNCTION
            ODCIAggregateIterate
            (    self    IN OUT    string_agg_type
            ,    value    IN    VARCHAR2)
        RETURN NUMBER,
        MEMBER FUNCTION
            ODCIAggregateTerminate
            (    self        IN    string_agg_type
            ,    returnValue    OUT    VARCHAR2
            ,    flags        IN    NUMBER
        RETURN NUMBER,
        MEMBER FUNCTION
            ODCIAggregateMerge
            (    self    IN OUT string_agg_type
            ,    ctx2    IN string_agg_type
        RETURN NUMBER
    CREATE OR REPLACE TYPE BODY string_agg_type
    IS
        STATIC FUNCTION
            ODCIAggregateInitialize
            (    sctx    IN OUT    string_agg_type
        RETURN    NUMBER
        IS
        BEGIN
            sctx := string_agg_type ( NULL );
            RETURN ODCIConst.Success;
        END;
        MEMBER FUNCTION
            ODCIAggregateIterate
            (    self    IN OUT    string_agg_type,
                value    IN    VARCHAR2
        RETURN NUMBER
        IS
        BEGIN
            self.total := SUBSTR(self.total || value, 1, 4000);
            RETURN ODCIConst.Success;
        END;
        MEMBER FUNCTION
            ODCIAggregateTerminate
            (    self        IN    string_agg_type
            ,    returnValue    OUT    VARCHAR2
            ,    flags        IN    NUMBER
        RETURN NUMBER
        IS
        BEGIN
            returnValue := self.total;
            RETURN ODCIConst.Success;
        END;
        MEMBER FUNCTION
            ODCIAggregateMerge
            (    self    IN OUT    string_agg_type
            ,    ctx2    IN    string_agg_type
        RETURN NUMBER
        IS
        BEGIN
            self.total := self.total || ctx2.total;
            RETURN ODCIConst.Success;
        END;
    END;
    SHOW ERRORSMy Package
    CREATE OR REPLACE PACKAGE PKG_TEST AS
        FUNCTION STRAGG(INPUT VARCHAR2) RETURN VARCHAR2 PARALLEL_ENABLE;
    END PKG_TEST;
    CREATE OR REPLACE PACKAGE BODY PKG_TEST AS
        FUNCTION STRAGG (INPUT VARCHAR2) RETURN VARCHAR2 PARALLEL_ENABLE AGGREGATE USING string_agg_type;
    END PKG_TEST;
    /Any way ....i just looked in to Solomon Code and tried it similarly. Not getting the expected and i believe it is a bug.
    Thanks a lot for your time to analyze and reply to my post.

  • Question about Percent Function

    This kinda goes along with my question about the plus sign. That was answered by the fact it means there is more than can be displayed in the field with the plus sign. The problem I am having is all of the fields with the plus sign are formated to be PERCENT. These fields are filled in via the C# program. The values are calculated in the C# program and outputed to the PDF form in the form of 00.00 - 100.00. Thus if I am filling in these fields with values that are within a PERCENT range, then why are they showing a plus sign. I have even go as far as to wipe the field clean, re-do the Text box, re-format as PERCENT, with the text centered, and the No Calculation radio button set true. The only other thing I do these fields is set the FONT to 10 point or otherwise the huge in size.

    Thank you all for the help on this. What I found is:
    it is correct that the incoming value to a fillable field for a PERCENT must be between 0 and 1 BUT this is NOT the complete answer.
    If I filled the field with 33.33 then it will display  33.33 + which says the display is too big.
    If I filled the field with .3333 thin it will display .3333 without the PLUS sign, but is still not correct because the FORMAT is set to PERCENT.
    What I had to do is add the following JAVA script.
    // Custom Calculate script for text field
    (function () {
        // Get the field values
        var v1 = getField("NO_FEAR_ASSOC_WITH_TARGETED_DISABILITY_PERCENT_1").value;
        // Set this field value
        event.value = v1;
    Now if the input is .3333 the display is now 33.33% which is correct. Sense the JAVA Script is basicly a NOP, this tells me that the PERCENT format requires some kind of trigger. Sense a FILL is NOT a trigger, the display comes out incorrect.

  • Question about table compression

    I administer several 10g databases, and have been asked to compress tables in several tablespaces. I am unfamiliar with using compression. I have read some Oracle documentation on the ALTER TABLE... MOVE COMPRESSION command, but still have several questions. Can anyone recommend a good white paper, or other documentation on how best to compress tables with existing data? Thank you in advance for your guidance!

    Basically, I have questions about how to select which tables will benefit from compression. I also read somewhere that, once a table has been compressed, new updates to the compressed data will not be compressed and so I will need to re-compress the tables periodically.
    I also needed to know if the ALTER TABLE statement will compress the existing data or just future inserted data. Through further research I found that by using the MOVE clause, it will compress the existing data. I will also need to rebuild the indexes once the ALTER TABLE statement is complete.
    Thank you for your help and encouragement!

  • Question about table DR$FND_LOBS_CTX$I

    All,
    I have questions about this table 'DR$FND_LOBS_CTX$I'
    1. What's the purpose of this table?
    2. Can we purge this table? How?
    3. Is there any harmful if purge this table?
    Thanks,
    Jackie

    I have questions about this table 'DR$FND_LOBS_CTX$I'
    1. What's the purpose of this table?There is no description about this table in MOS or eTRM -- http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=DR$FND_LOBS_CTX$I&c_owner=APPLSYS&c_type=TABLE
    You may also check the code in $FND_TOP/sql/aflobbld.sql
    2. Can we purge this table? How?
    3. Is there any harmful if purge this table?Please see these docs/links.
    FND_LOBS_CTX Is Having Huge Size, How To Reduce The Size Of The Index [ID 396803.1]
    http://oracle-apps-dba.blogspot.com/2008/07/how-to-enable-fndhelp-search-by.html
    If you could not find complete answers to your questions, I would suggest you log a SR.
    Thanks,
    Hussein

  • Simple question about table structure and HR in BW

    i need to following data from HR:
    current FTE, employee number, cost place
    i dont think the current FTE is stored per employee. Therefor is would need a list that contains:
    mutation start date, mutation end date, FTE, employee, cost place
    i think cost place is a custom field.
    my question : what tables names and field names do i need?
    Thanks in advanced

    Hi,
    For Head Count you can use 0HR_PA_0 datasource and the other Employee details like start date and end date you can get them from employee master data and FTE can be calculated from the Emloyee Master Data and Head count data.
    Hope this helps...
    Thanks,

  • Question about table/procedure being used by other objects

    Hi,
    I have a table xyz and a package abc. How can I check all sql scripts/objects/users that are using these objects (table xyz & package abc)?
    Neil

    Oh, and this is Oracke 10g running on AIX.

  • Question about 2 functions.

    OK, new question from me.
    I have two functions, bassicly they are smilar, but the problem is that I need that second function to start up or become active, after certain amount of time or when "x" reaches 1000. How can I do this?
    And second question is, both functions make objects apper on stage in exact coordinates (5 spots), how can I make that objects woun't apper on the same spot, bassicly it would check if that position is occupied, it chooses other spot. (spot choosing is performed by random)
    Oh, and third question.
    I want to make the object to be active for two seconds, and then it disapper, my thought was to make tween, but couldn't find the type of appearance.

    1. You can check the condition to determine if you should do something, i.e.
    if (x >= 1000) {
        // do something
    2. First randomise an Array [Spot 1, Spot 2, Spot 3, Spot 4, Spot 5], then place your object to the spot in the order of the array item.
    3. My favorite way is to use TweenLite.delayedCall(). For example if you want to remove something in 2 seconds time you do:
    TweenLite.delayedCall(2, remove, [anObject]);
    function remove(displayObject:DisplayObject):DisplayObject {
        return removeChild(displayObject);
    (You can use Timer class etc for this but TweenLite wins always )

Maybe you are looking for