EBS ISG using custom PL/SQL functions that return XMLType

Hi,
We have a custom PL/SQL package that we use for interfacing systems and some of the functions in this package ruturn an XMLType. We want to deploy the package functions as web services through the ISG, but it is not working as expected. When deployed through the ISG, the functions with XMLType return type produce a null response from the ISG (they work fine when called in SQL or PL/SQL; functions with non-XMLTypes work fine).
If we change the return type to CLOB (and use getClobVal() on the XMLType) then we get a response from the ISG, but it changes all the angle-brackets in the CLOB (which is still arbitrary XML text) to < > ...
What is the proper way to get the complex XMLType output through the ISG? Anyone have any more experience?
Thanks,
--Walt                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Alex,
For the predicate groups that are indexed/stored, the exact operator types (as in equality, inequality, like etc) that are indexed are specified while assigning the default index parameters. In the following example, exf$indexoper is used to specify the list of indexed operators.
BEGIN
  DBMS_EXPFIL.DEFAULT_INDEX_PARAMETERS('Car4Sale',
    exf$attribute_list (
       exf$attribute (attr_name => 'HorsePower(Model, Year)',
                      attr_oper => exf$indexoper('=','<','>','>=','<='),
                      attr_indexed => 'FALSE')    --- stored predicate group
END;
/You can find more information about exf$indexoper at
http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/t_expfilobj.htm#ARPLS153
Could you confirm that you chose to index 'is null' and 'is not null' while assigning the default index parameters ? This information is available in OPERATOR_LIST column of the USER_EXPFIL_DEF_INDEX_PARAMS view.
Hope this helps,
-Aravind.

Similar Messages

  • Deploy resulset of PL\SQL function, that returns ANYTABLE%TYPE

    How can deploy resulset of PL\SQL function, that returns ANYTABLE%TYPE in SQL?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by angelrip:
    Hello everyone,
    I've come through the following problem:
    1.- I created an PL/SQL stored procedure which returns a REF CURSOR element, definition looks like this:
    PACKAGE PKG_LISTADOS AS
    TYPE tuplas IS REF CURSOR;
    /* Procedimientos exportados por el paquete */
    PROCEDURE inicializarModuloListados;
    FUNCTION recaudacionUltimoMes(medioPago DEF_MEDIO_PAGO.MEDIO_PAGO%TYPE)
    RETURN tuplas;
    2.- Now I would like to call the stored procedure and retrieve the PL/SQL cursor as a ResultSet Java Object. The code I wrote is this:
    Connection conn;
    XmlDocument paramDef;
    conn=poolMgr.getConnection str_poolDBConnection);
    try
    CallableStatement cstmt=conn.prepareCall("{?=call PKG_LISTADOS.recaudacionUltimoMes(?)}");
    cstmt.registerOutParameter(1, java.sql.Types.OTHER);
    cstmt.setString(2, "MONEDA");
    cstmt.executeQuery();
    ResultSet rs=(ResultSet)cstmt.getObject(1);
    catch(SQLException sqlE)
    3.- However, I can't make it OK, all the time I get the following error:
    SQL Error(17004), java.sql.SQLException: Non valid column type
    May anyone help me with this, thanks in advance:
    Miguel-Angel<HR></BLOCKQUOTE>
    Do something like the following:
    cstmt = conn.prepareCall("{call customer_proc(?, ?)}");
    //Set the first parameter
    cstmt.setInt(1, 40);
    //Register to get the Cursor parameter back from the procedure
    cstmt.registerOutParameter(2, OracleTypes.CURSOR);
    cstmt.execute();
    ResultSet cursor = ((OracleCallableStatement)cstmt).getCursor(2);
    while(cursor.next())
    System.out.println("CUSTOMER NAME: " + cursor.getString(1));
    System.out.println("CUSTOMER AGE: " + cursor.getInt(2));
    cursor.close();
    null

  • SOLVED: How can I use or call a function that returns %ROWTYPE?

    Hi
    edit: you can probably skip all this guff and go straight to the bottom...In the end this is probably just a question of how to use a function that returns a %rowtype.  Thanks.
    Currently reading Feuerstein's tome, 5th ed. I've downloaded and run the file genaa.sp, which is a code generator. Specifically, you feed it a table name and it generates code (package header and package body) that will create a cache of the specified table's contents.
    So, I ran:
    HR@XE> @"C:\Documents and Settings\Jason\My Documents\Work\SQL\OPP5.WEB.CODE\OPP5.WEB.CODE\genaa.sp"
    749  /
    Procedure created.
    HR@XE> exec genaa('EMPLOYEES');which generated a nice bunch of code, viz:
    create or replace package EMPLOYEES_cache is
        function onerow ( EMPLOYEE_ID_in IN HR.EMPLOYEES.EMPLOYEE_ID%TYPE) return HR.EMPLOYEES%ROWTYPE;
        function onerow_by_EMP_EMAIL_UK (EMAIL_in IN HR.EMPLOYEES.EMAIL%TYPE) return HR.EMPLOYEES%ROWTYPE;
        procedure test;
    end EMPLOYEES_cache;
    create or replace package body EMPLOYEES_cache is
        TYPE EMPLOYEES_aat IS TABLE OF HR.EMPLOYEES%ROWTYPE INDEX BY PLS_INTEGER;
        EMP_EMP_ID_PK_aa EMPLOYEES_aat;
        TYPE EMP_EMAIL_UK_aat IS TABLE OF HR.EMPLOYEES.EMPLOYEE_ID%TYPE INDEX BY HR.EMPLOYEES.EMAIL%TYPE;
        EMP_EMAIL_UK_aa EMP_EMAIL_UK_aat;
        function onerow ( EMPLOYEE_ID_in IN HR.EMPLOYEES.EMPLOYEE_ID%TYPE)
            return HR.EMPLOYEES%ROWTYPE is
            begin
                return EMP_EMP_ID_PK_aa (EMPLOYEE_ID_in);
            end;
        function onerow_by_EMP_EMAIL_UK (EMAIL_in IN HR.EMPLOYEES.EMAIL%TYPE)
            return HR.EMPLOYEES%ROWTYPE is
            begin
                return EMP_EMP_ID_PK_aa (EMP_EMAIL_UK_aa (EMAIL_in));
            end;
        procedure load_arrays is
            begin
                FOR rec IN (SELECT * FROM HR.EMPLOYEES)
                LOOP
                    EMP_EMP_ID_PK_aa(rec.EMPLOYEE_ID) := rec;
                    EMP_EMAIL_UK_aa(rec.EMAIL) := rec.EMPLOYEE_ID;
                end loop;
            END load_arrays;
        procedure test is
            pky_rec HR.EMPLOYEES%ROWTYPE;
            EMP_EMAIL_UK_aa_rec HR.EMPLOYEES%ROWTYPE;
            begin
                for rec in (select * from HR.EMPLOYEES) loop
                    pky_rec := onerow (rec.EMPLOYEE_ID);
                    EMP_EMAIL_UK_aa_rec := onerow_by_EMP_EMAIL_UK (rec.EMAIL);
                    if rec.EMPLOYEE_ID = EMP_EMAIL_UK_aa_rec.EMPLOYEE_ID then
                        dbms_output.put_line ('EMP_EMAIL_UK  lookup OK');
                    else
                        dbms_output.put_line ('EMP_EMAIL_UK  lookup NOT OK');
                    end if;
                end loop;
            end test;
        BEGIN
            load_arrays;
        end EMPLOYEES_cache;
    /which I have run successfully:
    HR@XE> @"C:\Documents and Settings\Jason\My Documents\Work\SQL\EMPLOYEES_CACHE.sql"
    Package created.
    Package body created.I am now trying to use the functionality within the package.
    I have figured out that the section
        BEGIN
            load_arrays;
        end EMPLOYEES_cache;
    /is the initialization section, and my understanding is that this is supposed to run when any of the package variables or functions are referenced. Is that correct?
    With that in mind, I'm trying to call the onerow() function, but it's not working:
    HR@XE> select onerow(100) from dual;
    select onerow(100) from dual
    ERROR at line 1:
    ORA-00904: "ONEROW": invalid identifier
    HR@XE> select employees_cache.onerow(100) from dual;
    select employees_cache.onerow(100) from dual
    ERROR at line 1:
    ORA-06553: PLS-801: internal error [55018]
    HR@XE> select table(employees_cache.onerow(100)) from dual;
    select table(employees_cache.onerow(100)) from dual
    ERROR at line 1:
    ORA-00936: missing expressionHe provides the code genaa.sp, and a very brief description of what it does, but doesn't tell us how to run the generated code!
    Now, I have just done some googling, and it seems that what I am trying to do isn't possible. Apparently %ROWTYPE is PL/SQL, and not understood by SQL, so you can't call onerow() from sql. Correct?
    So I try wrapping the call in an exec:
    HR@XE> exec select employees_cache.onerow(100) from dual;
    BEGIN select employees_cache.onerow(100) from dual; END;
    ERROR at line 1:
    ORA-06550: line 1, column 30:
    PLS-00382: expression is of wrong type
    ORA-06550: line 1, column 7:
    PLS-00428: an INTO clause is expected in this SELECT statement
    HR@XE> exec select table(employees_cache.onerow(100)) from dual;
    BEGIN select table(employees_cache.onerow(100)) from dual; END;
    ERROR at line 1:
    ORA-06550: line 1, column 14:
    PL/SQL: ORA-00936: missing expression
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
    HR@XE> exec employees_cache.onerow(100)
    BEGIN employees_cache.onerow(100); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00221: 'ONEROW' is not a procedure or is undefined
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignoredNo joy.
    Of course, now that I'm looking at it again, it seems that the way to go is indicated by the first error:
    PLS-00428: an INTO clause is expected in this SELECT statement
    So am I supposed to create a type of EMPLOYEES%ROWTYPE in a PL/SQL procedure, and the idea of this code, is that the first call to onerow() runs the initialiation code, which populates the cache, and all subsequent calls to onerow() (whether by my session or any other) will use the cache?
    I've had a stab at this, but still, no joy:
    create or replace procedure testcache is
        emp employees%rowtype;
        begin
            select employees_cache.onerow(100) from dual into emp;
            dbms_output.put_line('Emp id: ' || emp.employee_id);
        end testcache;
    show errors
    HR@XE> @testcache.sql
    Warning: Procedure created with compilation errors.
    Errors for PROCEDURE TESTCACHE:
    LINE/COL ERROR
    4/9      PL/SQL: SQL Statement ignored
    4/54     PL/SQL: ORA-00933: SQL command not properly ended
    HR@XE>Have a feeling this should be really easy. Can anybody help?
    Many thanks in advance.
    Jason
    Edited by: 942375 on 08-Feb-2013 11:45

    >
    Ha, figured it out
    >
    Hopefully you also figured out that the example is just that: a technical example of how to use certain Oracle functionality. Unfortunately it is also an example of what you should NOT do in an actual application.
    That code isn't scaleable, uses expensive PGA memory, has no limit on the amount of memory that might be used and, contrary to your belief will result in EVERY SESSION HAVING ITS OWN CACHE of exactly the same data if the session even touches that package.
    Mr. Feuerstein is an expert in SQL and PL/SQL and his books cover virtually all of the functionality available. He also does an excellent job of providing examples to illustrate how that functionality can be combined and used. But the bulk of those examples are intended solely to illustrate the 'technical' aspects of the technology. They do not necessarily reflect best practices and they often do not address performance or other issues that need to be considered when actually using those techniques in a particular application. The examples show WHAT can be done but not necessarily WHEN or even IF a given technique should be used.
    It is up to the reader to learn the advantages and disadvantages of each technicalogical piece and determine when and how to use them.
    >
    Now, I have just done some googling, and it seems that what I am trying to do isn't possible. Apparently %ROWTYPE is PL/SQL, and not understood by SQL, so you can't call onerow() from sql. Correct?
    >
    That is correct. To be used by SQL you would need to create SQL types using the CREATE TYPE syntax. Currently that syntax does not support anything similar to %ROWTYPE.
    >
    So am I supposed to create a type of EMPLOYEES%ROWTYPE in a PL/SQL procedure, and the idea of this code, is that the first call to onerow() runs the initialiation code, which populates the cache, and all subsequent calls to onerow() (whether by my session or any other) will use the cache?
    >
    NO! That is a common misconception. Each session has its own set of package variables. Any session that touches that package will cause the entire EMPLOYEES table to be queried and stored in a new associative array specifically for that session.
    That duplicates the cache for each session using the package. So while there might be some marginal benefit for a single session to cache data like that the benefit usually disappears if multiple sessions are involved.
    The main use case that I am aware of where such caching has benefit is during ETL processing of staged data when the processing of each record is too complex to be done in SQL and the records need to be BULK loaded and the data manipulated in a loop. Then using an associative array as a lookup table to quickly get a small amount of data can be effective. And if the ETL procedure is being processed in parallel (meaning different sessions) then for a small lookup array the additional memory use is tolerable.
    Mitigating against that is the fact that:
    1. Such frequently used data that you might store in the array is likely to be cached by Oracle in the buffer cache anyway
    2. Newer versions of Oracle now have more than one cache
    3. The SQL query needed to get the data from the table will use a bind variable that eliminates repeated hard parsing.
    4. The cursor and the buffer caches ARE SHARED by multiple sessions globally.
    So the short story is that there would rarely be a use case where ARRAYs like that would be preferred over accessing the data from the table.

  • Stored PL/SQL function that returns REF CURSOR type

    Hello everyone,
    I've come through the following problem:
    1.- I created an PL/SQL stored procedure which returns a REF CURSOR element, definition looks like this:
    PACKAGE PKG_LISTADOS AS
    TYPE tuplas IS REF CURSOR;
    /* Procedimientos exportados por el paquete */
    PROCEDURE inicializarModuloListados;
    FUNCTION recaudacionUltimoMes(medioPago DEF_MEDIO_PAGO.MEDIO_PAGO%TYPE)
    RETURN tuplas;
    2.- Now I would like to call the stored procedure and retrieve the PL/SQL cursor as a ResultSet Java Object. The code I wrote is this:
    Connection conn;
    XmlDocument paramDef;
    conn=poolMgr.getConnection str_poolDBConnection);
    try
    CallableStatement cstmt=conn.prepareCall("{?=call PKG_LISTADOS.recaudacionUltimoMes(?)}");
    cstmt.registerOutParameter(1, java.sql.Types.OTHER);
    cstmt.setString(2, "MONEDA");
    cstmt.executeQuery();
    ResultSet rs=(ResultSet)cstmt.getObject(1);
    catch(SQLException sqlE)
    3.- However, I can't make it OK, all the time I get the following error:
    SQL Error(17004), java.sql.SQLException: Non valid column type
    May anyone help me with this, thanks in advance:
    Miguel-Angel

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by angelrip:
    Hello everyone,
    I've come through the following problem:
    1.- I created an PL/SQL stored procedure which returns a REF CURSOR element, definition looks like this:
    PACKAGE PKG_LISTADOS AS
    TYPE tuplas IS REF CURSOR;
    /* Procedimientos exportados por el paquete */
    PROCEDURE inicializarModuloListados;
    FUNCTION recaudacionUltimoMes(medioPago DEF_MEDIO_PAGO.MEDIO_PAGO%TYPE)
    RETURN tuplas;
    2.- Now I would like to call the stored procedure and retrieve the PL/SQL cursor as a ResultSet Java Object. The code I wrote is this:
    Connection conn;
    XmlDocument paramDef;
    conn=poolMgr.getConnection str_poolDBConnection);
    try
    CallableStatement cstmt=conn.prepareCall("{?=call PKG_LISTADOS.recaudacionUltimoMes(?)}");
    cstmt.registerOutParameter(1, java.sql.Types.OTHER);
    cstmt.setString(2, "MONEDA");
    cstmt.executeQuery();
    ResultSet rs=(ResultSet)cstmt.getObject(1);
    catch(SQLException sqlE)
    3.- However, I can't make it OK, all the time I get the following error:
    SQL Error(17004), java.sql.SQLException: Non valid column type
    May anyone help me with this, thanks in advance:
    Miguel-Angel<HR></BLOCKQUOTE>
    Do something like the following:
    cstmt = conn.prepareCall("{call customer_proc(?, ?)}");
    //Set the first parameter
    cstmt.setInt(1, 40);
    //Register to get the Cursor parameter back from the procedure
    cstmt.registerOutParameter(2, OracleTypes.CURSOR);
    cstmt.execute();
    ResultSet cursor = ((OracleCallableStatement)cstmt).getCursor(2);
    while(cursor.next())
    System.out.println("CUSTOMER NAME: " + cursor.getString(1));
    System.out.println("CUSTOMER AGE: " + cursor.getInt(2));
    cursor.close();
    null

  • Subquery not allowed - PL/SQL Function Body returning bolean

    Is subquery is not allowed in PL/SQL Expresion.????
    I am using the following query in one of my derived report column but I am getting the error.
    BEGIN
    if :COL1<>'abc' and :COL2 in (select deptno from dept1) then
    return 1;
    elsif :COL1<>'abc' and :COL2 in (select deptno from dept2) then
    return 0;
    elsif :COL1<>'abc' and :COL2 in (select deptno from dept3) then
    return 1;
    else
    return 0;
    end if;
    END;
    secondly CAN I use return value such as 'ABC' or 'XYZ' other than 0,1.
    Error-
    Invalid function body condition: ORA-06550: line 4, column 8: PLS-00405: subquery not allowed in this context ORA-06550: line 2, column 3: PL/SQL: Statement ignored
    -----------------

    Hi Deepak,
    There are at least methods.
    1 - You could create a SQL function that returned 0 or 1 and use that in your statement
    2 - You could use a CASE clause in the SQL statement
    As I don't have your dept1/2/3 tables, I've tried the following on the sample EMP/DEPT tables:
    SELECT EMPNO,
    ENAME,
    SAL,
    COMM,
    DEPTNO,
    CASE WHEN DEPTNO IN (SELECT DEPTNO FROM DEPT) THEN
      CASE WHEN ENAME LIKE '%A%' THEN NVL(SAL,0) + NVL(COMM,0) ELSE 456 END
    ELSE
       CASE WHEN DEPTNO NOT IN (SELECT DEPTNO FROM DEPT) THEN
         CASE WHEN ENAME LIKE '%A%' THEN NVL(SAL,0) + NVL(COMM,0) ELSE 123 END
       ELSE
         789
       END
    END "TOTAL"
    FROM EMPThis returns the values I expect:
    EMPNO     ENAME     SAL     COMM     DEPTNO     TOTAL
    7936     ATD     3000     -      40     3000
    7958     dino4     -      -      -      789
    7839     KINGS     5000     -      40     456
    7698     BLAKES     2850     -      30     2850
    7782     CLARK     2450     -      10     2450
    7566     JONES     2975     -      30     456
    7788     SCOTT     3000     -      20     456
    7902     FORD     3000     -      40     456
    7369     SMITH     800     -      20     456
    7499     ALLEN     1600     300     30     1900Obviously, you may have to experiment with the various CASE statements, but it will work using just a sql select statement.
    Andy

  • Error in report when executing pl/sql function body returning sql query.

    Hi,
    I have used the pl/sql function body returning sql query for creating a report. I have created a datepicker(
    P10_TASK_DATE) which can be submitted.The code is as below
    DECLARE
    v_sql varchar2(3000);
    BEGIN
    if :P10_TASK_DATE is not null THEN
    v_sql:='select
          * from tasks';
    return v_sql;
    else
    v_sql:='select * from discovery';
    return v_sql;
    END IF;
    END;if the date field is empty "select * from discovery" is executed and report is getting generated. But when we give a
    date using date picker the page is submitted and i get "report error: ORA-01403: no data found" even
    though the "tasks" table has data in it. Plz help
    Thanks,
    TJ

    hi
    Please try this
    1. Create 2 region
    1st region source=
    select * from tasks'
    go to the tab -> condition =
    item NOT NULL
    EXpression1 =:P10_TASK_DATE
    this will run whenever the item have any date
    2. open your 2 nd region source code= select * from discovery
    put the condition
    item is  NULL
    EXpression1 =:P10_TASK_DATE
    thanks
    Mark Wyatt

  • How to use a select list value in a PL/SQL function body returning SQLquery

    Hi Friends,
    I have a select list P6_TEST with values 'nav' anf 'jyo'. I am trying to create a report using "SQL Query (PL/SQL
    function body returning SQL query)". In my report query can i check if P6_TEST='nav' and do something like the
    code shown below.How can i do that.
    DECLARE
    v_sql VARCHAR2(3000);
    BEGIN
    IF :P6_TEST = 'nav' THEN
    v_sql :=
    'SELECT
    * from department';
    ........................Thanks,
    Nav

    Nav:
    What you have should work. Give it a go. Post back if you run into issues.
    Varad

  • Custom PL/SQL API that inserts the data into a custom interface table.

    We are developing a custom Web ADI integrator for importing suppliers into Oracle.
    The Web ADI interface is a custom PL/SQL API that inserts the data into a custom interface table. We have defined the content, uploader and an importer. The importer is again a custom PL/SQL API that will process the records inserted into the custom table and updates the STATUS column of the custom interface table. We want to show the status column back on the spreadsheet.
    Defined the 'Document Row' import rule and added the rows that would identify the unique record.
    Errored row import rule, we are using a SELECT * from custom_table where status<>'Success' and vendor_name=$param$.vendor_name
    The source of this parameter is import.vendor_name
    We have also defined an Error lookup.
    After the above setup is completed, we invoke the create document and click on Oracle->Upload.
    The records are getting imported, but the importer program is failing with An error has occurred while running an API import. The ERRORED_ROWS step 20003:ER_500141, parameter number 1 must contain the value BIND in attribute 1.'

    The same issue.
    Need help.
    Also checked bne.log, no additional information.
    <bne:document xmlns:bne="http://www.oracle.com/bne">
    <bne:message bne:type="DATA" bne:text="BNE_VALID_ROW_COUNT" bne:value="11" />
    <bne:message bne:type="DATA" bne:text="BNE_INVALID_ROW_COUNT" bne:value="0" />
    <bne:message bne:type="ERROR" bne:text="An error has occurred while running an API import"
    bne:cause="The ERRORED_ROWS step 20003:ER_500165, parameter number 1 must contain the value BIND in attribute 1."
    bne:action="" bne:source="BneAPIImporter" >
    <bne:context bne:collection="collection_1" />
    </bne:message><bne:message bne:type="STATUS"
    bne:text="No rows uploaded" bne:value="" >
    <bne:context bne:collection="collection_1" /></bne:message>
    <bne:message bne:type="STATUS" bne:text="0 rows were invalid" bne:value="" >
    <bne:context bne:collection="collection_1" /></bne:message></bne:document>

  • Using Package to produce pl/sql function body returning sql query Report

    I have existing code that we want to use in building reports in APEX. We are needing to modify it slightly to handle some new requirements, but would like to use them in reports based upon SQL query (pl/sql function body returning sql query) functionality.
    Any suggestions as how to call these in an APEX report region?
    Thank you,
    Tony Miller
    UTMB/EHN

    Hi Tony-
    I am also v new to Apex and you may have answered a question I was in search of. I, however, now have a couple more. First a bit of background-- Like in your situation, my college has a lot of existing code (400 +) that we need to get into Apex. The majority of this canned code contains one/both: 1) many lines, sometimes containing multiple select statements 2) imbedded create table & view statements (temp user owned). Up until reading your post, I was unable to figure out an easy way of getting this existing code into the product. Thanks. Now the questions, do you know how I would go about dealing with the create tables/views. I've read some posts on this forum which suggest temporary tables being unstable in this environment. Also, do you know if there's a size limitation when passing sql code via a function?
    As you may/may not be able to tell, I'm a bit lost right now... so any info you can provide would be appreciated. Thanks.
    Don

  • Migrating Functions that return TABLE from SQL Server to Oracle

    I have some functions in SQL Server that return a TABLE datatype. When these functions are moved to Oracle 9i using Migration Workbench, they give compilation errors. In the migrated function it says that the DDL stmt is passed to the ddl file, but the table is not created. I checked the ddl stmt for temporary tables and it is wrong. Its a create table stmt with no size for varchars and we can't even edit these stmts in the workbench.
    Also the migrated function has the table name for return type, which doesn't works in Oracle. Oracle needs a datatype to be returned from Oracle.
    How do we return a table from a function?

    Yes.
    If you do not enclose the object names (table/view/index etc) in double-quotes, they are stored in uppercase format in the data dictionary.
    If you enclose them in quotes, they are stored in the same case ans you entered. As such, while accessing such objects, you need to tell Oracle not to convert the names to uppercase, hence the requirement to supply the names in quotes.

  • How to find listing of modules which has used xyz PL/SQL function?

    Hi,
    How I can find the list of forms/reports which has used xyz pl/sql function?
    I want to delete a pl/sql function but before that I would like to
    make sure this function is not being used by any forms/report.
    Thanks for your help!!
    D

    There are many tools available for finding out the particular string across many forms in one shot.
    One such utility is forms apimaster.
    You can download it's 30 days free trial from the internet.

  • Problem to create a link with parameters using a PL/SQL function body

    Hi everybody,
    I need some help to create a link on a SELECT statement.
    I have a region report with type "PL/SQL function body return SQL query".
    I would like to use a link using HTML tag <a href>.
    I know how to do the link, but I don't know to pass a parameters in <a href> statement.
    Always I tried it doesn't work well.
    My PL/SQL anonimous block is, (just with link) :
    DECLARE
    q vARCHAR2(4000);
    BEGIN
    q:='select     "INDICADOR"."NRINDICADOR" as "NRINDICADOR",';
    q:=q||'     "INDICADOR"."DSINDICADOR" as "DSINDICADOR",';
    q:=q||'''<span style="font-weight:bold;">';
    q:=q||'''||TO_CHAR("TOTAL_INDICADOR"."VL_INDICADOR", ''999G999G999G990D00'')||''</span>''';
    q:=q||' as "VL_INDICADOR",';
    q:=q||'     "TOTAL_INDICADOR"."VL_META" as "VL_META" ';
    q:=q||' from     "TOTAL_INDICADOR" "TOTAL_INDICADOR",';
    q:=q||'     "INDICADOR" "INDICADOR" ';
    q:=q||' where "INDICADOR"."NRINDICADOR"="TOTAL_INDICADOR"."NR_INDICADOR"';
    RETURN q;
    END;
    Thanks for any help,
    Alessandra

    Your code is in a default value for an item, right?
    You need to make sure :P33_YEAR is not null and handle the error in the PL/SQL if it is.
    How is P33_YEAR populated? do you pass it in? check to see if it is making it there..
    Message was edited by:
    Bill Carlisle

  • SQL Query (PL/SQL function body returning SQL query) when using to_char

    we are trying to build a report page of Type SQL Query (PL/SQL function body returning SQL query).
    our query is so simple, we need to extract the month from the recording_date column.
    declare
    l_query varchar2(1000);
    begin
    l_query:='select to_char(recording_date,'MM')from re_productive';
    return l_query;
    end;
    but we are having the following problem for this query
    Function returning SQL query: Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the generic columns checkbox below the region source to proceed without parsing.
    (ORA-06550: line 4, column 42: PLS-00103: Encountered the symbol "MON" when expecting one of the following: . ( * @ % & = - + ; < / > at in is mod remainder not rem <> or != or ~= >= <= <> and or like between || multiset member SUBMULTISET_ The symbol ". was inserted before "MON" to continue.)
    Notes:
    1-the query is correct and it was tested under Toad and SQL Plus.
    2- we tried Use Generic Column Names (parse query at runtime only) option but we get the same problem.
    any quick help please.

    Hi
    You haven't escaped your quotes in the string. Try this...
    DECLARE
    l_query VARCHAR2(32767);
    BEGIN
    l_query:= 'select to_char(recording_date,''MM'') from re_productive';
    RETURN l_query;
    END;Cheers
    Ben

  • Function that returns N values, without using a string

    Hi, how can i make a function that returns several valures (that hasn't a exact number of returned values, it could return 3 values, or 7) without using a string?
    When i need to return several values from a function, i put the values inside a varchar like thus 'XXX,YYY,ZZZ' and so on. Don't know if this has a poor performance.
    If you can supply simple examples for what im asking, i would be nice.
    (without using a string)

    Can i create the type objects inside a package? If i
    can, they will be local to the package, right?Yes, you're right.
    Pipeline returns a row or several?You can use pipelined function in the same way you use table:
    SELECT * FROM TABLE(pipelined_funct(agr1, agr2));
    It returns results as separate rows.

  • Conditional display using Pl/SQL function body returning a boolean

    I am having issues with conditional display of a report.
    I have to select lists: p50_facility and p50_supervisor.
    I have entered the below pl/sql function body returning a boolean
    Begin
    if (:p50_facility is null or
    :p50_supervisor is null) THEN
    Return False;
    Else
    Return True;
    End if;
    End;
    No matter what values my items are set to (null, not null), the report shows.
    What am I doing wrong?

    Hi,
    The values for the lists will be null only until the first time the page is submitted. Thereafter, the value is likely to be '%null%'
    You will need to do something like:
    BEGIN
    IF (:P50_FACILITY IS NULL OR :P50_FACILITY = '%' || 'null%' OR :P50_SUPERVISOR IS NULL OR :P50_SUPERVISOR = '%' || 'null%') THEN
      RETURN FALSE;
    ELSE
      RETURN TRUE;
    END IF;
    END;Andy

Maybe you are looking for

  • Trouble with OracleResultSet...pls help

    Hello all, I'm trying to insert a word file into Oracle 9i using Blobs. Thanks to somebody in this forum, i have been able to finally use the oracle.sql.BLOB class using Tomcat. Every code snippet i've seen uses the regular java.sql.ResultSet first t

  • Prob in adding fields to the DS in R3 - LO Extractor.

    Hi All, In LO EXTRACTION Go to Transaction LBWE (LO Customizing Cockpit) 1). Select Logistics Application SD Sales BW Extract Structures 2). Select the desired Extract Structure and deactivate it first. 3). Give the Transport Request number and conti

  • After opening a certain website, I can't close firefox anymore

    I opened a website in google and I got a tiny webpage saying: This page on http://protectremovevirusxpnow.com says: Windows Security has found critical process activity on your system and will perform fast scan of system files. The only button you ca

  • HELP: Windows 7 Ultimate installation issues

    Hi, I have used BootCamp to install Windows 7 Ultimate on my MAC but after partition it goes to a blank black screen and says "No bootable device -- insert a bootable disk and press any key". I have tried all the tricks I could find on the net like u

  • ITunes wont install on a computer running Window XP Pro 64 bit

    I own an ipod and have been a subscriber to itunes for years. I just had my computer rebuilt from a system crash. I had window XP Pro 64 bit OS installed & now i cant reinstall itunes. How do i get my itunes back? Do you have a version of itunes that