Types of functions cannot used in PL/SQL

I'm trying to find out information on what types of functions cannot be used in PL/SQL. Can someone provide me with some directions and assistance?
Thanks a lot.
Tony

its really depends upon your implementation way..
if u are callinga pl/sql from a trigger, then you can't use any DDL or DML effecting on the same table.
If u are calling a function then it must return only one value, it should not written more than one value.

Similar Messages

  • When i try to learn how to type online, i cannot use this/, because snel zoeken opens.

    When I press this Symbol / Firefox always starts SNEL ZOEKEN (in Dutch).
    So when I need this symbol, I cannot use it. I already tried to change VOORKEUREN-ALGEMEEN-NAAR TEKST ZOEKEN WANNEER IK BEGIN TE TYPEN, but this does not work. I have the latest update of Firefox.

    See http://kb.mozillazine.org/Find_bar_opens_when_typing_in_textbox

  • What functions to use in oracle sql

    how to convert a decimal of 15 to decimal of 10
    and decimal of (15,2) to decimal of (12,2)

    876801 wrote:
    how to convert a decimal of 15 to decimal of 10
    and decimal of (15,2) to decimal of (12,2)Change the actual data type? If data type needs changing, the CAST() function can be used.
    E.g.
    SQL> create table footab(
      2          n       number(5,3)
      3  );
    Table created.
    SQL>
    SQL> insert into footab values( 99.123 );
    1 row created.
    SQL>
    SQL> select
      2          n,
      3          cast( n as number(5,1)) as N51
      4  from       footab;
             N        N51
        99.123       99.1
    SQL>

  • NVL function in use in PL/SQL

    The following SQL statement runs fine and returns data. Notice the ,nvl(fld.MULTSELECT,0).
    SELECT exs.PK
    ,fld.Name
    ,fld.Desc_
    ,fld.DataTp
    ,case when rtrim(fld.InlineName) = '' then
    NULL
    --convert(nvarchar(255), Null)
    else fld.InlineName
    end InlineName
    ,fld.UOM
    ,fld.High
    ,fld.Low
    ,fld.CriticalHigh
    ,fld.CriticalLow
    ,fld.ChTp
    ,nvl(fld.MULTSELECT,0)
    ,fld.Type
    ,fld.IsProtected
    ,fld.RecTp
    ,fld.RecTpMbrSeq
    ,fld.SrcEtType
    ,fld.TargetEtType
    ,fld.FldCat
    --,fc.ChFK FldCateoryFK
    -- ,dbo.fn_StripCharacters(fld.Name, '^a-z0-9') SrcStagingFld -- strip out all characters except alphanumeric
    ,nvl(CAST(trim(fld.PropagateToEAV) AS NUMBER(1,0)),1) PropagateToEAV
    ,CAST(trim(fld.RecTimeStamp) AS NUMBER(1,0)) RecTimeStamp
    ,CAST(trim(fld.RecTimeStampEnd) AS NUMBER(1,0)) RecTimeStampEnd
    ,nvl(CAST(trim(fld.EtTypeTimeStampFld) AS NUMBER(1,0)),0) EtTimeStampFld
    ,nvl(CAST(trim(fld.EtTypeTimeStampEndFld) AS NUMBER(1,0)),0) EtTypeTimeStampEndFld
    ,nvl(CAST(trim(fld.EtTypeNameFld) AS NUMBER(1,0)),0) EtTypeNameFld
    ,nvl(CAST(trim(fld.EtTypeNameFldDeId) AS NUMBER(1,0)),0) EtTypeNameFldDeId
    ,CAST(trim(fld.EtSrcSystRecKey) AS NUMBER(1,0)) EtSrcSystRecKey
    ,CAST(trim(fld.EtSrcSystRecAlternativeRecKey) AS NUMBER(1,0)) EtSrcSystAlternativeRecKey
    ,CAST(trim(fld.ParentEtSrcSystRecKey) AS NUMBER(1,0)) ParentEtSrcSystRecKey
    ,CAST(trim(fld.MainEtRecTp) AS NUMBER(1,0)) MainEtRecTp
    FROM Ld_UD_RecTp fld
    -- left join MD_FldCat fc on fld.FldCat = fc.Name
    left join Md_Fld exs on fld.RecTp = exs.RecTp and fld.Name = exs.Name
    left join Aud_ModDataError Err on err.RecTp = fld.RecTp and Err.BatLogId = 1 -- check if the recordtype has any load errors
    where nvl(fld.name,'zzzzzzz') <>'zzzzzzz'
    and Err.RecTp is Null
    When used in a stored procedure as follows, the procedure doesn't compile
    create or replace PROCEDURE MD_Ld_Flds
    v_BatLogID IN NUMBER DEFAULT NULL
    AS
    BEGIN
    MERGE INTO MD_Fld targ
    USING (SELECT exs.PK
    ,fld.Name
    ,fld.Desc_
    ,fld.DataTp
    ,case when rtrim(fld.InlineName) = '' then
    NULL
    --convert(nvarchar(255), Null)
    else fld.InlineName
    end InlineName
    ,fld.UOM
    ,fld.High
    ,fld.Low
    ,fld.CriticalHigh
    ,fld.CriticalLow
    ,fld.ChTp
    ,nvl(fld.MULTSELECT,0)
    ,fld.Type
    ,fld.IsProtected
    ,fld.RecTp
    ,fld.RecTpMbrSeq
    ,fld.SrcEtType
    ,fld.TargetEtType
    ,fld.FldCat
    --,fc.ChFK FldCateoryFK
    -- ,dbo.fn_StripCharacters(fld.Name, '^a-z0-9') SrcStagingFld -- strip out all characters except alphanumeric
    ,nvl(CAST(trim(fld.PropagateToEAV) AS NUMBER(1,0)),1) PropagateToEAV
    ,CAST(trim(fld.RecTimeStamp) AS NUMBER(1,0)) RecTimeStamp
    ,CAST(trim(fld.RecTimeStampEnd) AS NUMBER(1,0)) RecTimeStampEnd
    ,nvl(CAST(trim(fld.EtTypeTimeStampFld) AS NUMBER(1,0)),0) EtTimeStampFld
    ,nvl(CAST(trim(fld.EtTypeTimeStampEndFld) AS NUMBER(1,0)),0) EtTypeTimeStampEndFld
    ,nvl(CAST(trim(fld.EtTypeNameFld) AS NUMBER(1,0)),0) EtTypeNameFld
    ,nvl(CAST(trim(fld.EtTypeNameFldDeId) AS NUMBER(1,0)),0) EtTypeNameFldDeId
    ,CAST(trim(fld.EtSrcSystRecKey) AS NUMBER(1,0)) EtSrcSystRecKey
    ,CAST(trim(fld.EtSrcSystRecAlternativeRecKey) AS NUMBER(1,0)) EtSrcSystAlternativeRecKey
    ,CAST(trim(fld.ParentEtSrcSystRecKey) AS NUMBER(1,0)) ParentEtSrcSystRecKey
    ,CAST(trim(fld.MainEtRecTp) AS NUMBER(1,0)) MainEtRecTp
    FROM Ld_UD_RecTp fld
    -- left join MD_FldCat fc on fld.FldCat = fc.Name
    left join Md_Fld exs on fld.RecTp = exs.RecTp and fld.Name = exs.Name
    left join Aud_ModDataError Err on err.RecTp = fld.RecTp and Err.BatLogId = v_BatLogID -- check if the recordtype has any load errors
    where nvl(fld.name,'zzzzzzz') <>'zzzzzzz'
    and Err.RecTp is Null -- Exclude recordtypes which had errors
    ) src on (src.PK = Targ.PK)
    when matched then
    update Set      Targ.Name               =src.Name     
    ,Targ.Desc_               =src.Desc_     
    ,Targ.DataTp               =src.DataTp     
    ,Targ.InlineName               =src.InlineName     
    ,Targ.UOM               =src.UOM     
    ,Targ.High               =src.High     
    ,Targ.Low               =src.Low     
    ,Targ.CriticalHigh               =src.CriticalHigh     
    ,Targ.CriticalLow               =src.CriticalLow     
    ,Targ.ChTp               =src.ChTp     
    ,Targ.MultSelect               =src.MultSelect     
    ,Targ.Type               =src.Type     
    ,Targ.IsProtected               =src.IsProtected     
    ,Targ.RecTp               =src.RecTp     
    ,Targ.RecTpMbrSeq               =src.RecTpMbrSeq     
    ,Targ.SrcEtType               =src.SrcEtType     
    ,Targ.TargetEtType               =src.TargetEtType     
    ,Targ.FldCat               =src.FldCat     
    --,Targ.SrcStagingFld               =src.SrcStagingFld     
    ,Targ.PropagateToEAV               =src.PropagateToEAV     
    ,Targ.RecTimeStamp               =src.RecTimeStamp     
    ,Targ.RecTimeStampEnd               =src.RecTimeStampEnd     
    ,Targ.EtTimeStampFld               =src.EtTimeStampFld     
    ,Targ.EtTimeStampEndFld               =src.EtTypeTimeStampEndFld     
    ,Targ.EtNameFld               =src.EtTypeNameFld     
    ,Targ.EtNameFldDeId               =src.EtTypeNameFldDeId     
    ,Targ.EtSrcSystRecKey               =src.EtSrcSystRecKey     
    ,Targ.EtSrcSystAlternativeRecKey=src.EtSrcSystAlternativeRecKey     
    ,Targ.ParentEtSrcSystRecKey               =src.ParentEtSrcSystRecKey     
    ,Targ.MainEtRecTp               =src.MainEtRecTp     
    ,targ.LastModified = SYSDATE
    when not matched then --target 
    insert (Name
    ,Desc_
    ,DataTp
    ,InlineName
    ,UOM
    ,High
    ,Low
    ,CriticalHigh
    ,CriticalLow
    ,ChTp
    ,MultSelect
    ,Type
    ,IsProtected
    ,RecTp
    ,RecTpMbrSeq
    ,SrcEtType
    ,TargetEtType
    ,FldCat
    --,SrcStagingFld
    ,PropagateToEAV
    ,RecTimeStamp
    ,RecTimeStampEnd
    ,EtTimeStampFld
    ,EtTimeStampEndFld
    ,EtNameFld
    ,EtNameFldDeId
    ,EtSrcSystRecKey
    ,EtSrcSystAlternativeRecKey
    ,ParentEtSrcSystRecKey
    ,MainEtRecTp
    ,LastModified)
    values (src.Name
    ,src.Desc_
    ,src.DataTp
    ,src.InlineName
    ,src.UOM
    ,src.High
    ,src.Low
    ,src.CriticalHigh
    ,src.CriticalLow
    ,src.ChTp
    ,src.MultSelect
    ,src.Type
    ,src.IsProtected
    ,src.RecTp
    ,src.RecTpMbrSeq
    ,src.SrcEtType
    ,src.TargetEtType
    ,src.FldCat
    --,src.SrcStagingFld
    ,src.PropagateToEAV
    ,src.RecTimeStamp
    ,src.RecTimeStampEnd
    ,src.EtTimeStampFld
    ,src.EtTypeTimeStampEndFld
    ,src.EtTypeNameFld
    ,src.EtTypeNameFldDeId
    ,src.EtSrcSystRecKey
    ,src.EtSrcSystAlternativeRecKey
    ,src.ParentEtSrcSystRecKey
    ,src.MainEtRecTp
    ,SYSDATE);
    END;
    When you show errors you get the following;
    7/7 PL/SQL: SQL Statement ignored
    125/8 PL/SQL: ORA-00904: 'SRC"."MULTSELECT": invalid identifier
    If I compile the procedure without the NVL, the procedure compiles with no errors.
    We're running Oracle 11g

    Hi,
    In a sub-query (such as the USING sub-query in a MERGE statement), each column in the SELECT clause has to have a unique, valid name.
    In an unnested SQL query, you don't have to name the columns at all. If you say
    SELECT  NVL (dummy, 'FOO')
    FROM    dual;In SQL*Plus, it will automatically name the column "NVL(DUMMY,'FOO')" for you, and it doesn't insist that the name be unique.
    In a sub-query, you have to explicitly name all the columns, and make sure they're unique; for example
    ,nvl(fld.MULTSELECT,0)   AS multselect_or_0 
    To be excruciatingly precise, some versions of Oracle let you get away with not having aliases in certain circumstances, but there's no point in doing so. Always assign unique aliases to columns in a sub-query.

  • I am an aged woman. use photoshop for timepass.I am a photographer also. This time when I use filter(artistic) some wrong was happen. Now all photos are seen with net type. I  cannot use photos with photoshop. What can I do? Sir,

    op for timepass

    I’m not sure what you mean by "net type", could you please post a screenshot to illustrate the issue?
    How to post a screenshot in the forum

  • IaaS SQL/VM - how to use an existing SQL VM

    Hello
    I have a Cloud Service with a Window Web VM and SQL VM. They both are on the same Vnet. Now I want to add a DB using the existing SQL VM. But this VM does not show up of the Server drop down menu in "Specify Database setting"
    wizard. What am I missing here?
    If I let the DB Wizard add a new server (leveraging PaaS offer for SQL DB), how can I make sure that this new server shows up on my Vnet (the same one where I have Web VM on)? I assume that these VMs needs to be on the same Vnet to be able to communicate
    with each other. 
    Thanks in advance for your help

    Hello,
    It seems that you had mix up Windows Azure SQL database with SQL Server on Azure VM. When you create a SQL Server virtual machine in Azure, it similar to on-premises SQL Server installed on VM. You can create and manage databases with SSMS.
    If you create a SQL database on Management Portal, the SQL database server host a VM of the datacenter, you cannot using the existing SQL Server VM which your created yourself.
    When connect to the SQL database from your azure VM which hosted on Cloud Service, there is no need to create a virtual network, just configure the firewall rule of the SQL database server to allow connection from Windows
    Azure Serivces.
    Reference: How to: Configure the Server-Level Firewall Settings (Azure SQL Database)
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Cannot use BOOLEAN in Oracle

    Why we can't use BOOLEAN in SQL statement but we can use it in PL/SQL statement. But what does that mean? Thanks.

    grus wrote:
    Why we can't use BOOLEAN in SQL statement but we can use it in PL/SQL statement. But what does that mean? Thanks.As already explained, SQL and PL (Programming Logic) are different computer languages and have different data types. Though PL typically supports most SQL data types too.
    Oracle however allows you to define your own SQL data types - and create these in a similar way as you would define an object orientated class. These data types have constructors, properties and methods, static class methods - and supports abstract definitions and inheritance. All the basics of an o-o class definition is supported.
    This allows you to, for example, create your own boolean data type that you can use in both SQL and PL. Not that this is specifically a good idea for boolean values (as a single character column with a Y/N constraint can do the job equally well to). But even so, to define your own data types is a very powerful feature that can be used to deal with non-common data types in specialised database implementations.
    An example of how to create a SQL boolean type was posted some time ago in [this thread|http://forums.oracle.com/forums/thread.jspa?messageID=2116991#2116991].

  • RE:Idoc type and function module

    HI All
    What are the generic IDoc types and function modules used for the following objects ??We are on SAP R/3 4.7.
    Invoice Release (inbound)
    Payments (outbound)
    Purchase Orders (outbound)
    Goods Receipts (outbound)
    Cost Centers (outbound)
    GL Codes (outbound)
    Internal Orders (outbound)
    WBS (outbound)
    Materials (outbound)
    Invoices (inbound)
    Invoices Blocked (outbbound)
    And How do i judge which IDOC types and function module fit my requirement( I mean what are the things i have to keep in mind while choosing idoc types and function modules)?
    Any help will be very much appreciated
    Thank you
    Steve

    Hi Steve...
    You can find the IDOC types in Tcode WE30 , WE60.
    Invoice Release (inbound)
      INVOIC03
    Payments (outbound)
    Purchase Orders (outbound)
      ORDERS03
    Goods Receipts (outbound)
      ACC_GOODS_MOVEMENT02
    Cost Centers (outbound)
    GL Codes (outbound)
    Internal Orders (outbound)
    WBS (outbound)
    Materials (outbound)
      MATMAS04
    Invoices (inbound)
      ACC_INVOICE_RECEIPT03
    Invoices Blocked (outbbound)
    <b>REWARD IF HELPFUL.</b>

  • PLS-00455: cursor 'CUR_1' cannot be used in dynamic SQL OPEN statement

    create or replace function f_my_test_func
    return refcur_pkg.refcur_t1
    is
    cur_1  refcur_pkg.refcur_t1;
    begin
    open cur_1
    for
    'select * from dept';
    return cur_1;
    exception
    when others
    then
    insert into ddl_log (SQLTEXT)
    values
    ('fucntion error'); 
    end;

    I would suggest that cur_1 refcur_pkg.refcur_t1 is a stongly typed ref cursor i.e. it has RETURN dept%ROWTYPE or something similar in the declaration. You can't use strongly typed ref cursors with dynamic SQL in this way. The declaration should be weakly typed or just use sys_refcursor.
    DTYLER_APP@pssdev2> DECLARE
      2
      3      TYPE t_Strong   IS REF CURSOR RETURN dual%ROWTYPE;
      4
      5      lc_Strong       t_Strong;
      6
      7  BEGIN
      8
      9      OPEN lc_Strong FOR
    10      'SELECT * FROM dual';
    11
    12  END;
    13  /
        OPEN lc_Strong FOR
    ERROR at line 9:
    ORA-06550: line 9, column 10:
    PLS-00455: cursor 'LC_STRONG' cannot be used in dynamic SQL OPEN statement
    ORA-06550: line 9, column 5:
    PL/SQL: Statement ignored
    DTYLER_APP@pssdev2>
    DTYLER_APP@pssdev2> DECLARE
      2
      3      TYPE t_Weak   IS REF CURSOR;
      4
      5      lc_Weak       t_Weak;
      6
      7  BEGIN
      8
      9      OPEN lc_Weak FOR
    10      'SELECT * FROM dual';
    11
    12  END;
    13  /
    PL/SQL procedure successfully completed.
    DTYLER_APP@pssdev2> DECLARE
      2
      3      lc_Weak       sys_refcursor;
      4
      5  BEGIN
      6
      7      OPEN lc_Weak FOR
      8      'SELECT * FROM dual';
      9
    10  END;
    11  /
    PL/SQL procedure successfully completed.
    DTYLER_APP@pssdev2>HTH
    David

  • Function which returns multiple values that can then be used in an SQL Sele

    I'd like to create a function which returns multiple values that can then be used in an SQL Select statement's IN( ) clause
    Currently, the select statement is like (well, this is a very simplified version):
    select application, clientid
    from tbl_apps, tbl_status
    where tbl_apps.statusid = tbl_status.statusid
    and tbl_status.approved > 0;
    I'd like to pull the checking of the tbl_status into a PL/SQL function so my select would look something like :
    select application, clientid
    from tbl_apps
    where tbl_apps.statusid in (myfunction);
    So my function would be running this sql:
    select statusid from tbl_status where approved > 0;
    ... will return values 1, 5, 15, 32 (and more)
    ... but I haven't been able to figure out how to return the results so they can be used in SQL.
    Thanks for any help you can give me!!
    Trisha Gorr

    Perhaps take a look at pipelined functions:
    Single column example:
    SQL> CREATE OR REPLACE TYPE split_tbl IS TABLE OF VARCHAR2(32767);
      2  /
    Type created.
    SQL> CREATE OR REPLACE FUNCTION split (p_list VARCHAR2, p_delim VARCHAR2:=' ') RETURN SPLIT_TBL PIPELINED IS
      2      l_idx    PLS_INTEGER;
      3      l_list   VARCHAR2(32767) := p_list;
      4      l_value  VARCHAR2(32767);
      5    BEGIN
      6      LOOP
      7        l_idx := INSTR(l_list, p_delim);
      8        IF l_idx > 0 THEN
      9          PIPE ROW(SUBSTR(l_list, 1, l_idx-1));
    10          l_list := SUBSTR(l_list, l_idx+LENGTH(p_delim));
    11        ELSE
    12          PIPE ROW(l_list);
    13          EXIT;
    14        END IF;
    15      END LOOP;
    16      RETURN;
    17    END SPLIT;
    18  /
    Function created.
    SQL> SELECT column_value
      2  FROM TABLE(split('FRED,JIM,BOB,TED,MARK',','));
    COLUMN_VALUE
    FRED
    JIM
    BOB
    TED
    MARK
    SQL> create table mytable (val VARCHAR2(20));
    Table created.
    SQL> insert into mytable
      2  select column_value
      3  from TABLE(split('FRED,JIM,BOB,TED,MARK',','));
    5 rows created.
    SQL> select * from mytable;
    VAL
    FRED
    JIM
    BOB
    TED
    MARK
    SQL>Multiple column example:
    SQL> CREATE OR REPLACE TYPE myrec AS OBJECT
      2  ( col1   VARCHAR2(10),
      3    col2   VARCHAR2(10)
      4  )
      5  /
    Type created.
    SQL>
    SQL> CREATE OR REPLACE TYPE myrectable AS TABLE OF myrec
      2  /
    Type created.
    SQL>
    SQL> CREATE OR REPLACE FUNCTION pipedata(p_str IN VARCHAR2) RETURN myrectable PIPELINED IS
      2    v_str VARCHAR2(4000) := REPLACE(REPLACE(p_str, '('),')');
      3    v_obj myrec := myrec(NULL,NULL);
      4  BEGIN
      5    LOOP
      6      EXIT WHEN v_str IS NULL;
      7      v_obj.col1 := SUBSTR(v_str,1,INSTR(v_str,',')-1);
      8      v_str := SUBSTR(v_str,INSTR(v_str,',')+1);
      9      IF INSTR(v_str,',')>0 THEN
    10        v_obj.col2 := SUBSTR(v_str,1,INSTR(v_str,',')-1);
    11        v_str := SUBSTR(v_str,INSTR(v_str,',')+1);
    12      ELSE
    13        v_obj.col2 := v_str;
    14        v_str := NULL;
    15      END IF;
    16      PIPE ROW (v_obj);
    17    END LOOP;
    18    RETURN;
    19  END;
    20  /
    Function created.
    SQL>
    SQL> create table mytab (col1 varchar2(10), col2 varchar2(10));
    Table created.
    SQL>
    SQL> insert into mytab (col1, col2) select col1, col2 from table(pipedata('(1,2),(2,3),(4,5)'));
    3 rows created.
    SQL>
    SQL> select * from mytab;
    COL1       COL2
    1          2
    2          3
    4          5

  • 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 &lt; &gt; ...
    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.

  • How to use type, packages, functions, and procedures in another schema ?

    I have two target schema in one OWB project, such as A and B. In a mapping of A, I would like to use some types, packages, functions, and procedures from B. I have tried the method of synonym as suggested, but I could not find the metadata of these when importing ... The only type of synonym I can import is the synonym for table. Is there a bug for synonym?
    If I cannot use synonym for this issue, is there another way to solve the problem?

    Now, in some instances you will absolutely need to create the second module as Carsten describes, however it should also be noted that you can reference objects in things like Expressions even if you have not loaded up the metadata. It is only when you need strong binding that it becomes neccessary to import objects. For everything else, as long as the reference will resolve at compile-time then you are good to go.
    For example, I have a function in one target schema (S1) and a private synonym to it in another(s2). A mapping in the S2 schema has an expression object that uses the synonym to the function in the expression property for a couple of the output attirbutes. The synonym has not been loaded into metadata - indeed OWB has no knowledge of its existance. But it resolves at compile time so the mapping validates and generates successfully.
    Mike

  • Use of Pl/Sql and Function

    Hi,
    Can we use a PL/Sql package or a Function in a sql query. If yes How.??
    Regards
    Sameer

    Sameer8 wrote:
    Can we use a PL/Sql package or a Function in a sql query. If yes How.??A function (whether declared in a package or a stand alone stored function) may be used in SQL providing it does not contain any OUT parameters...
    SQL> create function testf(x OUT number) return number is
      2  begin
      3    x := 1;
      4    return 2;
      5  end;
      6  /
    Function created.
    SQL> var my_x number
    SQL> select testf(:my_x) from dual;
    select testf(:my_x) from dual
    ERROR at line 1:
    ORA-06572: Function TESTF has out argumentsAnd it doesn't do any DML...
    SQL> create table x (x number);
    Table created.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function testf return number is
      2  begin
      3    insert into x values (1);
      4    return 1;
      5* end;
    SQL> /
    Function created.
    SQL> select testf() from dual;
    select testf() from dual
    ERROR at line 1:
    ORA-14551: cannot perform a DML operation inside a query
    ORA-06512: at "SCOTT.TESTF", line 3

  • PL/SQL: ORA-22992: cannot use LOB locators selected from remote tables

    Dear ALL,
    My O/S is Redhatlinux 5.2 and i had Migrated my Oracle databse to 11g2. But after that while i am retrieving records through dblinks from one of my other Oracle 9.2.0.8 databse it's throwing the error : PL/SQL: ORA-22992: cannot use LOB locators selected from remote tables.* This error i am getting in TOAD as well as SQL Developer.
    Can anybody tell me how to fix this error ? Because am not able to get the records.
    Also am getting another error during retrieving data from some of my tables after migrating i.e the table which having CLOB data type while am accessing to retrieve the records using select query it's throwing the error :
    +(The following error has occurred:+
    A query with LOB's requires OCI8 mode, but OCI7 mode is used.)
    If anyone having any idea kindly share.
    Thanks and Regards
    Biswa

    Hi,
    Ya what u sent that is fine. But already am using one procudure which is accessing LOB data from another databse through DBlink and working fine. But there Both the databse are 9.2.0.8.
    But while am executing the same procedure in oracle 11g where the Dblink accessing the data from Oracle 9i , there am getting this error.
    Kindly tell if u know any resolution.
    Thanks

  • Which SQL function to use to get previous month's data?

    Hi
    The reporting need: Display of two month's payroll run results....current and previous (based on the parameter passed) in Oracle Discoverer.
    Data source: A table in which run result values are stored. Of course to be linked to number of other tables.
    Can somebody guide me on which SQL function to use to get the data for previous month?
    Secondly, as Discoverer does not support parameters, I cannot put parameter in the query itself. I'll be applying parameter later while generating my report.
    Please advice.
    Thanks and regards,
    Aparna

    It's not very clear in my head... but you can try :
    SQL> select * from test;
    ENAM        SAL DT
    TOTO       1000 30/05/06
    TOTO       1001 20/04/06
    TOTO       1002 11/03/06
    TATA       2000 30/05/06
    TATA       1500 20/04/06
    TUTU       3500 30/05/06
    6 rows selected.
    SQL> select ename, dt, sal currmonth,
                case when trunc(lag(dt,1,dt) over (partition by ename order by dt),'MM') = trunc(add_months(dt,-1),'MM')
                     then lag(sal,1,sal) over (partition by ename order by dt)
                     else null end prevmonth
         from   test
    SQL> /
    ENAM DT        CURRMONTH  PREVMONTH
    TATA 20/04/06       1500
    TATA 30/05/06       2000       1500
    TOTO 11/03/06       1002
    TOTO 20/04/06       1001       1002
    TOTO 30/05/06       1000       1001
    TUTU 30/05/06       3500
    6 rows selected.
    SQL>
    SQL> Nicolas.
    Just an additional question : do the previous month is current month-1, or is there hole in month suite (e.g. the previous month can be current month-2) ?
    Message was edited by:
    N. Gasparotto

Maybe you are looking for

  • Custom icons 'unclickable' in icon view & not shown in coverflow

    Hi, I just got off the line with Apple support, who couldn't solve my problem and then just told me that Leopard didn't support what I was doeing and thus that it was not there problem. Very un-apple if you ask me... Here's the problem: I create cust

  • ITunes 10.2.2 no longer organizing library

    I have been adding video content to iTunes, and it was working normally. I've got "Keep iTunes Media folder organized" and "Copy files to iTunes Media folder when adding to" checked, and when I add the files, they moved into the iTunes Media folder.

  • Create an image of a Bootcamp partition

    I just purchases an iMac, and I have installed Windows 7 as a Bootcamp partition on it. In addition, I have installed a bunch of Windows software that I want on it. What I'd like to do now is create an "image" of this BootCamp partition that I could

  • TS3899 Having issues receiving emails and then they dissapearing

    I am experiencing problems with one of the 3 emails accounts on my iPhone 4. One of my bellsouth (att) accounts and my gmail accounts receive emails and are kept on the inbox. However my other bellsouth email account receives the emails but does not

  • SYNTAX_ERROR SM:EXEC

    Very funny, was working fine and then suddenly hit this error. Tried to refresh service definition but with no luck! Syntax error in program "/1AGS/AEAXI_______________015 "._ The following syntax error occurred in program "/1AGS/AEA_XI______________