How to store the result of a query in a variable in the data model

In a model of date I want to do something like this

< name of dataTemplate = than one dataSourceRef "HURDetail" = "BRM_DATA_SOURCE" >
< Parameters >
< parameter name = "PARAM_THRESHOLD_VALUE" dataType = "number", defaultValue = "0" / >
< / Parameter >

< SQLStatement instance name = "Q1" >
<! [CDATA]
SELECT count (*) FROM TABLE_NAME
[]] >
< / sqlStatement >

-I want to assign the output of the above query to PARAM_THRESHOLD_VALUE so I can use it in future requests...
-My query is complex, for reason of performance I want to store the output of the query.

Please suggest how do...
Made a package with the PARAM_THRESHOLD_VALUE parameter and the function value entry assigns the done variable to work?

Thank you
Shiva

Hey Shiva,

If you want to use the value of the counter in the other queries in the data model, you can have an alias for the extraction of County and use it as a bind variable in other queries as


SELECT count (*) PARAM_THRESHOLD_VALUE
FROM TABLE_NAME
]]>

and can use it in another query as


SELECT XYZ
FROM TABLE_NAME2
WHERE XXX = *: PARAM_THRESHOLD_VALUE *.
]]>

Hope this is what you want.
Thank you.

Tags: Business Intelligence

Similar Questions

  • How to build the data model to the server of short?

    After the Quick Start Guide, I am still confused of short components. In the view of BI, it should be a short server integrated data model and a tool to develop and manage the data model. Which component is this role, CloverETL or something?

    We have created a series of screencast "Getting started with short Information" discovered who should provide that you answer these questions.

    You can find the full outline on our page OTN: http://www.oracle.com/technetwork/middleware/endeca/learnmore/index.html

    And, the screencasts are on our YouTube channel: https://www.youtube.com/user/OracleEID

    Thank you
    Carrie

  • How to consume the data model library adf for the project?

    Hello

    I use Jdev 11.1.1.6.

    I have a workspace Jdev containing the business component (entity objects, view and application module objects exposing the your). This workspace is deployed to a library of the ADF. This library is packed with DB connection details.

    I have a different workspace Jdev which needs to consume this library of ADF data model. This workspace is actually just the layer view (no business at all components).
    I added the data library ADF model to his draft opinion and it is showing application module and your sub of the data controls.

    My question is: how will this project view to connect to DB when running?
    It allows the connection of packaged data model ADF Libabry? If so, how?
    or should I create a business under this workspace view, just the purpose of connection project? If Yes, then what is the use of connections, including creating the library of the ADF?

    Thank you
    JAI

    Hello

    It uses the connection in the library of the ADF. However, I recommend that not save you the database connect information in the library of the ADF. Instead:

    -set the ADF BC model to use JDBC data sources
    -In the library of the ADF, configure it to contain only the name of data source
    -In the view project (the workspace) set up the database connection that is exposed by the library

    When the library is imported, verify the Application resources--> connections and right click on the name of the connection that is imported to configure

    Frank

  • Can someone suggest how to store the date/time format just for restoration

    Hello
    I do the restore process, but this isn't the case because just my date format.
    I'm him giving like this: export NLS_DATE_FORMAT ='YYYY-MM - DD:hh24:mi:ss'
    then I give in RRS file date like this:

    auxiliary connection.
    run
    {
    until time to_date (July 22, 2011 11:20:13 ',' dd-mm-yyyy hh24:mi:ss');

    It gives me the error:

    Single and double quotes (' or "") are accepted for a quoted string.
    Quotes are not required, except if the string contains embedded spaces.
    ======================================
    I tried giving WD in this format:
    The VALUE up to THAT TIME "to_date('2010-12-15:11:21:56','YYYY-MM-DD:hh24:mi:ss')";

    Then
    "to_date (July 22, 2011 11:20:13 ',' dd-mm-yyyy hh24:mi:ss')"; "

    Nothing works
    -------------------
    The one you suggest please?
    RMAN> run {
    2> set until time "to_date('22-07-2011 11:20:13','dd-mm-yyyy hh24:mi:ss')";
    3> }
    
    executing command: SET until clause
    
    RMAN>
    
  • update the model in the data model generator

    I was wondering how to upgrade the data model in the model generator (MS Word), so that I must not close word every time I have change the query (e.g. adding additional fields) - if anyone knows?

    Thank you
    Trent

    Try to reload the data file.

  • How to store the original and to remove some duplicate songs in iTunes on a PC Win7, which took place after iTunes to scan for music during a re - install?

    How to store the original and to remove some duplicate songs in iTunes on a PC Win7, which took place after iTunes to scan for music during a re - install?

    I recently had to format my hard drive and reinstall iTunes 12.3.2.35 on my Win7 PC. As part of the re - install iTunes, I clicked on the button scan for music.  This has created duplicates several of my songs.  I deleted then the duplicate songs from iTunes, but when I went to play a few songs a pop-up said "the song would not be because the original could not be found.  You want to locate? "When I tried to locate the song it is not found, but when I pulled the songs out of the trash they could be found.

    How can I keep the original and remove any duplicate songs in iTunes on PC Win7 which took place after iTunes to scan for music during a re - install?

    iTunes can create duplicates if the same content is added several times from outside the media folder when it is about to make copies of everything that is added to the library, or is added from an external drive that hosts the press kit that was disconnected during the launch of iTunes.

    Official notice of Apple on the duplicates is here: find and remove duplicates in your iTunes library. This is a manual process and article fails to explain some of the potential pitfalls such as the lost coast and membership of playlist, or sometimes the same file can be represented by multiple entries in the library as well as a removal and recycling the file will break all the others.

    Use MAJ > display > show items to reproduce exactly to display the duplicates because it is normally a selection more useful. You must manually select all but one of each group to remove. Sort the list by Date added can make easier select appropriate tracks, but it works better when executed immediately after the dupes were created.  If you have several entries in iTunes connected to a same file on the disk hard then don't not send to trash.

    Use my DeDuper script (Windows only) If you are not sure, do not want to do it by hand, or want to maintain ratings, play counts and playlist membership. See this background thread , this post for detailed instructions and Please take note of the warning to back up your library before deduping.

    (If you don't see the menu bar press ALT to temporarily view or CTRL + B to keep displayed.)

    The latest version of the script can put away the dead links as long as there is at least a double live to merge his stats and membership of the playlist and must deal wisely when the same file has been added through multiple paths.

    TT2

  • How to store the backup data set?

    I do a word game that I need to backup my data on PC. I don't know how to do it. Please guide me to record data on pc permanently.

    If you want to store the data of the input textfields, add you text in a table.

    Save the table in a flash cookie when you want (mouse click or other event).

    When you want to recover data just call saved the cookie table.

    It is displayed in the last comment.

    In this code, recording an array (testarray) under flashcookie.

    When you first run the code you get will be saved as undefined data.

    When you run the code once more, you will get the saved table.

  • defining the results of a query to a variable

    Hi all

    I'm having a problem affecting the results of a query to a variable. What I'm trying to do, is to do an AJAX call to a .cfc file and pass back the results of the function. The main problem is, I'm again moving a block of HTML (resulting from a cfquery in a cfoutput) stored in a variable. My code is something like...

    < name cffunction = "getText" access = "remote" returntype = 'Cancel' >

    < datasource = "" #request.dsn # cfquery "name ="queryTable">"
    SELECT kort, infoB

    Of infoTable

    < / cfquery >


    < cfset result = ' <!-this is the part I'm stuck, I want the table go here. -> ">"

    < table >
    < cfoutput query = "tablequery" >
    < b >
    < td > #infoA # < table > < td > #infoB # < table >
    < /tr >
    < / cfoutput >
    < /table >


    < cfwddx action = "cfml2js" input = "" # result # ' toplevelvariable 'o' = > "

    < / cffunction >

    It is a simplified version of what I want to do, but you get the idea...

    Is it still the right way to go about this?  Thank you

    That's what I get for trying the E-mail response feature!  Are you not happy, that I double checked my post.

    You could do a lot of string concatenation here to do stuff like"& Kort &""& infoB &""> time and time again."  But in reality the tags is so much easier to use.



      

        
      

    #infoA #.#infoB #.

  • How to store the output of a statement select * statement in a file?

    How to store the output of a statement select * / statement of dsc in a file?

    As user sys:

    CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
    /
    GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
    /
    

    As myuser:

    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                         ,p_dir IN VARCHAR2
                                         ,p_header_file IN VARCHAR2
                                         ,p_data_file IN VARCHAR2 := NULL) IS
      v_finaltxt  VARCHAR2(4000);
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_fh        UTL_FILE.FILE_TYPE;
      v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
    BEGIN
      c := DBMS_SQL.OPEN_CURSOR;
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      d := DBMS_SQL.EXECUTE(c);
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
        END CASE;
      END LOOP;
      -- This part outputs the HEADER
      v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
      FOR j in 1..col_cnt
      LOOP
        v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
      END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
      UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      IF NOT v_samefile THEN
        UTL_FILE.FCLOSE(v_fh);
      END IF;
      --
      -- This part outputs the DATA
      IF NOT v_samefile THEN
        v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
      END IF;
      LOOP
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        EXIT WHEN v_ret = 0;
        v_finaltxt := NULL;
        FOR j in 1..col_cnt
        LOOP
          CASE rec_tab(j).col_type
            WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                        v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
            WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                        v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                        v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
          ELSE
            v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
          END CASE;
        END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
        UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      END LOOP;
      UTL_FILE.FCLOSE(v_fh);
      DBMS_SQL.CLOSE_CURSOR(c);
    END;
    

    This allows the header line and the data to write into files separate if necessary.

    for example

    SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
    
    PL/SQL procedure successfully completed.
    

    Output.txt file contains:

    empno,ename,job,mgr,hiredate,sal,comm,deptno
    7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
    7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
    7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
    7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
    7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
    7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
    7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
    7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
    7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
    7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
    7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
    7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
    7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
    7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10
    

    The procedure allows for the header and the data to separate files if necessary. Just by specifying the file name "header" will put the header and the data in a single file.

  • How to store the ASO dat file in different location

    Hi all

    I have a requirement where I need to store the .dat (ASO) file in one location other than the folder where are stored the artifcats of enforcement. In OSB, we can right-click the database properties, edit, and in the storage tab, we can choose where the data files and indexes must be stored. We have a similar option of ASO too? because the space we have for the application files are limited and we have a separate drive of SAN for the storage of the data and index files, and this is where the BSO .pag files are stored. Since our ASO cube is more I want to move the data to a location where the data of the BSO, I mean for the player designated for data. Any suggestion will be highly appreciated.

    Thank you.

    Yes, ASO has the notion of 'spaces '. There are four (by default, temp, log and metadata), but you probably just want to pass the tablespaces 'default' and 'temp' in your location of SAN. Temp will look really small (i.e. empty) until you run a restructuring or consolidation, then it will explode to the size of the default storage space so it is important not to miss.

    See the section "Managing storage for ASO bases" here http://docs.oracle.com/cd/E17236_01/epm.1112/esb_dbag/asysadmn.html, or the MaxL "alter tablespace" command http://docs.oracle.com/cd/E17236_01/epm.1112/esb_tech_ref/maxl_alttabl.html here.

    EDIT: Actually, looking at the documentation, I see that you can't move the metadata or journal storage. But you're probably only going to worry about 'default' and 'temp' anyway.

  • How to access the data of all users of a page?

    Hi all, I'm new to APEX and have a query.

    I have installed APEX on my local machine, create a workspace and added a few users to roles.

    I'm creating an application, similar to a library application, where I have a table that stores information of books (BOOK_ID, BOOK_NAME, etc.). I would like to create another BOOK_USER table with two columns BOOK_ID and USER_ID. BOOK_ID refers to the BOOKS table and I want to USER_ID to refer to the table that stores the information of the users of the workspace I use. Data entry would be a page that has two LOVs, one for the name of book (using BOOK_ID as value) and another for the user name (USER_ID, or another field APEX uses to store the ID of the user). I can do in APEX? I found ways to access and authenticate a user to a page, but how to get the data of all users in the workspace? In other words, how to get all the usernames in a LOV?

    As I am new to APEX, I would appreciate if anyone can guide me through the steps, or posting links to the tutorial, etc.

    I think you can do this by querying APEX_WORKSPACE_GROUP_USERS.

  • How to divide the Dates

    Hi all...

    Here, I use the following scripts...

    create table a10 (eno number, date f, date t, number of sal)

    INSERT IN A10 (ENO, F, T, SAL) VALUES)

    1, TO_Date (1 July 2013 12:00:00 AM ',' DD/MM/YYYY HH: mi: SS AM'), TO_Date (June 30, 2014 12:00 ',' DD/MM/YYYY HH: mi: SS AM')

    (100);

    INSERT IN A10 (ENO, F, T, SAL) VALUES)

    1, TO_Date (May 1, 2013 12:00:00 AM ',' DD/MM/YYYY HH: mi: SS AM'), TO_Date (April 30, 2014 12:00 ',' DD/MM/YYYY HH: mi: SS AM')

    (200);

    COMMIT;

    entry:

    ENO      F             T                SAL

    07/01/2013 2014/06/30 100 1

    1 05/01/2013 30/04/2014 200

    Expected results:

    ENO FTSAL

    1 05/01/2013 2013/06/30 200

    1 30/04/2014 300 07/01/2013

    1 05/01/2014 2014/06/30 100

    I'm little bit confused how to divide the dates here... Any help is appreciated.

    Thank you all

    Stéphane

    Hello

    Always tell what version of Oracle you are using, especially if it's so old.

    In Oracle 10 (or 9, by the way) you can do this way:

    WITH cntr AS

    (

    SELECT LEVEL AS n

    OF the double

    CONNECT BY LEVEL<=>

    )

    got_change_date AS

    (

    SELECT d.eno

    C.n

    WHEN 1 THEN f

    ANOTHER t + 1

    END AS change_date

    C.n

    WHEN 1 THEN 1

    OF ANOTHER-1

    END as mul

    sal

    BY a10 d

    CROSS JOIN cntr c

    -WHERE... - If you need any filtering, put it here

    )

    got_total_sal AS

    (

    SELECT eno

    change_date f

    Advance (change_date) OVER (PARTITION BY eno

    ORDER BY change_date

    ) - 1 AS t

    SUM (sal * mul) over (PARTITION BY eno

    ORDER BY change_date

    ) AS total_sal

    OF got_change_date

    )

    SELECT *.

    OF got_total_sal

    WHERE t IS NOT NULL

    ORDER BY eno, f

    ;

  • How data (xml) sample in the data model get updated in bi publisher?

    Hi all

    I want to know how data sample get updates that is used in the reports to bi publisher data model?

    Thanks in advance
    Vishal

    Hello

    Its actualization based on the query that you create in the data model.

    Hope this answer will help you. Please let me know it's what you are expected?

    Thank you
    RDM

  • How to change the date format in OBIEE

    Hello

    I have a need to change the column to a column of varchar by OBIEE...

    The date column stores the data in the format "YYYY/MM/DD", I need to change that for a column of varchar with this format "YYYYMM"...

    Since I'm pointing directly to the transactional database, I can't make changes to the database level, so I have to do in OBIEE layer, of the ideas of how this could be done?

    Thanks in advance!

    Hi user,

    Reference: http://varanasisaichand.blogspot.com/2010/01/how-to-change-data-format-to-our-custom.html

    http://varanasisaichand.blogspot.com/2010/05/evaluate-function.html

    Thank you
    Saichand.v

  • How to search the data in special characters

    Hi all

    How to recover the data, if it has some special characters.

    examples of data
     
                           NO                Name
                             1                 J-O-H-N
                              2                 J*O*H*N
                              3                  JOHN BOSCO
                             4                  JOHN   K
               
    It's like this. If I pass JOHN as keyword query should return all rows. I'm using the version of oracle 10g. Please let me know how to achieve this.



    Kind regards
    Rajasekhar

    You can also use TRANSLATE to get rid of the unwanted characters:

    SQL> with samples as (select 'J-O-H-N' c from dual union all
      2                   select 'J*O*H*N' c from dual union all
      3                   select 'J!O!H!N' c from dual union all
      4                   select 'JOHN BOSCO' c from dual union all
      5                   select 'JOHN   K' c from dual
      6                  )
      7  select *
      8  from   samples
      9  where  upper(translate(c, 'X-*','X')) like '%JOHN%';
    
    C
    ----------
    J-O-H-N
    J*O*H*N
    JOHN BOSCO
    JOHN   K
    

    Note that I added a line to your test data which failed the test voluntarily.

Maybe you are looking for

  • just Firefox 4 but can not download on verizon security, he says can work with 2 or 3.

    When I connect to down load Verizon Security Suite it tells me that he doesn't know that the browser knows only 2 and Firefox 3.

  • Incorrect IMEI in Motoblur account online and other problems

    My first Atrix lasted a few weeks due to a problem of speaker and has been changed (so an IMEI change). I had frequent problems with the mail out from the phone - sometimes the emails go straight, sometimes afetr a few hours, sometimes not at all. I

  • global functional

    Hi all. Having the application main and 4 under apps.  Each of the 4 under apps functional a global (or motor action) in which he writes and reads a cluster of app-specific data. The idea is that using a functional overall for each application data c

  • Outlook 2007 problem: FRMCACHE. DAT

    Outlook 2007 problem: Message appears when dbl - clk to open an email, or I click New, reply or forward. "Could not install the custom action. The form cache file ' C:\. Application Data\Microsoft\Forms\FRMCACHE. ' DAT' is not valid.

  • Windows XP service pack 1

    I reinstalled Windows XP on my computer. How to install service pack 1? When I try windows update it tells me that the server did not respond, tried several times. He said, on the website of microsoft, it supports more Windows XP. Thank you