SQL Statement in Program Unit (function)

When I tried to create a Program Unit(function) in the Form
module I have got an error
message "..identifier "SALES.USER_ADMIN" must be declared.."
How can I fixed it or may be some suggestions..
Thank you.
FUNCTION DEF_USER_STATUS (User_Name VARCHAR2)
RETURN VARCHAR2
IS
Security_Stat VARCHAR2(20);
BEGIN
SELECT ALL UPPER(SECURITY_STATUS)
INTO Security_Stat
FROM SALES.USER_ADMIN
WHERE LOGIN_NAME = :GLOBAL.LOGIN_NAME;
IF NO_DATA_FOUND THEN
Security_Stat := 'GUEST';
END IF;
RETURN Security_Stat;
END DEF_USER_STATUS;

Check if you are connected before compiling your function. The other thing you should check is if you have proper GRANTs to access tables under SALES schema.
Also, IF NO_DATA_FOUND is not the way to handle EXCEPTION. Code it as
EXCEPTION WHEN NO_DATA_FOUND THEN
END ;
Hope this helps.
Parag Kansara

Similar Messages

  • Problem calling program unit function in Forms 6i

    Hi,
    I'm new to programming with Oracle Forms. I have a question that I cannot seem to figure out. In Forms 6i, I have created a program unit function that compiles correctly. The trouble I'm having is calling it and displaying the function's contents into a non-database display item I created. When I run my app, the display item it blank while my other fields populate.
    I first tried to call it in a POST-QUERY trigger but I get an error stating "function cannot be called in SQL." Can you not call a function in a form's trigger? If so, what would be the correct syntax?
    Then I tried to call it in the non-database item's Calculation => Formula (property) by just stating the function_name(parameter). This appears to compile fine too, but still no display at runtime.
    What would be the best way to reference my function to display its contents properly? Does anyone have any examples? Any help would be greatly appreciated. Thank you.

    First, get rid of the
    EXCEPTION WHEN NO_DATA_FOUND
    in your function. Summary queries never raise no_data_found; They just return null.
    Your ":history.consecutive_years := NumberOfYears(:student.id);" is the proper way to call the function. That is what I was trying to tell you with the example: ':Myblock.Item_x := function_name(some_parm);' code
    If your post-query trigger only executes the function, then I think your problem is somewhere else:
    'FRM-40735 POST-QUERY trigger raised unhandled exception' looks like a problem elsewhere.
    Don't know of a good website. Just keep asking here -- somebody is bound to pop in and help you out.
    One more thing: drop this into your form-level on-error trigger. It often helps to find problems:
    -- On-error form-level trigger                                       --*
    DECLARE
      Err_Code NUMBER(5)     := ERROR_CODE;
      Err_Text VARCHAR2(100) := ERROR_TEXT;
      MSG      VARCHAR2(150)
              := SUBSTR('   '||ERROR_TYPE||'-'||TO_CHAR(Err_Code)||': '
                                         ||Err_Text,1,150);
      DBMS_TXT VARCHAR2(500);
    BEGIN
      IF Err_Code IN (40401,40405,     --No changes to save/apply
                      40100,40352) THEN --at first/last record
        MESSAGE(MSG,NO_ACKNOWLEDGE); -- Don't raise Form_Trigger_Failure
      ELSE -- all other messages
        -- check database error message --
        DBMS_TXT := SUBSTR(DBMS_ERROR_TEXT,1,500);
        if  DBMS_TXT is not null
        and substr(DBMS_TXT,5,5)
          not in('00000',
                 '01403') then --1403=no data found
          -- show entire msg, add new_line chars.
          DBMS_TXT := replace(DBMS_TXT,'ORA-',chr(10)||'ORA-');
          DBMS_TXT := replace(DBMS_TXT,' '||chr(10), chr(10));
          -- show MSG and DBMS_TXT both as an alert --
          --PLL_ALERT( ltrim(MSG) || DBMS_TXT );
          Message(ltrim(MSG) || DBMS_TXT );
          Message(' ',no_acknowledge);
          Raise Form_Trigger_Failure;
        else
          Message(MSG);
          Message(' ',no_acknowledge);
          Raise Form_Trigger_Failure;
        End if;
      END IF;
    END; -- end of on-error trigger

  • SQL Statement not works using functions or subqueries-MAXDB

    Hello All,
    I created an ABAP program to select information about country(table: T005) with the country names (Table: T005T). I tried to create a sql query with a sql subquery to select everything but for some reason that I don't know it doesn't work. Please find the query below.
    DATA:
    resu        TYPE REF TO cl_sql_result_set ,
    stmt         TYPE REF TO cl_sql_statement ,
    qury        TYPE string .
               qury  = `SELECT land1, spras, `
               &&       `(SELECT landx `
               &&         `FROM SAPNSP.T005T `
               &&         `WHERE mandt = '` && sy-mandt && `' `
               &&           `AND spras = 'EN' `
               &&           `AND land1 = ? ), `
               &&       `(SELECT natio `
               &&         `FROM SAPNSP.T005T `
               &&         `WHERE mandt = '` && sy-mandt && `' `
               &&           `AND spras = 'EN' `
               &&           `AND land1 = ? ) `
               &&        `FROM SAPNSP.T005 `
               &&        `WHERE mandt = '` && sy-mandt && `' `
               &&          `AND land1 = ? `
               &&        `GROUP BY land1, spras` .
    resu = stmt->execute_query( qury ) .
    Well, the query above works but the fields LANDX and NATIO are in blank in ALL THE CASES, even with information registred in table T005T.
    So, exploring the SDN forum and after read some documents regarding ADBC, I create a function to handle this sql select and get the correctly the missing informations, but, still don't work. Please find the function below:
    CREATE FUNCTION select_landx (land1 CHAR(3)) RETURNS CHAR(15)
    AS
      VAR landx CHAR(15);
      DECLARE functionresult CURSOR FOR
      SELECT spras, land1, landx
         FROM SAPNSP.t005t
         WHERE spras = 'EN'
             AND land1 = :land1;
         IF $count IS NULL THEN <- | $count is always 0, my SELECT
           BEGIN                                 it's not work but I don't know why
             CLOSE functionresult;
             RETURN NULL;
           END
         ELSE
           SET $rc = 0;
           WHILE $rc = 0 DO
           BEGIN
             FETCH functionresult INTO :landx;
           END;
         CLOSE functionresult;
         RETURN landx;
    Calling the function in a SQL statement:
    DATA:
    resu        TYPE REF TO cl_sql_result_set ,
    stmt         TYPE REF TO cl_sql_statement ,
    qury        TYPE string .
               qury  = `SELECT land1, spras, select_landx(?) landx `
               &&        `FROM SAPNSP.T005 `
               &&        `WHERE mandt = '` && sy-mandt && `' `
               &&          `AND land1 = ? `
               &&        `GROUP BY land1, spras` .
    resu = stmt->execute_query( qury ) .
    Any comments ?
    Best regards,
    Arthur Silva

    Hello,
    Thank's a lot, it works. It's funny because the given solution works using only abap codes.
    It may be happens because the abap interpretor send the sql statement to the db interface that handle the code in the another way.
    Thanks again, it was driving me crazy.
    Best regards,
    Arthur Silva

  • How to write the sql statement of my finder function in cmp?

    hi,
    I create a cmp ejb from table INFOCOLUMN,and I create a my finder function ,which sql statement is :
    select * from INFOCOLUMN WHERE employee_id=id
    employee_id is a column of the table,and id is the finder function parameter.
    The error is : invalid column name
    So,how to write the sql statement.
    Thanks .

    Mole-
    Bind variables are of the form $1, $2, etc., so your query stmt should look like:
    select * from INFOCOLUMN WHERE employee_id=$1
    -Jon

  • Preferred - PL/SQL library or Program Unit

    Hi all,
    Please tell me which is preferred - a procedure in an attached library or a program unit (forms program unit)
    And the reasons for it?
    Thanks
    Ranjan

    You can go for PL/SQL library, when two or more forms are accessing the same program unit. Otherwise u can have it in the program unit of the form itself. Performance wise, i dont think much difference will be there.

  • Can I have a SQL statement in a Custom Function in Crystal Reports 2008

    I'd like to create a custom Crystal Reports function which does a database lookup. Is this possible? In the pseudo code below "v_le_afe_xref" is a dataource in the report.  A syntax check fails on the select.
    Function legal_entity_co (old_co AS number) AS number
    SELECT v_le_afe_xref.NEW_BURKS FROM v_le_afe_xref WHERE old_co = v_le_afe_xref.OLD_BURKS
    END FUNCTION
    Thanks.

    Hi David,
    Not sure where you are trying to use the function but CR doesn't support Functions directly, this changes so try Service PAck 3 to see if it's been added. Try using a SQLExpression, and do not include a SELECT in the SQL or using a Command Object.
    You may be able to define it on the server and then call it from CR using a Command also.
    Thank you
    DOn

  • Can i use commit in between pl sql statements

    Hi,
    I have written program unit , in that I used insert statements and after that I used commit command.
    But in runtime it's getting oracle error unable to insert . because I used some non database items and database items
    so that it's coming error.
    But my question is , Can i use commit after executing some statements in program unit procedure.
    Thanks in advance.

    FORMS_DDL restrictions
    The statement you pass to FORMS_DDL may not contain bind variable references in the string, but the
    values of bind variables can be concatenated into the string before passing the result to FORMS_DDL.
    For example, this statement is not valid:
    Forms_DDL ('Begin Update_Employee (:emp.empno); End;');
    However, this statement is valid, and would have the desired effect:
    Forms_DDL ('Begin Update_Employee ('||TO_CHAR(:emp.empno)
    ||');End;');
    However, you could also call a stored procedure directly, using Oracle8's shared SQL area over
    multiple executions with different values for emp.empno:
    Update_Employee (:emp.empno);
    SQL statements and PL/SQL blocks executed using FORMS_DDL cannot return results to Form
    Builder directly.
    In addition, some DDL operations cannot be performed using FORMS_DDL, such as dropping a table
    or database link, if Form Builder is holding a cursor open against the object being operated upon.
    Sarah

  • Sql statement from abap query

    is there any chance to get the sql statement (not program) from any abap query created via SQ01?
    I can get the code of program that generated by system, but I cannot get pure sql statement.
    any answer will be appreciated

    I see no parameters, and in the abstract that SQL ought to work.
    However, I halfway suspect that either User, Users, Password, or pass is a reserved word and somebody is getting confused. Try renaming your columns and table...

  • String translation in program units

    Hi everyone, it is my first post.
    We are using TranslationHub to create an Spanish version of our application.
    We have a lot of strings that we use as messages when the form does validations; we want to translate those strings as well.
    Can Translation Hub extract strings from PL/SQL code as program unit or triggers code in a form?
    Thanks in advance.

    Translation Hub doesn't handle strings in PL/SQL code.
    And...
    It's not a good idea to use hardcoded strings in PL/SQL code.
    You should get those out of your code.

  • ORA-06508 PL/SQL: could not find program unit being

    Hi all,
    I'm having the following problem: I have a trigger that gets fired before update of a field. The trigger source code calls a function from a package. This function calls another function.
    When the trigger was executed I got the following error ORA-06508 PL/SQL: could not find program unit being call(referring to the second function called).
    This trigger works well, but from time to time gets this error. (The database has a lot of users and there is a chance that more users fire the same trigger).
    What can I do to solve this problem as it's very inconvenient? Any suggestions?
    Thanks.

    Try running the following query:
    select *
    from
    v$db_object_cache
    where sharable_mem > 10000
    and type in ('PACKAGE','PACKAGE BODY','FUNCTION','PROCEDURE')
    and KEPT='NO'
    order by sharable_mem desc
    See which objects are taking up a lot of SGA memory, you may need to pin them to prevent fragmentation. If you see DBMS_STATS in there it means that you Oracle is dynamically collecting stats which is not good - you need to set up a background task to do that.

  • PL/SQL: Could not find program unit being called: mydb.pkg_alert (newbie)

    This is my first attempt at a pretty in debt package. All the procedures and functions work successfully on their own. When i try and put them into a package and run the package, i get these errors?
    ORA-04063: package body "mydb.PKG_ALERT" has errors
    ORA-06508: PL/SQL: could not find program unit being called: "mydb.PKG_ALERT"
    ORA-06512: at line 6
    Here's my package:
    create or replace PACKAGE pkg_alert AS
    FUNCTION fcn_chck_dt(p_date date)
    RETURN VARCHAR2;
    FUNCTION fcn_chck_decline(p_date date)
    RETURN NUMBER;
    PROCEDURE sp_run_alert(p_date date);
    END pkg_monitor;
    Here's my package body code: Your assistance is greatly appreciated:
    create or replace
    PACKAGE BODY PKG_ALERT AS
    FUNCTION fcn_chck_dt(p_date date) return VARCHAR2 is
    --DECLARE
    v_table_name VARCHAR2(35);
         v_string VARCHAR2(1024);
         v_result number;
         v_output VARCHAR2(1024);
    v_date VARCHAR2(100);
    v_dt VARCHAR2(100);
         CURSOR c_table is
              select table_name
              from user_tab_columns
              where COLUMN_NAME = 'date'
              and table_name NOT LIKE '%BIN%';
         BEGIN
    OPEN c_table;
         loop
              FETCH c_table into v_table_name;
              exit when c_table%NOTFOUND;
              v_string:='select decode(to_date(max(date),''yyyymmdd''),'''||p_date||''',1,0)'|| ' from ' || v_table_name;
    execute immediate v_string into v_result;
    v_date:='select max(date)'|| ' from ' || v_table_name;
    execute immediate v_date into v_dt;
    if v_result=0 then
              v_output:=v_output||CRLF||v_table_name||': '||v_dt;
    end if;
    end loop;
    close c_table;
    return v_output;
    END fcn_chck_dt;
    FUNCTION fcn_chck_decline(p_date date) return NUMBER is
    --DECLARE
         v_dt NUMBER;
         v_active NUMBER;
         v_delta NUMBER;
         v_perc_delta NUMBER;
         v_old_s varchar2(1024);
         v_old_dt number;
         v_string varchar2(1024);
         v_result NUMBER;
         CURSOR c_prev IS
              select date,daily_active,
              daily_active-lag(daily_active) over(order by date),
              trunc(((daily_active-lag(daily_active) over(order by date))/daily_active)*100,2)
              from pop_stats
              where to_date(date,'YYYYMMDD') between p_date-1 and p_date
              order by date desc;
    ---bringing back two rows and all records on purpose.
         BEGIN
              OPEN c_prev;
              FETCH c_prev INTO v_dt,v_active,v_delta,v_perc_delta;
         close c_prev;
         v_old_s := 'select max(date) from alert_stats';
         execute immediate v_old_s into v_old_dt;
         if v_dt!=v_old_dt then
         insert into ALERT_stats(date,
                   daily_active,
                   daily_delta,
                   daily_delta_percent)
                        values(v_dt,
                        v_active,
                        v_delta,
                        v_perc_delta);
              end if;
         v_string:='select value from config_tbl where name=''decline''';
         execute immediate v_string into v_result;
         if v_perc_delta <= v_result then
         return v_perc_delta;
              end if;
         END fcn_chck_decline;
    PROCEDURE sp_run_alert(p_date date) IS
    --DECLARE
    v_result varchar2(1024);
    BEGIN
         insert into ALERT_stats(date)
    values(p_date);
    CRLF char(2) := chr(10)||chr(13);
    v_result :='';
    v_result := v_result||fcn_chck_dt(p_date);
    v_result := v_result||fcn_chck_decline(p_date);
    if v_result.length > 0 then
    utl_mail.send('alerts@localhost','[email protected]',NULL,NULL,
    'Alert','Alert Summary: '||v_result,'text/plain; charset=us-ascii',NULL);
    end if;
    END sp_run_alert;
    END PKG_ALERT;

    Take a look at the bolded sections of your code especialy the last line of your package spec
    create or replace PACKAGE pkg_alert AS
    FUNCTION fcn_chck_dt(p_date date)
    RETURN VARCHAR2;
    FUNCTION fcn_chck_decline(p_date date)
    RETURN NUMBER;
    PROCEDURE sp_run_alert(p_date date);
    END pkg_monitor;

  • Error : ORA-06508: PL/SQL: could not find program unit being called

    Hi
    I got surprise issue while testing my Oracle code . Let me explain first the environment detail . Our appliaction built on
    Java/J2EE(Weblogic) and backend is Oracle 11g re2 . While calling from java it call thru different user which have been provide
    synonym and exectue option for corresponding procdure ,
    I created on package EXTRACT_CUSTOMER_INFO_PK which will exract data to text file using UTL_FILE ( direcory , UTL_FILE grant is provided to DB user).
    Now this package has been called from rp_execute_procedure_pr -- Here I is the code
    CREATE OR REPLACE PROCEDURE RP_EXECUTE_PROCEDURE_PR
    i_atlas_job_schedule_fk IN atlas_job_schedule.atlas_job_schedule_pk%TYPE,
    i_job_id IN atlas_job.job_id%TYPE,
    i_parm_value IN atlas_job_schedule.parm_value%TYPE,
    o_status_code OUT NUMBER,
    o_status_mesg OUT VARCHAR2
    IS
    -------Other old code which is not relevent for this issue ----
    --------Other old code which is not relevent for this issue ----
    ----Below code I added ----
    ELSIF l_job_id = 'CUST_EXTRACT' THEN
    EXTRACT_CUSTOMER_INFO_PK.customer_report ( i_parm_value ,
                   o_status_code,
    o_status_mesg ) ;
    -- o_status_code := -99999999;
    --o_status_mesg := 'PARTHA PARTHA PARTHAcess terminated!';
    ELSE
    o_status_code := -20300;
    o_status_mesg := 'Job Id : ' || l_job_id || ' NOT found. Process terminated!';
    END IF;
    update_log_auto
    ajs_rec.atlas_job_schedule_pk ,
    'Processing End Time (GMT): '
    EXCEPTION
    WHEN eProcError THEN
    o_status_code := SQLCODE;
    o_status_mesg := SUBSTR(vMsg ||'-'||SQLERRM, 1, 200);
    WHEN OTHERS THEN
    o_status_code := -20300;
    o_status_mesg := SUBSTR(SQLERRM, 1, 200);
    update_log_auto
    ajs_rec.atlas_job_schedule_pk ,
    'Error : '||SQLERRM||' '
    update_log_auto
    ajs_rec.atlas_job_schedule_pk,
    'Processing End Time (GMT): '
    END RP_EXECUTE_PROCEDURE_PR;
    Now It compiled sucesfully . And while I did SIT then RP_EXECUTE_PROCEDURE_PR run fine and extracted txt file . But while I called it from Java procedure It gives us error like
    Error : ORA-06508: PL/SQL: could not find program unit being called 02-AUG-2012 13:16:51.
    As I told RP_EXECUTE_PROCEDURE_PR old proc and used by other proc , So I first suspect issue is newly added code or may be some grant or synonym ( Although it should not be )
    so I created public synony amd gave execute grant to my pkg to public .
    But it repeat same error .
    I did lot of R&D on my pkg but nothing happen . Finally I remane my new pkg RP_EXTRACT_CUSTOMER_INFO_PK and it works fine
    I need to know what is the RCA for it . I donot think any dependecy issue as renaming pkg is working fine .
    NB my DB user is iATLAS and Javauser is SUDEEP
    Thanks in Advance
    Debashis Mallick

    First of all If i run the main procedure in like below in my Schema it is working fine
    begin
    -- Call the procedure
    rp_execute_procedure_pr(i_atlas_job_schedule_fk => :i_atlas_job_schedule_fk,
    i_job_id => :i_job_id,
    i_parm_value => :i_parm_value,
    o_status_code => :o_status_code,
    o_status_mesg => :o_status_mesg);
    end;
    So thre is no question of parameter .... or Invalid state etc . If it is parameter or Invalid state issue it will give other error.
    Here problem is not syntax issue .
    let me give u more detail regards this issue
    1.. All objects corresponding to procedure all Valid
    2.. If I test on the proc on my schema like above code . It works fine
    3.rp_execute_procedure_pr is a old procudere which called for differner report generartion based on parameter passing . Also as extract_customer_info_pk called with in rp_execute_procedure_pr So there is no question of synonym or privilage issue for new procedure.
    4. Suprising thing is if I rename and recreate package like extract_customer_info_pk _1 or rp_extract_customer_info_pk . Which are exactly same as extract_customer_info_pk and replace those new one with extract_customer_info_pk then it work fine in my java application
    I think I make it clear the issue
    Edited by: debashisora on Aug 3, 2012 5:31 AM
    Edited by: debashisora on Aug 3, 2012 5:40 AM

  • 11.5.10.2 to R12.1.1 upgrade: Error loading seed data for GL_DEFAS_ACCESS_SETS:  DEFINITION_ACCESS_SET = SUPER_USER_DEFAS,  ORA-06508: PL/SQL: could not find program unit being called

    Hello,
    EBS version : 11.5.10.2
    DB version : 11.2.0.3
    OS version : AIX 6.1
    As a part of 11.5.10.2 to R12.1.1 upgrade, while applying merged 12.1.1 upgrade driver(u6678700.drv), we got below error :
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ATTENTION: All workers either have failed or are waiting:
               FAILED: file glsupdas.ldt on worker  3.
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    drix10:/fmstop/r12apps/apps/apps_st/appl/admin/FMSTEST/log>tail -20 adwork003.log
    Restarting job that failed and was fixed.
    Time when worker restarted job: Wed Aug 07 2013 10:36:14
    Loading data using  FNDLOAD function.
    FNDLOAD APPS/***** 0 Y UPLOAD @SQLGL:patch/115/import/glnlsdas.lct @SQLGL:patch/115/import/US/glsupdas.ldt -
    Connecting to APPS......Connected successfully.
    Calling FNDLOAD function.
    Returned from FNDLOAD function.
    Log file: /fmstop/r12apps/apps/apps_st/appl/admin/FMSTEST/log/US_glsupdas_ldt.log
    Error calling FNDLOAD function.
    Time when worker failed: Wed Aug 07 2013 10:36:14
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    drix10:/fmstop/r12apps/apps/apps_st/appl/admin/FMSTEST/log>tail -20 US_glsupdas_ldt.log
    Current system time is Wed Aug  7 10:36:14 2013
    Uploading from the data file /fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/import/US/glsupdas.ldt
    Altering database NLS_LANGUAGE environment to AMERICAN
    Dumping from LCT/LDT files (/fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/import/glnlsdas.lct(120.0), /fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/import/US/glsupdas.ldt) to staging tables
    Dumping LCT file /fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/import/glnlsdas.lct(120.0) into FND_SEED_STAGE_CONFIG
    Dumping LDT file /fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/import/US/glsupdas.ldt into FND_SEED_STAGE_ENTITY
    Dumped the batch (GL_DEFAS_ACCESS_SETS SUPER_USER_DEFAS , GL_DEFAS_ACCESS_SETS SUPER_USER_DEFAS ) into FND_SEED_STAGE_ENTITY
    Uploading from staging tables
      Error loading seed data for GL_DEFAS_ACCESS_SETS:  DEFINITION_ACCESS_SET = SUPER_USER_DEFAS,  ORA-06508: PL/SQL: could not find program unit being called
    Concurrent request completed
    Current system time is Wed Aug  7 10:36:14 2013
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    Below is info about file versions and INVALID packages related to GL.
    PACKAGE BODY GL_DEFAS_ACCESS_SETS_PKG is invalid with error component 'GL_DEFAS_DBNAME_S' must be declared.
    I can see GL_DEFAS_DBNAME_S is a VALID sequence accessible by apps user with or without specifying GL as owner.
    SQL> select text from dba_source where name in ('GL_DEFAS_ACCESS_DETAILS_PKG','GL_DEFAS_ACCESS_SETS_PKG') and line=2;
     TEXT
    /* $Header: glistdds.pls 120.4 2005/05/05 01:23:16 kvora ship $ */
    /* $Header: glistddb.pls 120.16 2006/04/10 21:28:48 cma ship $ */
    /* $Header: glistdas.pls 120.4 2005/05/05 01:23:02 kvora ship $ */
    /* $Header: glistdab.pls 120.5 2006/03/13 19:56:21 cma ship $ */ 
    SQL> select * from all_objects where object_name in ('GL_DEFAS_ACCESS_DETAILS_PKG','GL_DEFAS_ACCESS_SETS_PKG')
      2 ; OWNER OBJECT_NAME SUBOBJECT_NAM OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE CREATED LAST_DDL_TIME TIMESTAMP STATUS T G S NAMESPACE
    EDITION_NAME
    APPS GL_DEFAS_ACCESS_DETAILS_PKG 1118545 PACKAGE 05-AUG-13 05-AUG-13 2013-08-05:18:54:51 VALID N N N 1 
    APPS GL_DEFAS_ACCESS_SETS_PKG 1118548 PACKAGE 05-AUG-13 06-AUG-13 2013-08-05:18:54:51 VALID N N N 1 
    APPS GL_DEFAS_ACCESS_SETS_PKG 1128507 PACKAGE BODY 05-AUG-13 06-AUG-13 2013-08-06:12:56:50 INVALID N N N 2 
    APPS GL_DEFAS_ACCESS_DETAILS_PKG 1128508 PACKAGE BODY 05-AUG-13 05-AUG-13 2013-08-05:19:43:51 VALID N N N 2 
    SQL> select * from all_objects where object_name='GL_DEFAS_DBNAME_S'; OWNER OBJECT_NAME SUBOBJECT_NAM OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE CREATED LAST_DDL_TIME TIMESTAMP STATUS T G S NAMESPACE
    EDITION_NAME
    GL GL_DEFAS_DBNAME_S 1087285 SEQUENCE 05-AUG-13 05-AUG-13 2013-08-05:17:34:43 VALIDN N N 1 
    APPS GL_DEFAS_DBNAME_S 1087299 SYNONYM 05-AUG-13 05-AUG-13 2013-08-05:17:34:43 VALIDN N N 1 
    SQL> conn apps/apps
    Connected.
    SQL> SELECT OWNER, OBJECT_NAME, OBJECT_TYPE, STATUS
    FROM DBA_OBJECTS
    WHERE OBJECT_NAME = 'GL_DEFAS_ACCESS_SETS_PKG'; 2 3 OWNER OBJECT_NAME OBJECT_TYPE STATUS
    APPS GL_DEFAS_ACCESS_SETS_PKG PACKAGE VALID
    APPS GL_DEFAS_ACCESS_SETS_PKG PACKAGE BODY INVALID SQL> ALTER PACKAGE GL_DEFAS_ACCESS_SETS_PKG COMPILE; Warning: Package altered with compilation errors. SQL> show error
    No errors.
    SQL> ALTER PACKAGE GL_DEFAS_ACCESS_SETS_PKG COMPILE BODY; Warning: Package Body altered with compilation errors. SQL> show error
    Errors for PACKAGE BODY GL_DEFAS_ACCESS_SETS_PKG: LINE/COL ERROR
    39/17 PLS-00302: component 'GL_DEFAS_DBNAME_S' must be declared 
    drix10:/fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/odf>cat $GL_TOP/patch/115/sql/glistdab.pls|grep -n GL_DEFAS_DBNAME_S
    68: SELECT GL.GL_DEFAS_DBNAME_S.NEXTVAL
    81: fnd_message.set_token('SEQUENCE', 'GL_DEFAS_DBNAME_S');
    SQL> show user
    USER is "APPS"
    SQL> SELECT GL.GL_DEFAS_DBNAME_S.NEXTVAL
      FROM dual; 2                         -- with GL.
      NEXTVAL
      1002
    SQL> SELECT GL_DEFAS_DBNAME_S.NEXTVAL from dual;               --without GL. or using synonym.
      NEXTVAL
      1003
    drix10:/fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/odf>strings -a $GL_TOP/patch/115/sql/glistdab.pls|grep '$Header'
    REM | $Header: glistdab.pls 120.5 2006/03/13 19:56:21 cma ship $ |
    /* $Header: glistdab.pls 120.5 2006/03/13 19:56:21 cma ship $ */
    drix10:/fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/odf>strings -a $GL_TOP/patch/115/sql/glistdas.pls |grep '$Header'
    REM | $Header: glistdas.pls 120.4 2005/05/05 01:23:02 kvora ship $ |
    /* $Header: glistdas.pls 120.4 2005/05/05 01:23:02 kvora ship $ */

  • Created below function (program units) in report builder

    hi all,
    I created below function (program units) in report builder and added two insert statements to know how much time it is taking to execute.Report is executing successfully but no rows inserted into tale testtime.
    Is there any other way to know the execution time of this function.
    Please help me
    function CF_TYPEFormula return Char is
    begin
         insert into testtime values(sysdate,1,'CF_TYPEFormula');
      IF(:CATG0=1)
           THEN RETURN ('MOVING STOCK');
           insert into testtime values(sysdate,1,'CF_TYPEFormula');
      ELSE RETURN('NON-MOVING STOCK');
      END IF;
      insert into testtime values(sysdate,1,'CF_TYPEFormula');
      commit;
    end;Edited by: maddy on 26 Dec, 2011 8:46 PM
    Edited by: maddy on 29 Dec, 2011 9:25 PM

    Shashank,
    Try,
    function CF_TYPEFormula return Char is
    Str_Ret_Val VARCHAR2(100);
    BEGIN
       INSERT INTO TESTTIME VALUES(SYSDATE, 1, 'CF_TYPEFormula');
       IF(:CATG0=1) THEN
          Str_Ret_Val := 'MOVING STOCK';
          INSERT INTO TESTTIME VALUES(SYSDATE, 1, 'CF_TYPEFormula');
       ELSE
          Str_Ret_Val := 'NON-MOVING STOCK';
       END IF;
       INSERT INTO TESTTIME VALUES(SYSDATE, 1, 'CF_TYPEFormula');
       COMMIT;
       RETURN Str_Ret_Val;
    END;Regards,
    Manu.

  • How call Recursiving Program Units in Pl/Sql

    I need call a program unit to resolve a matematical equation,
    but the equation can have a part where the same proccess is
    call, then creating a cascate in the proccess, Ex:
    Equation A : "1 + 2 + 3 + %0002
    %0001 is the Equation B where :
    Equation B : "3 + %0003 + 5
    %0003 is the Equation C where :
    Equation B : "2 + %000n + 4
    %000n is the Equation n where ...
    Wich i resolve this recursive problem ?????????
    null

    Danilo Mozeli Dumont (guest) wrote:
    : I need call a program unit to resolve a matematical equation,
    : but the equation can have a part where the same proccess is
    : call, then creating a cascate in the proccess, Ex:
    : Equation A : "1 + 2 + 3 + %0002
    : %0001 is the Equation B where :
    : Equation B : "3 + %0003 + 5
    : %0003 is the Equation C where :
    : Equation B : "2 + %000n + 4
    : %000n is the Equation n where ...
    : Wich i resolve this recursive problem ?????????
    Danilo bom dia , creio que este mundo est_ realmente ficando
    muito pequeno . Acho que seu exemplo no est_ correto , creio
    que na equao A voc
    quiz dizer " %0002 is the equation B
    where " . Estou certo ??
    Nunca vi este tipo de problema mas eu tentaria colocando a
    Program Unit na base de Dados como um PL/Sql e chamaria sua
    execuo dentro de uma program unit do Forms coordenando a
    execuo . No caso creio que uma Function seria mais indicada.
    Tudo depende      claro de onde voc
    vai querer colocar esta
    function.Talvez voc
    no saiba o momento de cham_-la pois
    desconhece o nmero de elementos da sua equao .
    Emfim , boa sorte .
    Lourival
    null

Maybe you are looking for

  • In import GRN - excise duty is wrongly updating..

    hi frnds.. In import GRN - excise duty is wrongly updating.. How to resolve this... Regards Raghav.KH

  • How to manually delete Po at header level ?

    Hi, I can delete PO line items in my ECC60 system However, i would like to delete PO at header level. In EKKO , i can see the deletion flag in LOEKZ field. BUT in ME22N, i cannot find any button to delete PO at header level... Could somebody clarify

  • How Do You Create Artist Separation In iTunes Playlists?

    I find that some of the time the same artist will play back to back in my Playlists on iTunes. How do you adjust 'Playlists" to NOT play artists back to back and give the playlist "artist seperation? Thanks!

  • I want to see more 'favorite pages' in my toolbar!

    I want to double my toolbar because I want to see all my icons from favorite pages.

  • Unacceptably large pdf file

    My first project with Pages is a rather modest 7 page document containing around 15 photos from iPhoto. The Pages source document is less than 2 Mb. My intention is to generate a pdf which I could email but the resulting pdf is over 26 Mb! (I have us