DATACOPY function problem using several variables quick

Hello

I have problem when I use more variables and then a quick calculation with DATACOPY function. When I put a prompt variable in function DATACOPY it works but when I add one or more it gives me error Essbasse (I can see it in the Essbase Administration journal not in the syntax checking process):

Not valid [Calc Script syntax

DATACOPY Q1020-> Dec-> 'FY14'-]

[Fri Jul 11 15:04:25 2014] Local/TS_PLAN/Prihodi/admin@Native Directory/1004/Error (1200421)

Error occurred at or after the line [8]

-Essbase put FY14 because it is rapidly Variable in this error above.

I try datacopy function with this:

DATACOPY Q1020-> Dec-> "FY14 '... It works

DATACOPY Q1200-> Dec-> {YearPrompt}... It works

DATACOPY Q1200-> Dec-> {YearPrompt}-> {ScenarioPrompt} it doesn't it break on variable ScenarioPrompt.

Thank you

Finally, I solved my problem. That was the problem Essbasse how to understand the spaces between the dimensions. I didn't not use quotes for members and I put space between the arrows. It gave me an error I think because he did not understand space as the space. Now, when I use quotes and remove the space between the arrows cross dimensions it works.

Tags: Business Intelligence

Similar Questions

  • Problem using bind variables in shared components report queries

    Greetings,

    I use APEX 4.0.1.00.03 and BI Publisher 10.1.3.4.1.

    In the APEX, I try to create a report query that uses bind variables in the where clause. I have a page that contains a button and a text element (P1_ID). The button is used to call the report. I went the shared components and created a new report query. Here is the text of the code.
    select violation_date
    , violation_type
    , nvl(:P1_ID,'zzz')
    from edd_procard_violations
    where upper(card_holder_id) = upper(:P1_ID)
    I also have Session State to enabled and have added the P1_ID in the area of 'State of Session' under the query.

    When I change the query, and click on the 'Set Bind Variables' button, I get a field where I can enter a value for: P1_ID I enter a value that should return lines, but when I click on the button "Test query", I get no rows returned. If I comment on where clause and test the query, even once, I get all rows in the table. You'll notice in my query I have included nvl(:P1_ID,'zzz'). When I run the query, without where clause, the returned value is always "zzz" indicating that: P1_ID is null.

    No idea what I am doing wrong?

    Thank you very much.
    Larry

    Hello Larry,.

    Looks like the wizard to create a report query in the shared components has a bug related to bind variables. I was able to reproduce your problem. Just create the query using the link variable, check the box to include session state, add the item and create the query. When you use the report query to download the report, where the your clause will work fine.

    Thank you
    Machaan

  • Several variables from the session to the login page

    Hey there, I have to point out that I use ASP for several years and am trying to start a transition to PHP. I'm kinda stuck and I don't know that there is a simple solution for this. After a login page, I go to my home page. When you are at the homepage depending on the status you are given i.e. level 1, 2 etc.

    Dreamweaver gives you the code to start a page and I seem to be able to capture the session variable 'MM_Username' on the start page, but in my setup, that's your name. Of course there could be a lot of 'Fred' out there so you need the info from the first name field. How to capture the session password or create a new session for password, so when I'm filtering the session on the page following I can use several variables as what follows must match the user name, password, address, etc?

    In asp is was easy. I started just a session variable capture since the names of the fields username and password. Like this:

    < % session ("NomUtilisateur1") = request ("username") % >

    < % session ("password1") = request ("pass") % >

    My session would be NomUtilisateur1, password1, and I would like to sort out.

    In PHP how would I do a similar thing? Help please!

    Here's the code generated from Dreamweaver.

    <? PHP
    If (! function_exists ("GetSQLValueString")) {}
    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
    If (via PHP_VERSION < 6) {}
    $theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;
    }

    $theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);

    Switch ($theType) {}
    case 'text ':
    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";
    break;
    case "long":
    case "int":
    $theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';
    break;
    case "double":
    $theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';
    break;
    case "date":
    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";
    break;
    case "set":
    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;
    break;
    }
    Return $theValue;
    }
    }
    ? >
    <? PHP
    Validate request to connect to this site.
    If (! isset {})
    session_start();
    }

    $loginFormAction = $_SERVER ['PHP_SELF'];
    If (isset($_GET['accesscheck'])) {}
    $_SESSION ['PrevUrl'] = $_GET ['accesscheck"];
    }

    If (isset($_POST['username'])) {}
    $loginUsername = $_POST ['username'];
    $password = $_POST ["password"];
    $MM_fldUserAuthorization = "";
    $MM_redirectLoginSuccess = "/ support/startpageSQL.php";
    $MM_redirectLoginFailed = ' / test2.php ';
    $MM_redirecttoReferrer = false;
    @mysql_select_db ($database_toyosupport, $toyosupport);

    $LoginRS__query = sprintf ("SELECT name, password AND password entry WHERE name = %s is %s",
    GetSQLValueString ($loginUsername, "text"), GetSQLValueString ($password, "text"));

    $LoginRS = mysql_query ($LoginRS__query, $toyosupport) or die (mysql_error ());
    $loginFoundUser = mysql_num_rows ($LoginRS);
    If {($loginFoundUser)
    $loginStrGroup = "";

    If (via PHP_VERSION > = 5.1) {session_regenerate_id (true) ;} else {session_regenerate_id() ;}
    Declare two session variables and assign them
    $_SESSION ["MM_Username"] = $loginUsername;
    $_SESSION ["MM_UserGroup"] = $loginStrGroup;

    If (isset($_SESSION['PrevUrl']) & & false) {}
    $MM_redirectLoginSuccess = $_SESSION ["PrevUrl"];
    }
    Header ("Location:".) $MM_redirectLoginSuccess);
    }
    else {}
    Header ("Location:".) $MM_redirectLoginFailed);
    }
    }
    ? >

    To make this work it turned out to be very simple. at the login page, I simply used:

    <>

    This is to set session values.

    $_SESSION ['username'] = $_POST ['username'];

    $_SESSION ['pass_word'] = $_POST ["password"];

    ?>

    After all the code from Dreamweaver to start a totally different pair of sessions.

    On the home page, I made the Recordset like this:



    <>
    If (! function_exists ("GetSQLValueString")) {}
    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
    If (via PHP_VERSION< 6)="">
    $theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;
    }

    $theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);

    Switch ($theType) {}
    case 'text ':
    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";
    break;
    case "long":
    case "int":
    $theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';
    break;
    case "double":
    $theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';
    break;
    case "date":
    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";
    break;
    case "set":
    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;
    break;
    }
    Return $theValue;
    }
    }

    $pass_word_rsUSERNAME = "-1";
    If (isset($_SESSION['pass_word'])) {}
    $pass_word_rsUSERNAME = $_SESSION ["pass_word"];
    }
    $user_name_rsUSERNAME = "-1";
    If (isset($_SESSION['user_name'])) {}
    $user_name_rsUSERNAME = $_SESSION ['user_name'];
    }
    @mysql_select_db ($database_toyosupport, $toyosupport);
    $query_rsUSERNAME = sprintf ("" SELECT * WHERE the password = name = %s AND %s entry ", GetSQLValueString ($pass_word_rsUSERNAME,"text"), GetSQLValueString ($user_name_rsUSERNAME,"text")");
    $rsUSERNAME = mysql_query ($query_rsUSERNAME, $toyosupport) or die (mysql_error ());
    $row_rsUSERNAME = mysql_fetch_assoc ($rsUSERNAME);
    $totalRows_rsUSERNAME = mysql_num_rows ($rsUSERNAME);
    session_start();? >

    Although Dreamweaver code struggled a bit he works and seems to be stable. Note that I added a session_start to the top of the page, even if the source code for Dreamweaver does not. This helped.

    I hope this helps.

  • Use of variable in the For-Each statement

    Hello gurus.

    I'm having a problem using a variable, I created in a statement for each. Here is the code I am using
    My goal is to create a variable based on the type of Bill. If the invoice is a proof or a reprint, a copy should be printed. If it's a final bill, I need two copies.

    <? xdoxslt:set_variable($_XDOCTX,_'x',_0)? >
    for each<? If: Print_Additional_Header_Text_ID238 = "PROOF"? > <? xdoxslt:set_variable($_XDOCTX,_'x',_1)? > <? end if? >
    <? If: Print_Additional_Header_Text_ID238 = "REPRINT"? > <? xdoxslt:set_variable($_XDOCTX,_'x',_1)? > <? end if? >
    <? : otherwise (Print_Additional_Header_Text_ID238)? > <? xdoxslt:set_variable($_XDOCTX,_'x',2)? > <? end if? >
    <? xdoxslt:get_variable($_XDOCTX,'x')? > <? for-each@section:xdoxslt:foreach_number($_XDOCTX,1,$x,1)? >

    foreach is the loop that I use to repeat sections of the Bill.

    When I run with the last impression for each preview, I get an error that says "undefined variable: 'x'"»
    But when I remove the last for each good variable, 1 or 2, will show in the invoice.

    My question is: How can I use the variable 'x' in <? for-each@section:xdoxslt:foreach_number($_XDOCTX,1,$x,1)? >

    TIA
    Darius

    Published by: 852460 on May 24, 2011 08:31

    Published by: DEK17 on July 20, 2011 13:15

    Probably, this will help you

    http://winrichman.blogspot.com/search/label/multiple%20copy

    Try

    
    or
    
    
  • Problem using multiple declarations

    I'm having a problem using several WITH instructions. Oracle seems to be waiting for a SELECT statement after the first. I need two to refer to things from each other in another query.

    Here is my code:

    < code >
    WITH calculate_terms AS (SELECT robinst_current_term_code,
    CASE
    WHEN robinst_current_term_code LIKE ' %' 60' THEN robinst_current_term_code - 40.
    WHEN robinst_current_term_code LIKE ' %' 20' THEN robinst_current_term_code - 100.
    END first_term

    CASE
    WHEN robinst_current_term_code LIKE ' %' 60' THEN robinst_current_term_code - 100.
    WHEN robinst_current_term_code LIKE ' %' 20' THEN robinst_current_term_code - 160.
    END second_term

    OF robinst
    WHERE robinst_aidy_code =: sanra)

    / * Use the terms of calculate_terms to generate attendance periods * /.
    WITH gen_attn_terms AS
    (
    SELECT
    CASE
    WHEN first_term AS '60% ' THEN 'fall'. substr (first_term, 0, 4)
    WHEN first_term LIKE '% 20' CAN 'spring'. substr (first_term, 0, 4)
    END first_attn_period

    CASE
    WHEN second_term AS '60% ' THEN 'fall'. substr (second_term, 0, 4)
    WHEN second_term LIKE '% 20' CAN 'spring'. substr (second_term, 0, 4)
    END second_attn_period

    OF calculate_terms
    )

    SELECT *.

    OF gen_attn_terms
    < code >

    I get ORA-00928: SELECT key word error absent. What could be the problem?

    You can just separate them with a comma:

    WITH calculate_terms AS (SELECT robinst_current_term_code,
    CASE
    WHEN robinst_current_term_code LIKE '%60' THEN robinst_current_term_code - '40'
    WHEN robinst_current_term_code LIKE '%20' THEN robinst_current_term_code - '100'
    END first_term,
    
    CASE
    WHEN robinst_current_term_code LIKE '%60' THEN robinst_current_term_code - '100'
    WHEN robinst_current_term_code LIKE '%20' THEN robinst_current_term_code - '160'
    END second_term
    
    FROM robinst
    WHERE robinst_aidy_code = :aidy),
    
    /*Use terms from calculate_terms to generate attendance periods*/
    gen_attn_terms AS
    (
    SELECT
    CASE
    WHEN first_term LIKE '%60' THEN 'Fall '||substr(first_term,0,4)
    WHEN first_term LIKE '%20' THEN 'Spring '||substr(first_term,0,4)
    END first_attn_period,
    
    CASE
    WHEN second_term LIKE '%60' THEN 'Fall '||substr(second_term,0,4)
    WHEN second_term LIKE '%20' THEN 'Spring '||substr(second_term,0,4)
    END second_attn_period
    
    FROM calculate_terms
    )
    

    Not yet tested there is no scripts.

  • Using the variable string quickly calling several variables

    OK, I'm not entirely sure how to explain it, but I will do my best...

    I have had several similar Boolean variables which are publicly declared at the beginning of my class.

    for example

    public var _ball0_mcPlaced:Boolean = false;
    public var _ball1_mcPlaced:Boolean = false;
    public var _ball2_mcPlaced:Boolean = false; 

    This will determine whether or not a particular ball was placed in a target area.

    Now I want to use this variable again in a function... However, I do not want to write in the variable for each ball in the service.

    Is there a faster way to access this variable by using a string inside the function varibale?  Each ball becomes a target of the event if clicked, so I could use something like...

    ("_" + event.target.name + "Placé") to create the dependent variable on which ball is selected?
    So, if ball0_mc is selected it returns the _ball0_mcPlaced variable?

    How can I do this?


    See you soon

    It would be written using the array notation in the form of...

    ["_" + event.target.name + "Placé"] = true;

  • using a variable outside the function that defines

    Why can't I not use the variable "numOfItems" outside of the function in the code I have attached below? I need to have a variable that retrieves its value in the number of nodes in an xml document and used later to the timeline root, outside the service the xml onLoad, once it has been loaded.



    You are still facing the same problem.

    Track at the bottom of your code tries to trace before your xml file has finished loading. Therefore, you have to wait as well.

    Inside your onLoad

    traceResult();

    And where you have your current track down.

    function traceResult() {}
    trace (numOfItems);
    }

    That should do it.

  • Use several of DV Panasonic NV-DS60 11 imported elements without problems.

    Use several of DV Panasonic NV-DS60 11 imported elements without problems.

    Now using elements 14 but this program does not SEE the camera.

    Why not 14 sees the camera and how can I fix this problem?

    joudar

    It's not Adobe, instead essentially a user to user forum. I saw the first 14 supported Import Formats of video clips list. My first impression is as follows. DV-stream (.dv) here does not refer to the ability of Premiere Elements to capture DV data using a firewire connection in Premiere Elements.

    It is my understanding that the raw DV via firewire can be stored in a file with a .dv file extension. You also have these same raw DV data via firewire can be stored in container (Windows) .avi or .mov (Mac). I'd say that Adobe 'Dv-stream (.dv)' refers to the import of a file DV.dv in a Premiere Elements project with add Media/files and folders.

    However, this interpretation reveals a problem because if I take a known Dv.dv file and try to import in first items 14, 13/13.1 on Windows 10 or 7 64-bit, it will not matter and gives the message saying that the file type is not supported or the codec is missing. This same DV.dv reproduces with the VLC Player.

    The frequency of the presence of Adobe in this forum is not defined. But, perhaps personal Adobe or Premiere elements support Team can clarify the inclusion of 'DV-stream (.dv) in its list of supported import Formats. There is certainly no more DV HDV data capture firewire premiere elements Capture window elements first 13/13.1 and 14.

    Will post more information that it will be available.

    RTA

  • Use a Variable on several pages

    Hello

    I would use the same variable on three pages.  Now I can't get it to work on two.  The first page is a simple HTML form, in which the variable is registered.  The second page uses the variable very well.  I use AJAX to designate a third page and I don't know how to use the same variable on the third page.  The variable is called 'find '.

    On the second page, I have this:

    $find = strip_tags($find);
    $find = trim ($find);
    $result=mysql_query("SHOW TABLES FROM sand2 LIKE '%$find%'")
    or die(mysql_error());

    The second page then AJAX that points to a third/URL of the page, and on this third/URL of the page, I have this:


    function getAllVotes($id)
       {
       $votes = array();
       $q = "SELECT * FROM santafe WHERE id = $id";

    On the third page, I would like to replace the 'Santa Fe' table with the variable "locate," the same variable that I use on the second page.  How can I do this?

    Thanks in advance,

    John

    $q = "SELECT * FROM $_SESSION['find'] WHERE id = $id";

    You cannot use an associative array element in a double quoted string. There are three ways to rewrite.

    1. the braces Suround array element:

    $q = "SELECT * FROM {$_SESSION['find']} WHERE id = $id";

    2. remove the single quotes of the index of the array element:

    $q = "SELECT * FROM $_SESSION[find] WHERE id = $id";

    3 concatenate the variable with the channels on each side:

    $q = "SELECT * FROM " . $_SESSION['find'] . " WHERE id = $id";

    All are valid ways to do it, but I prefer the first way with braces.

  • Use a variable name in a function?

    Here's my function...

    myInterval = setInterval (TTMO, 15);

    function TTMO () {}
    InstanceNameOfMovieClip._x = (InstanceNameOfMovieClip._x - _xmouse) / 10;
    InstanceNameOfMovieClip._y = (InstanceNameOfMovieClip._y - _ymouse) / 10-2;
    }

    Can I use a variable name instead of using the "InstanceNameOfMovieClip"? I tried, but it does not work. I also tried to use the correct hierarchy, as this ._parent. VariableName too.

    you have to concat the link with the movieclip using your variable of string like this

    var mcName_str = "bigBox_mc";

    This [mcName_str] ._x = 20;

    You can use this method to loop through the objects named in an incremental way

    for (var i: Number = 0; i<>
    {
    This ["mc" + i] ._x = 20;
    }

    hope that helped

  • Problem using AS a function

    Hi Guyz,
    I have a small problem using AS function. The problem is that I use AS a function in the WHERE clause
    to compare a column to a particular value, which gets this value from the front end. If the user has an apostrophe in the chain, he entered the SIMILAR function does not work because of the apostrophe. Is there a way I can escape the single quotation mark as escape us "%" and "_".

    Thank you.

    Replace function to replace the single quote with an empty space at the front end. SO it will replace the character, and you don't have to worry.

    Kind regards.

    LOULOU.

  • Why LabVIEW example projects using Global Variables?

    I'm puzzled.  I've been pretty good programmers LabVIEW talks (including some who work for the OR) and came away with the impression that Global Variables should, as a general rule, be avoided, with functional Global Variables (alias VI Globals) generally preferred for "local memory".

    I have studied some of the example distributed with LabVIEW, 2012 and 2013, in particular the proposed acquisition in real time and am struck by the use of Global Variables, where I'd be inclined to use instead a FGV.  For examples, to stop all the loops on the RT target, the overall "All the RT loop Stop" is defined; 'Constants' of configuration (such as timeouts, Streme network names, the names of the journal folder) are kept as Globals; Streme network endpoints are stored in Globals.

    [Note - there is a weird spelling of the second word of the network Streme, above - when I tried to post with the correct spelling, I got an error message saying this word is 'not allowed in this community".]  I apologize for the offense, but I must confess that I do not understand what the problem with the help of the spelling of this word...]

    Why use Globals in these cases, rather than write a bunch of VIGs to hold these data?  Note that almost all these Globals are 'Read' essentially (written once when a resource is acquired, for example) or "Read Only" (treated as if they were a constant).  Indeed, read-only variables can be written as a Subvi with only an output terminal, acting as a (visible, due to the icon) constant.

    I can see advantages to this approach.  On the one hand, VIGs can have error bounds who run the data flow (I just spotted a bug "data flow" in code, I am developing that is based on this model, to read configuration data to an XML file in a world and in the same VI, Global wiring to a "use - me" terminal, but with no guarantee that I'll read the overall after I write it).

    It is, I suppose, a matter of 'speed' - perhaps Global Variables are 'faster' than VIGs (especially if the VIG 'sits' on an error line).  My thought, however, is that this difference is likely to be trivial, especially as these VIGs (or Globals) tend to become "occasional" calls (with the exception of the indicator 'all the loop Stop' which is called once per line).

    Are there other arguments or considerations that make a Variable global to a better choice than a VIG?  Is there a reason that LabVIEW developers put in these start-up of projects LabVIEW?

    BS

    I have to ask, how do you use functional Global Variables?  Like just a Get and Set?  If so, you can use a global variable.

    Yes, globals are faster and use much less overhead.  At the summits of CLA in recent years, we talked about using globals.  The most common use is for Write-Once-Read Many and writing-never-Read Many with configuration data.  It's a good idea to use globals with the constants that can change on you.  It turns out that the world will have the same performance as a constant in this case.  This is done so that you don't have 1 place to edit the 'constant '.

    The rule on "Globals are evil" actually goes back several years when NEITHER had the huge "people of the country are bad" vendata.  But NEITHER explains well how to do things properly.  So I found people, instead of using local variables, using the value property node.  It's even worse because the property causes thread swaps and kills your performance.  It wasn't until I shouted to people to use wires and shift registers I have seen improvements in the way in which people wrote their code.  So people are always riffling in the use of globals and decided to use FGVs with the EEG and fixed rather cases.  But this does not solve the problem of the conditions of race with critical data and you cause an additional burden.

    So from my experience, I use globals all the time for configuration data.  Yes, you must be careful about the race conditions.  But as long as you understand that it is a common and useful practice.

    I would not use a global variable for data that are constantly changing (use registers to offset or Action motor) and/or processes that have critical sections of code (use a motor of Action).

    NOTE: I use the definition of Mercer to FGV (a Get/Set only) and motor Action (many cases which specifically affect the data).

  • Can I use a variable in a slider?

    Version of DB 10g
    Developer SQL 3.

    Hi once again, everything

    This post is a result of the post previous 'Sequence increment by 2 and not 1.'

    Here's a quick run down of what I do.
    We have historical records dating back decades and decades and decades (1900). Some of the most recent data were recorded in the worksheets. With some manipulation of data, it was possible to reorganize the data in its forms of entry in a flat file. These data were then imported into Access database, then using SQL Developer I made a data base for each access database connection and used copy for Oracle... tool to create a table in my flat file schema. In test data that I have right now that I copied the 5 access to Oracle databases and the results are five paintings called plot_84, plot_151 etc. I created a database that contains four main tables where the data from the flat files must be inserted, to standardize the it (I think the sentence is).

    I with the help of a large number has been able to train the following anonymous block, and it works very well (with the exception of the question of sequencing).

    DECLARE get_plot_measurement_id NUMBER;
    update_plot_measurements VARCHAR2(4000);
    get_tree_id NUMBER;
    get_plot_id NUMBER;
    
    BEGIN
        --1. Initiate insert process by getting PK from psp_plots
        SELECT plot_id INTO get_plot_id FROM psp_plots WHERE plot_name = 84; 
        
        --2. Insert records into psp_plot_measurements and keep relationship with psp_plots with variable get_plot_id.
        --   and get primary key value of psp_plot_measurements to insert into psp_tree_measurements during loop process.
        INSERT INTO psp_plot_measurements (plot_id) VALUES (get_plot_id) RETURNING plot_measurement_id INTO get_plot_measurement_id;    
        
        --3. Update record created at point 2.
        UPDATE psp_plot_measurements
           SET measurement_date    = (SELECT DISTINCT measurement_date FROM plot_84)
             , codominant_height   = (SELECT DISTINCT codominant_height FROM plot_84)
             , assessor            = (SELECT DISTINCT assessor FROM plot_84)
         WHERE plot_measurement_id = get_plot_measurement_id
         ; 
      
        --4. Open cursor to insert rows one at a  time and maintain relationships between related tables.
        FOR c1 IN
          (SELECT tree_number 
             FROM plot_84
          )
          
          LOOP      
        
            --5. Insert record into psp_trees
            --   and get primary key value of psp_trees to insert into psp_tree_measurements
            INSERT INTO psp_trees (plot_id, tree_name) VALUES (get_plot_id, c1.tree_number) RETURNING tree_id INTO get_tree_id;
        
            --6. Insert records into psp_tree_measurements and keep relationship with psp_trees with variable get_tree_id.
            INSERT INTO psp_tree_measurements (plot_measurement_id, tree_id) VALUES (get_plot_measurement_id, get_tree_id);
        
          END LOOP;
    
    END;
    /
    But me being someone who loves jobs mind numbing again and again, and more (about 1000 times x, who knows) still wants something I can preload a list of arrays of flat file (5 in this example) and just not run it.

    The problem is the following:
    Can I use a variable in a cursor, how are hilighted in bold below.

    "BOLD" has not worked is the bit of code FOR c1 IN (SELECT tree_number FROM plot_ | col_name_var) you will see just under point 4 below
    DECLARE p_column_num NUMBER;
    col_name_var VARCHAR2(30);
    type number_ptb IS table OF VARCHAR2(4000);
    p_column_nam number_ptb;    
    get_plot_measurement_id NUMBER;
    update_plot_measurements VARCHAR2(4000);
    get_tree_id NUMBER;
    get_plot_id NUMBER;
    
    BEGIN
    
        p_column_num := 5;
        p_column_nam := number_ptb();
        p_column_nam.extend(6);
    
        p_column_nam(1) := 84;
        p_column_nam(2) := 151;
        p_column_nam(3) := 152;      
        p_column_nam(4) := 214;
        p_column_nam(5) := 283;
    
        FOR loop_int IN 1 .. p_column_num
        LOOP
    
          col_name_var := p_column_nam(loop_int);
    
    --1. Initiate insert process by getting PK from psp_plots
          SELECT plot_id INTO get_plot_id FROM psp_plots WHERE plot_name = col_name_var; 
        
    --2. Insert records into psp_plot_measurements and keep relationship with psp_plots with variable get_plot_id.
    --   and get primary key value of psp_plot_measurements to insert into psp_tree_measurements during loop process.
          INSERT INTO psp_plot_measurements (plot_id) VALUES (get_plot_id) RETURNING plot_measurement_id INTO get_plot_measurement_id;    
        
    --3. Update record created at point 2.
          update_plot_measurements := '
          UPDATE psp_plot_measurements
             SET measurement_date    = (SELECT DISTINCT measurement_date FROM plot_' || col_name_var ||')
               , plot_size_10_30cm   = (SELECT DISTINCT plot_size_10_30cm FROM plot_' || col_name_var ||')
               , plot_size_30_50cm   = (SELECT DISTINCT plot_size_30_50cm FROM plot_' || col_name_var ||')
               , plot_size_50cm      = (SELECT DISTINCT plot_size_50cm FROM plot_' || col_name_var ||')
               , codominant_height   = (SELECT DISTINCT codominant_height FROM plot_' || col_name_var ||')
               , assessor            = (SELECT DISTINCT assessor FROM plot_' || col_name_var ||')
           WHERE plot_measurement_id = ' || get_plot_measurement_id
           ;
     
           EXECUTE IMMEDIATE update_plot_measurements;
      
    --4. Open cursor to insert rows one at a  time and maintain relationships between related tables.
          FOR c1 IN (SELECT tree_number FROM plot_|| col_name_var )   
              LOOP      
        
    --5. Insert record into psp_trees
    --   and get primary key value of psp_trees to insert into psp_tree_measurements
                INSERT INTO psp_trees (plot_id, tree_name) VALUES (get_plot_id, c1.tree_number) RETURNING tree_id INTO get_tree_id;
        
    --6. Insert records into psp_tree_measurements and keep relationship with psp_trees with variable get_tree_id.
                INSERT INTO psp_tree_measurements (plot_measurement_id, tree_id) VALUES (get_plot_measurement_id, get_tree_id);
        
              END LOOP;
      END LOOP;
      
    END;
    /
    Reviews on my welcome code.

    Ben

    Published by: benton on Sep 1, 2011 11:31

    Published by: benton on Sep 1, 2011 11:32

    Published by: benton on Sep 1, 2011 11:34

    with your current model, you need to write once for each table or write dynamic SQL regardless of the bulk of collect. adding most collect simply means you can do all the inserts in a single step and generally average performance benefits (see docco to COLLECT in BULK and for ALL).

    However, it is not really solve your problem.

    can I suggest an ETL step where you move all of the data in a table, then cross and run this function on all resulting?

  • Estimate of poor cardinality using Bind Variables

    Hi I'm using the 11.2.0.4.0 Oracle version. I have a query that is underway for the plan of the poor execution by the estimate of poor cardinality for two tables (I've extracted and published this part only) as I mentioned below, the individual conditions for which the estimate goes bad and moving entire query execution path.

    These are for two tables and currently we use BIND variable for them in our code, and I notice, its best estimate gives with literals. I need to know how to handle this scenario that I need this query to execute for all types of volumes. Is there something I can do without changing the code, as it works well for most of the execution? In the current scenario of the main query that uses those below tables providing a plan (index + nested loop) that works very well for small volume, but running for 10 hr + for large volume as ideally its going to the same regime.
    And Yes, most time that this request will be hit for small volume, but killing some appearance of large volume presents the performance of the queries.


    Here are the values of the variable binding.

    B1 VARIABLE VARCHAR2 (32);
    B2 VARIABLE VARCHAR2 (32);
    B3 VARIABLE NUMBER;
    B4 VARIABLE VARCHAR2 (32);
    B7 VARIABLE VARCHAR2 (32);
    B5 VARIABLE NUMBER;
    B6 VARIABLE NUMBER;

    EXEC: B1: = 'NONE ';
    EXEC: B2: = NULL;
    EXEC: B3: = 0;
    EXEC: B4: = NULL;
    EXEC: B7: = NULL;
    EXEC: B5: = 0;
    EXEC: B6: = 0;

    ---- For  TABLE1-------
     -- Published Actual VS Etimated cardinality
     
     
    -- With bind values
    select * from TABLE1 SF
    WHERE (   (SF.C1_IDCODE = :B4) OR (NVL (:B4, 'NONE') = 'NONE'))
        AND ( (SF.C2_ID = :B3) OR (NVL (:B3, 0) = 0));
    Plan hash value: 2590266031
    -----------------------------------------------------------------------------------------------------------------------------------------------
    | Id  | Operation                 | Name                | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |  OMem |  1Mem | Used-Mem |
    -----------------------------------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT          |                     |      1 |        |  28835 |00:00:00.08 |    2748 |     46 |       |       |          |
    |*  1 |  TABLE ACCESS STORAGE FULL| TABLE1              |      1 |     11 |  28835 |00:00:00.08 |    2748 |     46 |  1025K|  1025K|          |
    -----------------------------------------------------------------------------------------------------------------------------------------------
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       1 - storage((("SF"."C1_IDCODE"=:B4 OR NVL(:B4,'NONE')='NONE') AND ("SF"."C2_ID"=:B3 OR NVL(:B3,0)=0)))
           filter((("SF"."C1_IDCODE"=:B4 OR NVL(:B4,'NONE')='NONE') AND ("SF"."C2_ID"=:B3 OR NVL(:B3,0)=0))) 
     
    -- With literals 
    select * from TABLE1 SF
     WHERE  (   (SF.C1_IDCODE = null) OR (NVL (null, 'NONE') = 'NONE'))
          AND ( (SF.C2_ID = 0) OR (NVL (0, 0) = 0));
       Plan hash value: 2590266031
    --------------------------------------------------------------------------------------------------------------------------------------
    | Id  | Operation                 | Name                | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
    --------------------------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT          |                     |      1 |        |  28835 |00:00:00.03 |    2748 |       |       |          |
    |   1 |  TABLE ACCESS STORAGE FULL| TABLE1              |      1 |  28835 |  28835 |00:00:00.03 |    2748 |  1025K|  1025K|          |
    --------------------------------------------------------------------------------------------------------------------------------------
    
    --------For TABLE2 ----------------------- 
    -- Published Autotrace plan, as it was taking long time for completion, and actual cardinality is 45M, but its estimating 49 With bind value---
    
    --withbind value
    select * from TABLE2 MTF
    WHERE (   (MTF.C6_CODE = TRIM (:B2)) OR (NVL (:B2, 'NONE') = 'NONE'))
      AND (   (MTF.C3_CODE = :B1)  OR (NVL (:B1, 'NONE') = 'NONE'))
      AND (   (MTF.C4_CODE = :B7)  OR (:B7 IS NULL))
      AND (   (MTF.C5_AMT <= :B6)  OR (NVL (:B6, 0) = 0))
      AND (   (MTF.C5_AMT >= :B5)  OR (NVL (:B5, 0) = 0));
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 1536592532
    -----------------------------------------------------------------------------------------------------------
    | Id  | Operation                  | Name         | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    -----------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT           |              |    49 | 10437 |   358K  (1)| 01:11:43 |       |    |
    |   1 |  PARTITION RANGE ALL       |              |    49 | 10437 |   358K  (1)| 01:11:43 |     1 |  2 |
    |*  2 |   TABLE ACCESS STORAGE FULL| TABLE2       |    49 | 10437 |   358K  (1)| 01:11:43 |     1 |  2 |
    -----------------------------------------------------------------------------------------------------------
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       2 - storage(("MTF"."C4_CODE"=:B7 OR :B7 IS NULL) AND ("MTF"."C3_CODE"=:B1 OR
                  NVL(:B1,'NONE')='NONE') AND ("MTF"."C5_AMT"<=TO_NUMBER(:B6) OR NVL(:B6,0)=0) AND
                  ("MTF"."C5_AMT">=TO_NUMBER(:B5) OR NVL(:B5,0)=0) AND ("MTF"."C6_CODE"=TRIM(:B2) OR
                  NVL(:B2,'NONE')='NONE'))
           filter(("MTF"."C4_CODE"=:B7 OR :B7 IS NULL) AND ("MTF"."C3_CODE"=:B1 OR
                  NVL(:B1,'NONE')='NONE') AND ("MTF"."C5_AMT"<=TO_NUMBER(:B6) OR NVL(:B6,0)=0) AND
                  ("MTF"."C5_AMT">=TO_NUMBER(:B5) OR NVL(:B5,0)=0) AND ("MTF"."C6_CODE"=TRIM(:B2) OR
                  NVL(:B2,'NONE')='NONE'))
      
    -- with literal
    select * from TABLE2 MTF
    WHERE (   (MTF.C6_CODE = TRIM (null)) OR (NVL (null, 'NONE') = 'NONE'))
     AND (   (MTF.C3_CODE = 'NONE') OR (NVL ('NONE', 'NONE') = 'NONE'))
      AND (   (MTF.C4_CODE = null)  OR (null IS NULL))
       AND (   (MTF.C5_AMT <= 0)  OR (NVL (0, 0) = 0))
      AND (   (MTF.C5_AMT >= 0)  OR (NVL (0, 0) = 0));
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 1536592532
    -----------------------------------------------------------------------------------------------------------
    | Id  | Operation                  | Name         | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    -----------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT           |              |    45M|  9151M|   358K  (1)| 01:11:41 |       |    |
    |   1 |  PARTITION RANGE ALL       |              |    45M|  9151M|   358K  (1)| 01:11:41 |     1 |  2 |
    |   2 |   TABLE ACCESS STORAGE FULL| TABLE2 |    45M|  9151M|   358K  (1)| 01:11:41 |     1 |  2 |
    -----------------------------------------------------------------------------------------------------------
    
    select column_name,num_nulls,num_distinct,density
    from dba_tab_col_statistics where table_name='TABLE2'
    and column_name in ('C3_CODE','C4_CODE','C5_AMT','C6_CODE');
    C3_CODE 0 65 0.0153846153846154
    C4_CODE 0 2 0.5
    C5_AMT 0 21544 4.64166357222429E-5
    C6_CODE 1889955 71 0.0140845070422535
    
    

    933257 wrote:

    ((SF. C1_IDCODE =: B4) OR (NVL (: B4, 'NONE') = 'NONE'))

    In fact for literals, I did not find any section of the predicate after running the sql code with activation "set autotrace traceonly explain."

    The main problem is with another large query whose cardinality is underestimated due to the presence of these table (table1, table2) with the above mentioned clause, and the query is for the analysis of index + nested with values of Bind loops and take 10 hr +, whereas with literals, its completion in ~ 8minutes with FTS + Hash Join.

    Your real problem is that you try to have just a single SQL query handle all POSSIBLE thanks to the use of embedded FILTERS ' either / or ' filters in the WHERE clause.  You want only a select this OPTION to run whatever filters have been selected at run time by the user or the application using it.  And it would never work.  You really need to SELECT different queries for different combinations of filter conditions.

    Why?  Think for a minute.  How Oracle works internally?  A SQL SELECT query gets analyzed and an execution plan is produced which is stored in the library cache and gets REUSED on all subsequent executions of this query - except in certain cases where there may exist several plans run through several cursors of the child.  So with only SELECT a query you only AN execution plan in the library cache, to be used by all THE executions of this query, regardless of the value of your run-time binding variables.

    Lets put another way - each library cache execution plan is associated with a SQL statement.  If you want a DIFFERENT execution plan then you need run a DIFFERENT SQL statement.  That's how you get a different execution plan - by running a different SQL statement.  Running the SAME SQL query generally you will get the SAME execution plan every time.

    In addition, because of the "either / or" filters that you use you will end up generally with a full Table Scan on each of the referenced tables.  Why?  Given that the optimizer must produce an implementation plan that manages all possible contingencies for all values of possible bind variables in the SELECT.  If the optimizer should choose to use any index based on one of these "either / or" filters then it would only help performance when real value was provided, but it would be really bad if a NULL value was supplied.  If the optimizer ends up ignoring the index because they are not always optimal for all possible input values and instead chose a plan that is "good enough" for all input values possible.  That means that it will use a scanning Table full.

    I hope you can see that it is precisely what is happening for you with your query.  You select this OPTION to manage the different combinations of filter, which leads to the execution plan only one, which leads to scans full Table on the referenced tables in these ' either / or ' filters.

    The solution?  Build queries SELECT DIFFERENT when input values are NULL.  How you do that?  Read this article to ask Tom that tells you:

    http://www.Oracle.com/technetwork/issue-archive/2009/09-Jul/o49asktom-090487.html

    To sum up - when you have real value for a bind variable 'bind_var1' add the following filter to your CHOICE:

    AND column_name1 =: bind_var1

    When the binding variable is NULL, add the filter according to your CHOICE:

    AND (1 = 1 OR: bind_var1 IS NULL)

    Now, you'll have 2 queries SELECT must be performed, which have exactly the same number of variables in the same order bind, which is important.  When you then run one of these variations, Oracle can analyze and optimize each one SEPARATELY, with a single execution by the SELECT query plan.

    When you provide a real value, the filter is a normal 'column = value' that the optimizer can use all indexes on this column, because NULL values are not referenced.

    When there is no real value, the optimizer will analyze the '1 = 1 GOLD' and realize that "1 = 1" is set to TRUE and GOLD, it is quite TRUE regardless because the binding variable is null or not.  This means that the optimizer will actually REMOVE this filter, because it filters nothing because it is always TRUE.  You will end up with an operating plan based on the other filters in the query, which is what you want because you have no filter on this column.

    What is it - producing distinct SELECT queries to determine if you have a real value to filter or not you end up with DIFFERENT execution plans for each of them, and each of them is OPTIMAL for this particular set of filters.  Now you get good performance for each variation of the performance of the SELECTION, rather than sometimes good and sometimes very bad when using SELECT only one.  It is impossible to try to get multiple shots of execution 'optimal' out of a SELECT query.  That's why you get mediocre performance under different bound the values of the variables.

    John Brady

  • Why not transform the work? I'm doing a simple resize a smart object, and I constantly have problems. do not transformation. I had this same problem on several images and I've just updated to the latest

    I had frequent problems trying to resize the smart objects - I am unable to use the transformation. I had this problem on several images. I had some success by restarting Photoshop CC and Windows, but this does not always solve the problem. Is this a known issue? It's really annoying. I had this problem before the last update, and it continued after the most recent update.

    Hi djdphotography

    • You also have the same result if you create a layer duplicate the layer of the same image?
    • Also be sure that you do not have the Quick Mask mode by mistake (press Q to turn it off before you select the transform tool)

    Useful article:-Photoshop help | Free transformations of images, forms and paths

    Concerning

    ~ Assani

Maybe you are looking for