Function used in the view definition is called several times

I'm writing a view that boils down to the following statement:

SELECT val, val)
SELECT SYS_GUID() val
OF the double
)

Against my expectation, which calls SYS_GUID() twice, resulting in two different values for val.

I have written here as view inline, but it must be a regular view in reality. Is it possible to build this view while SYS_GUID is called only once, even if the resulting value is then selected several times? Naively, I want to affect the outcome of SYS_GUID to a variable, and then select the value of this variable. However, this seems not possible in a view.

New to Oracle PL/SQL. This works as expected in T - SQL SQL Server.

Thanks for any help or insight you can provide.

-Brian

Hmmm, I have no 11 + available so I can't check a solution, but I would like to test:

SELECT val, val FROM (
SELECT SYS_GUID() val
FROM dual
WHERE ROWNUM = 1
)

or

SELECT val, val FROM (
SELECT /*+ NO_MERGE */ SYS_GUID() val
FROM dual
)

Edit: the no_merge indicator seems to work in 10.2.0.4

Published by: David_Aldridge on December 14, 2010 23:21

Tags: Database

Similar Questions

  • (Bug)  Function that is called on the authenticationSuccess parameter is called several times

    < rtc:AdobeHSAuthenticator id = "auth" authenticationKey = '{authToken}' protocol = "rtmfp" authenticationSuccess = "onAuthSuccess (); "authenticationFailure ="onAuthFailure (event); "/ >

    The onAuthSuccess() function that is called at all times

    Hi Ashish,

    Can you give us the smallest possible complete app that reproduces it

    question? I just built a simple and it worked.

    Thank you

    Nigel

  • The purpose of programmatic view called several times ExecuteQueryForCollection

    [JDev/ADF v11.1.1.5.0]

    I am trying to create a VO that is not supported by DB, but instead takes its data from an external source (subsequently, a web service, but that's irrelevant to this question). I followed on each sample, I found and have created the VO and all overridden methods. I use this VO to create a LOV list for a VO another attribute, and the values in the LOV will vary based on a value in another attribute in the main volume (this is called LOVs cascading in various places).

    Here's an example, using the HR schema (a little artificial, I admit it):

    -Two your - DepartmentVO and ManagerVO - are defined

    -The DepartmentVO is supported by the DB and a normal EO and VO.

    -L' Manager in the DepartmentVO attribute is set to a supported by the ManagerVO LOV

    -The ManagerVO is programmatic and returns a list of employees who are in the same Department as the DepartmentID in the line of master DepartmentVO. To do this, use a Bind Variable (DeptId) that is set up to take the value of the DepartmentID attribute in the current line of DepartmentVO. This value of binding is used to filter the list of employees referred to only in the same Department.

    -J' replaced the executeQueryForCollection method in ManagerVOImpl. Here, I retrieve the value of the variable DeptId bind parameters passed in object/object2 to the method, and then use to retrieve employees in this Department of my main source.

    So far so good. Presents all works. (He lifts the employees in the same Department and displays them in the popup LOV.) If you change the Department then click to display the attribute Manager LOV, it shows you the list of employees in the new Department.)

    The problem I see is that the executeQueryForCollection method is called several times (2 or 3), causing the recovery of employees in the Department occur several times. For example, the test by running the AM executeQueryForCollection is called when I click the button to display the popup LOV (which makes sense). However, it is said AGAIN when I click the OK button in the popup LOV after selecting one of the values. (This should NOT!) And, if I create a JSF page and drop the data control to create a form and test it in this way, the executeQueryForCollection is called THREE times!

    I have the logic in the class ManagerVOImpl, which checks whether the list of employees has been recovered already, and if so, it's just returns the existing list. However, multiple calls are actually coming from different instances of the VO class, so that they only "see" the list has already been retrieved (because she was retrieved from another instance of the class, not this one).

    So my question is: How can I ADF do not call the executeQueryForCollection several times during the use of the VO as a LOV so that my (very expensive) call in the master repository to retrieve the list of employees is not executed more than necessary?  Is my only option to implement share caching mechanism myself that stores the list of employees of a Department somewhere in memory? I thought that ADF BC will make caching for me at the level VO?

    Thanks for any help that anyone can provide. I have literally been taken with that for two weeks, when I thought it would be a 'fast' to implement! :-)

    I'd be happy to upload/attach the source of my 'ManagerVOImpl' class, if that would be helpful.

    Have you tried to put a conditional statement in your back-end call happens only on your principal of the VO and not on the other 2 forums and see if that affects your functionality?

    that is, if (myIdName == "myVOInstance") {}

    do things;

    }

    I did it with VO this call that some heavy DB stored procedures in the executeQueryForCollection.

  • oracle.jbo.NoDefException: Houston-25002: definition of the type of the view definition com.model.ModVariablesView is not found.

    Hi all

    I am a newbie with ADF, I developed a test using Jdeveloper 12.1.3.0 application and it works very well on the integrated weblogic Domain.

    When I deploy the application (EAR and directly to Weblogic bot) to a second domain weblogic application fails to load to return the following error message:

    oracle.jbo.NoDefException: Houston-25002: definition of the type of the view definition com.model.ModVariablesView is not found.

    at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:880)

    at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:766)

    at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:748)

    at oracle.jbo.server.MetaObjectManager.findMetaObject(MetaObjectManager.java:862)

    at oracle.jbo.server.ViewDefImpl.findDefObject(ViewDefImpl.java:874)

    ........................................................................................................................

    The application has been updated to include EJB jar files in the ear.

    Any help is greatly appreciated.

    Kind regards

    Mihai

    The view definition is mentioned in the DataBindings.cpx file? In the DataBindings.cpx page definition files may need to be changed. Please post the DataBindings.cpx.

    See also

    Blog of melissa SOA: ADF 11 g Houston-25002: definition "VO" type View Definition is not found error

  • method of before the Phase of initMethod() in view calling several times:

    Hello world

    I dragged a table as read-only table with simple rank of verified selection.
    A button to go there in the page.
    The code in the go button takes the curretn by selecting the current row and the values of print.
    The initMethod() code is execution of the VO.

    The problem is when the page load the initMethod() (before the phase in view) calls several times even after loading the page.
    Continuously its call to this method.

    How to call only once when the page is loaded?

    All suggestions will be really useful.

    Thank you.

    Hello Kumar,
    There are many topics on the web to achieve this.
    This is one of them
    https://blogs.Oracle.com/ADF/entry/an_epic_question_how_to

  • How to find? in a text of the view (definition) in all schemas

    Hello

    Version of DB Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
    OS RHES 5U2

    I would appreciate if someone can tell me how to get a list of all views in the database that contains? in the text of the view definition.

    I tried with the two DBA_VIEWS and ALL_VIEWS to aid after the query, but it returned error.

    SELECT MASTER: '. ' || VIEW_NAME
    OF ALL_VIEWS
    WHERE THE TEXT LIKE ' %? %'
    AND the owner not in ('SYS', 'SYSTEM', "SYSMAN", "GENERAL", "OLAPSYS", "MDSYS", "CTXSYS")
    ORDER OF OWNER;
    WHERE THE TEXT LIKE ' %? %'
    *
    ERROR at line 3:
    ORA-00932: inconsistent data types: expected NUMBER got LONG


    SELECT MASTER: '. ' || VIEW_NAME
    FROM DBA_VIEWS
    WHERE THE TEXT LIKE ' %? %'
    AND the owner not in ('SYS', 'SYSTEM', "SYSMAN", "GENERAL", "OLAPSYS", "MDSYS", "CTXSYS")
    ORDER OF OWNER;
    WHERE THE TEXT LIKE ' %? %'
    *
    ERROR at line 3:
    ORA-00932: inconsistent data types: expected NUMBER got LONG

    Thank you

    WHERE THE TEXT LIKE ' %? %'

    The TEXT here is a LONG data type, you cannot use it in an expression.
    You can do this:

    SQL> select count(*) from user_views where text like '%OPRD%';
    select count(*) from user_views where text like '%OPRD%'
                                          *
    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected NUMBER got LONG
    
    SQL> create table myviews (view_name varchar2(30), text clob);
    
    Table created.
    
    SQL> begin
      2  for i in (select view_name,text from user_views) loop
      3  insert into myviews values (i.view_name,i.text);
      4  end loop;
      5  end;
      6  /
    
    PL/SQL procedure successfully completed.
    
    SQL> select count(*) from myviews where text like '%OPRD%';
    
      COUNT(*)
    ----------
           136
    
    SQL>
    

    Nicolas.

  • Easy way to locate the function used on the diagram by name?

    Is there an easy way to locate the functions used in the diagram under the name of the generic function?

    I have user appears somewhat to the user on my diagram functions to help me debug a difficult sequence of agross events live multiple now that it works, I want to go back and disable most of these postings. Most of them went up to now within the layers a little structure and is not easy to find.

    So is there an easy way to get a list of where these functions are used so that I can quickly go and edit them?

    I find the function is with the display hierarchy that does just what I need.

    Thank you.

  • Load the view definitions in the short data store

    Hi all

    If I was able to export the view definitions that there was error on next import
    «"substring on column 5 26 line - ' String index out of range:-161 '"»

    I tried the graphic loadviewdefinitions of the QuickStart project and it came with the same error. I also deleted the definition of the base xml view but it error persists.

    Thank you

    Please visit the wiki updated post for how to import the display configuration in the format provided by the design of view export configuration template:

    https://wikis.Oracle.com/display/endecainformationdiscovery/import+view+configuration

    -Ryan

  • Type of the object called several times Oracle constructor

    I have an object of type with a custom constructor. In SQL, when I reference attributes the constructor is called several times in Oracle 11.2.0.4.

    1. Why the constructor is called more than once?
    2. How can I stop it?

    My current job is about to reference attributes and use the / * + materialize * / tip.


    Problem installation

        create or replace type Foo as object
        (
          Bar1 NUMBER,
          Bar2 NUMBER,
          Bar3 NUMBER,
    
          CONSTRUCTOR FUNCTION Foo(p_Bar1 NUMBER, p_Bar2 NUMBER, p_Bar3 NUMBER)
            RETURN SELF AS RESULT
            DETERMINISTIC
        )
    /
        create or replace type body Foo is
    
          -- Member procedures and functions
          CONSTRUCTOR FUNCTION Foo(p_Bar1 NUMBER, p_Bar2 NUMBER, p_Bar3 NUMBER)
            RETURN SELF AS RESULT
            DETERMINISTIC
          AS
          BEGIN
            SELF.Bar1 := p_Bar1;
            SELF.Bar2 := p_Bar2;
            SELF.Bar3 := p_Bar3;
            dbms_output.put_line('Foo Constructor Called');
            RETURN;
          END;
    
        end;
    

    Problem

        -- Constructor is called 6 times! 
        -- Once for each column and once for each predicate in the where clause.
        SELECT x.f.bar1 AS bar1, x.f.bar2 AS bar2, x.f.bar3 AS bar3, f
        FROM (
          SELECT foo(p_Bar1 => 1, p_Bar2 => 2, p_Bar3 => 3) f
          FROM dual d
        ) x
        WHERE x.f.bar1 = x.f.bar1 AND x.f.bar2 = x.f.bar2
    

    Output

    Foo constructor called

    Foo constructor called

    Foo constructor called

    Foo constructor called

    Foo constructor called

    Foo constructor called

    Workaround

        -- Work Around
        -- Constructor is called 3 times
        -- Once for each column in the inline view. 
        -- Note, I removed column f (the object type) because it's not compatible with the materialize hint.
        WITH y AS (
          SELECT /*+ materialize */ x.f.bar1 AS bar1, x.f.bar2 AS bar2, x.f.bar3 AS bar3
          FROM (
            SELECT foo(p_Bar1 => 1, p_Bar2 => 2, p_Bar3 => 3) f
            FROM dual d
          ) x
        )
        SELECT y.bar1, y.bar2, y.bar3
        FROM y
        WHERE y.bar1 = y.bar1 AND y.bar2 = y.bar2
    

    Another solution is described in this thread... Access to the fields of an object custom type... which makes use of a type of collection combined with SCOREBOARD operator, like this...

    create or replace type FooTable as table of Foo;
    
    SELECT x.bar1 AS bar1, x.bar2 AS bar2, x.bar3 AS bar3, value(x) f
        FROM table(FooTable(
          foo(p_Bar1 => 1, p_Bar2 => 2, p_Bar3 => 3)
        )) x
        WHERE x.bar1 = x.bar1 AND x.bar2 = x.bar2
    ;
    
    BAR1 BAR2 BAR2 F
    1    2    3    (1, 2, 3)
    
    Foo Constructor Called
    

    Hope that helps...

    Gerard

  • Function called several times

    Hello

    In my custom workflow, when the user approves a notification, it goes to the next function in the workflow. I used the command insert in this function to insert data into a custom table. I see that the data is inserted 2 times with different values.
    I was wondering how the insert statement is called 2 times when he was supposed to do only once?

    Any suggestions?

    Thanks in advance.

    2 scenarios that can occur:

    (1) check whether you have a message notification function that is also an insert in the custom table.
    (2) to ensure that the procedure called by your function activity have good if funcmode conditions. Paste the snippet of the Workflow Developer's Guide:

    API standard for procedures called by function activities PL/SQL

    PL/SQL all the stored procedures that are called by the function or the notification of activities in a Workflow Oracle process should follow this standard API format so that the workflow engine can correctly run the activity.

    Important: The Workflow Engine traps errors generated by the function activities by defining a backup point before each function activity. If an activity generates an unhandled exception, the engine performs a restore to the backup point and sets the activity of the error state. For this reason, you should never engage in the PL/SQL to an activity of the function procedure. The questions never one workflow engine commit it is the responsibility of the calling application to commit.

    For environments such as database triggers or distributed transactions that do not allow for recording points, the workflow engine automatically intercepts the errors 'Point unauthorized registration' and differs from the execution of the activity of the base engine.

    Components of Oracle workflow that continue the asynchronous processing, such engines at bottom and the system of Notification, workflow are issued is committed, where appropriate on behalf of the calling application.

    The example in this section is numbered using the notation (1) for ease of use. The numbers themselves are not part of the process.

    (1) procedure
    (itemtype in varchar2,
    ItemKey in varchar2,
    actid number,
    funcmode in varchar2,
    Result out out varchar2) is

    (2)

    (3) start

    If (funcmode = 'RUN') then

    Out result: = ' COMPLETE:';
    return;
    end if;

    (4) if (funcmode = ' CANCEL') then

    Out result: = "FULL";
    return;
    end if;

    (5) if (funcmode = 'SKIP') then

    Out result: = ' COMPLETE:';
    return;
    end if;

    (6) if (funcmode = ' RETRY') then

    Out result: = ' COMPLETE:';
    return;
    end if;

    (7) if (funcmode = ' VALIDATE') then

    Out result: = "FULL";
    return;
    end if;

    (8) if (funcmode = 'RESPONSE') then

    Out result: = "FULL";
    return;
    end if;

    (9) if (funcmode = "forward") then

    Out result: = "FULL";
    return;
    end if;

    (10) if (funcmode = 'TRANSFER') then

    Out result: = "FULL";
    return;
    end if;

    (11) if (funcmode = 'QUESTION') then

    Out result: = "FULL";
    return;
    end if;

    (12) if (funcmode = ' REPLY') then

    Out result: = "FULL";
    return;
    end if;

    (13) if (funcmode = "TIMEOUT") then

    If () then
    Out result: = "FULL";
    on the other
    Out result: = wf_engine.eng_timedout;
    end if;
    return;
    end if;

    (14) if (funcmode = "") then
    Out result: = ' ';
    return;
    end if;

    (15) exception
    while others then
    WF_CORE. CONTEXT ("", "",
    , ,
    TO_CHAR (), );
    lift;

    (16) end ;

  • Hello! I use a PC and have problems loading my homepage of Muse. First of all, I made one with the address "nordensstjarnor" and updated several times without any problems. And once, I couldn't download on 'nordensstjarnor' any longer. Don't know why, s

    Hello! I use a PC and have problems loading my homepage of Muse. First of all, I made one with the address "nordensstjarnor" and updated several times without any problems. And once, I couldn't download on 'nordensstjarnor' any longer. Don't know why, when he got the address "nordensstjrnor". That me ok at first, but now I really need to give the first address once again, "nordensstjarnor". But when I try, the alternative of the site of ' publish on ' old isn't here. And if I try to create a new one, but with the old URL, the box turns red. What can I do?

    The reason why you cannot change nordensstjarnor.businesscatalyst.com is because a different Adobe ID is used for the publication of this site.

    t * [email protected] is used for the publication of nordensstjarnor.businesscatalyst.com

    t s. * [email protected] is used for the publication of nordensstjarnorindex.businesscatalyst.com

    You must make sure that Adobe ID is used in account publish, so that you can see a list of the websites published under this account. Go in Edition > Preferences > publish on Business Catalyst > publish with accounts

    You can pass the accounts for you can also make changes to the sites.

    Thank you

    Sanjit

  • Ive reinstalled my windows xp through the recovery on my computer several times trying to change my language to English... but it keeps French

    Ive reinstalled my windows xp through the recovery on my computer several times trying to change my language to English... but it keeps French

    Hello

    1. What is the base language that is installed on the system?

    You must install the English language pack.

    I advise you to review the eligibility criteria for the below mentioned link:

    http://Windows.Microsoft.com/en-us/Windows/language-packs#lptabs=XP

    Windows XP has Language Interface Pack provides a version translated from the dialogs used more widely, menu items, and help content. You may be eligible for the same function of the XP license.

    After you install the language pack, you will need to change the settings on your computer below:

    a. in the menu start standard Windows XP, click Startand then click Control Panel.

    In the start menu classic Windows XP, click Start, click settings, and then click Control Panel.

    b. double-click regional and Language Options.

    c. click the languages tab and then click details under "input languages and text Services.

    d. click Add under "installed Services", and then click the language you want to add and the keyboard layout you want to use for that language.

    e. to configure the settings for the Language bar, click language under "Preferences" bar

    You can also see the following article for more information:

    Regional and Language Options Overview:

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/int_pr_custom_workspace_regionalsettings.mspx?mfr=true

    Configure Windows XP for multiple languages: http://windows.microsoft.com/en-US/windows-xp/help/setup/set-up-multiple-languages-windows-xp

    HOW TO: Use the language bar in Windows XP: http://support.microsoft.com/kb/306993

    For all windows questions do not hesitate to contact us and we will be happy to help you.

  • FieldChangeListener fieldChanged called several times to EditField?

    Why fieldChanged is called several times in an EditField and how to avoid what is happening or maybe even control how many times the method, I want to be called, is called.

    The debugger that I noticed that my method is running serval times, most of the time + 20 times, and it's ruining the flow of just this is an edit field, is far from avoid this? I'm doing something wrong? or is this a normal behavior?

    I'm past the code if it helps, but if I can get the answers to these questions, am sure I can fix the code myself.

    Thank you

    Nevermind, figured it out, sorry for losing space, bandwidth, etc etc.

  • IPhoto on the external hard drive will not launch despite the force quit and relaunch several times. Can someone help me?

    I have a MacBook from 2008. 4 years ago I moved my iPhoto on an external hard drive. I have thousands if photos on it. IPhoto on the external hard drive will not launch despite the force quit and relaunch several times. Can someone help me?

    < re-titled by host >

    I moved my iPhoto on an external hard drive.

    Did you move the iPhoto library for the external hard drive or the iPhoto application, or both?

    How is formatted the external hard drive? Is the file system on the drive Mac OS extended (journaled) or other system files?  Is the drive directly connected by USB or similar, or is it a SIN?

    IPhoto on the external hard drive will not launch despite the force quit and relaunch several times.

    I don't understand - if you force quit smoking, launches the application, or you can not force it quit?

    IPhoto is suspended without doing anything, when you launch?

    What version of iPhoto does? And what version of Mac OS X?

  • Special character in the view definition

    Hello

    I am trying to create a view with a similar definition as follows. But it is still fast for a value of entry due to '& '. I can run it on sqlplus when defining "all set."

    How can I use it in the definition of the view?

    create or replace view abc

    as

    Select case when val = "a & b' then 'Hello' end of the double;"

    Thank you

    so in your sql worksheet use:

    set define off

    before you create the view...

    HTH

Maybe you are looking for