Dynamic variable in class declaration?

I've googled this endlessly but I can't find any syntax that helps with this particular question.
I have (overly simplified):
for (i=0; i<10; i++) {
     var pieceName:PieceName = new PieceName(); //this obviously isn't right
I need it to create "pieceName1" and "pieceName2" etc.
I tried:
var this["pieceName" + i]:PieceName = new PieceName();
But that didn't work.
I tried googling Array Notation but I also couldn't find anything that would help in class declarations.
What syntax am I looking for?

You can use something like...
for (var i=0; i<10; i++) {
     this["pieceName"+String(i)] = new PieceName();
But further reference to target the object still needs to use the array notation... meaning you cannot target:
   pieceName0._alpha...
but would have to use...
   this["pieceName0"].alpha...
Another approach could be to use an array and fill that array with the instances as you create them...
var pieceNames:Array = new Array()
for (var i=0; i<10; i++) {
     pieceNames[i] = new PieceName();

Similar Messages

  • Dynamic Variable Declare

    Hi experts,
    How can i declare Dynamic variable under loop,
    I have Data from CABN Table with Char Name /Data type/Length.
    Is there any function module or method where i provide the parameters for declaration.
    thanks.

    DATA r_elemdescr TYPE REF TO cl_abap_elemdescr.
    r_elemdescr ?= cl_abap_elemdescr=>describe_by_name( 'DATA_ELEMENT_HERE' ).
    DATA r_field TYPE REF TO data.
    FIELD-SYMBOLS <field> TYPE ANY.
    CREATE DATA r_field TYPE HANDLE r_elemdescr.
    ASSIGN r_field->* TO <field>.
    <field> = .....
    "now <field> is your dynamic field value
    Regards
    Marcin

  • Error editing task sequence: Failed to load dynamic properties for class "SMS_TaskSequence_ApplyWindowsSettingsAction" From XML into WMI

    I've started getting an intermittent error editing my Windows 7 OSD task sequence.  Sometimes I can open the TS to edit, but when I try to apply changes I get the error.  Other times I get the error when trying to open the TS.  If I try again
    right away, I still get the error, but if I wait a few minutes and try again sometimes it will open the TS. 
    The error reads:
    ConfigMgr Error Object:instance of SMS_Extended Status{Description = "Failed to load dynamic properties for class \"SMS_TaskSequence_ApplyWindowsSettingsAction\" from XML into WMI";Error Code = 2147943746;File = "e:\\qfe\\nts\\sms\\siteserver\\sdk_provider\\smsprov\\ssptspackage.cpp";Line = 3454;Operation = "ExecMethod";ParameterInfo = "SMS_TaskSequencePackage";ProviderName = "WinMgmt";StatusCode = 2147749889;}
    Coinciding with this error, I show the following entries in the TaskSequenceProvider.log file: 
    [PID: 7608] Invoking method SMS_TaskSequence.LoadFromXml
    TaskSequenceProvider
    Failed to protect memory buffer, hr=0x80070542
    TaskSequenceProvider
    Failed to load dynamic properties for class "SMS_TaskSequence_ApplyWindowsSettingsAction" from XML into WMI 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load node Apply Windows Settings from XML into WMI 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load children steps for node "PostInstall" from XML 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load children steps for node "Execute Task Sequence" from XML 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load children steps for node "" from XML 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load XML for the task sequence into WMI 0x80070542 (2147943746)
    TaskSequenceProvider
    [PID: 7608] Done with method SMS_TaskSequence.LoadFromXml
    TaskSequenceProvider
    Setting status complete:  status code = 0x80070542; Failed to load dynamic properties for class "SMS_TaskSequence_ApplyWindowsSettingsAction" from XML into WMI
    TaskSequenceProvider
    I exported the task sequence and checked in "object.xml" for the "ApplyWindowsSettingsAction", to see if there was something odd in the xml, but I don't find anything that jumps out as being wrong.  Here's the section of XML for
    that step.  I've removed identifying info, and replaced it with a generic term in bold.
    <step type="SMS_TaskSequence_ApplyWindowsSettingsAction" name="Apply Windows Settings" description="" runIn="WinPE" successCodeList="0" runFromNet="false"><action>osdwinsettings.exe /config</action><defaultVarList><variable name="OSDLocalAdminPassword" property="AdminPassword"></variable><variable name="OSDComputerName" property="ComputerName">%_SMSTSMachineName%</variable><variable name="OSDProductKey" property="ProductKey"></variable><variable name="OSDRandomAdminPassword" property="RandomAdminPassword">false</variable><variable name="OSDRegisteredOrgName" property="RegisteredOrgName">COMPANY NAME</variable><variable name="OSDRegisteredUserName" property="RegisteredUserName">COMPANY NAME</variable><variable name="OSDServerLicenseConnectionLimit" property="ServerLicenseConnectionLimit">5</variable><variable name="OSDTimeZone" property="TimeZone">Central Standard Time</variable></defaultVarList></step><step type="SMS_TaskSequence_ApplyNetworkSettingsAction" name="Apply Network Settings" description="" runIn="WinPEandFullOS" successCodeList="0" runFromNet="false"><action>osdnetsettings.exe configure</action><defaultVarList><variable name="OSDDomainName" property="DomainName">DOMAIN.COM</variable><variable name="OSDJoinPassword" property="DomainPassword"></variable><variable name="OSDJoinAccount" property="DomainUsername">DOMAIN ACCOUNT</variable><variable name="OSDEnableTCPIPFiltering" property="EnableTCPIPFiltering" hidden="true">false</variable><variable name="OSDNetworkJoinType" property="NetworkJoinType">0</variable><variable name="OSDAdapterCount" property="NumAdapters" hidden="true">0</variable></defaultVarList></step>
    Is there any other log I should check for a clue on this issue?  What could be causing this error?

    Thanks for sharing that!  I tend to save contacting MS support until after I've exhausted other options.  I'm always afraid that I'll spend the $500 to open a case and then it turns out to be something simple that I would have found if I had just
    kept working on it myself a little longer.
    It looks like that link is for an update released in February as KB3023562.  I downloaded and installed it. I'll try opening/editing/saving the task sequence a few times today to see if the issue is resolved.  
    After I had already installed it, I thought to look up that update in configmgr.  The update is listed as superseded by 2 other updates.  The newest of those is KB3046049, which just installed last night with the other March patches, so it's possible
    that I didn't need to install KB3023562 after all.  

  • Creating dynamic variable names

    I know there has got to a way to do this but I am not finding anything on google. I want to create a dynamic variable name like name + i so when your in a loop the names come out name1, name2 and so on till however many you want. I have tried
    int name + i = 3;
    int name[i] = 3; // which obviously won't but I had to try
    int name{i} = 3;and I am out of ideas. Thanks for all your help.

    I'd suggest using variables named j or x when posting code which uses them as array indexes.
    [i] - is for italics formatting
    [u] - is for underlined formatting
    [code] is for class Example { ... } code formatting
    etc.

  • How to generate report with dynamic variable number of columns?

    How to generate report with dynamic variable number of columns?
    I need to generate a report with varying column names (state names) as follows:
    SELECT AK, AL, AR,... FROM States ;
    I get these column names from the result of another query.
    In order to clarify my question, Please consider following table:
    CREATE TABLE TIME_PERIODS (
    PERIOD     VARCHAR2 (50) PRIMARY KEY
    CREATE TABLE STATE_INCOME (
         NAME     VARCHAR2 (2),
         PERIOD     VARCHAR2 (50)     REFERENCES TIME_PERIODS (PERIOD) ,
         INCOME     NUMBER (12, 2)
    I like to generate a report as follows:
    AK CA DE FL ...
    PERIOD1 1222.23 2423.20 232.33 345.21
    PERIOD2
    PERIOD3
    Total 433242.23 56744.34 8872.21 2324.23 ...
    The TIME_PERIODS.Period and State.Name could change dynamically.
    So I can't specify the state name in Select query like
    SELECT AK, AL, AR,... FROM
    What is the best way to generate this report?

    SQL> -- test tables and test data:
    SQL> CREATE TABLE states
      2    (state VARCHAR2 (2))
      3  /
    Table created.
    SQL> INSERT INTO states
      2  VALUES ('AK')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('AL')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('AR')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('CA')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('DE')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('FL')
      3  /
    1 row created.
    SQL> CREATE TABLE TIME_PERIODS
      2    (PERIOD VARCHAR2 (50) PRIMARY KEY)
      3  /
    Table created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD1')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD2')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD3')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD4')
      3  /
    1 row created.
    SQL> CREATE TABLE STATE_INCOME
      2    (NAME   VARCHAR2 (2),
      3       PERIOD VARCHAR2 (50) REFERENCES TIME_PERIODS (PERIOD),
      4       INCOME NUMBER (12, 2))
      5  /
    Table created.
    SQL> INSERT INTO state_income
      2  VALUES ('AK', 'PERIOD1', 1222.23)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('CA', 'PERIOD1', 2423.20)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('DE', 'PERIOD1', 232.33)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('FL', 'PERIOD1', 345.21)
      3  /
    1 row created.
    SQL> -- the basic query:
    SQL> SELECT   SUBSTR (time_periods.period, 1, 10) period,
      2             SUM (DECODE (name, 'AK', income)) "AK",
      3             SUM (DECODE (name, 'CA', income)) "CA",
      4             SUM (DECODE (name, 'DE', income)) "DE",
      5             SUM (DECODE (name, 'FL', income)) "FL"
      6  FROM     state_income, time_periods
      7  WHERE    time_periods.period = state_income.period (+)
      8  AND      time_periods.period IN ('PERIOD1','PERIOD2','PERIOD3')
      9  GROUP BY ROLLUP (time_periods.period)
    10  /
    PERIOD             AK         CA         DE         FL                                             
    PERIOD1       1222.23     2423.2     232.33     345.21                                             
    PERIOD2                                                                                            
    PERIOD3                                                                                            
                  1222.23     2423.2     232.33     345.21                                             
    SQL> -- package that dynamically executes the query
    SQL> -- given variable numbers and values
    SQL> -- of states and periods:
    SQL> CREATE OR REPLACE PACKAGE package_name
      2  AS
      3    TYPE cursor_type IS REF CURSOR;
      4    PROCEDURE procedure_name
      5        (p_periods   IN     VARCHAR2,
      6         p_states    IN     VARCHAR2,
      7         cursor_name IN OUT cursor_type);
      8  END package_name;
      9  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE BODY package_name
      2  AS
      3    PROCEDURE procedure_name
      4        (p_periods   IN     VARCHAR2,
      5         p_states    IN     VARCHAR2,
      6         cursor_name IN OUT cursor_type)
      7    IS
      8        v_periods          VARCHAR2 (1000);
      9        v_sql               VARCHAR2 (4000);
    10        v_states          VARCHAR2 (1000) := p_states;
    11    BEGIN
    12        v_periods := REPLACE (p_periods, ',', ''',''');
    13        v_sql := 'SELECT SUBSTR(time_periods.period,1,10) period';
    14        WHILE LENGTH (v_states) > 1
    15        LOOP
    16          v_sql := v_sql
    17          || ',SUM(DECODE(name,'''
    18          || SUBSTR (v_states,1,2) || ''',income)) "' || SUBSTR (v_states,1,2)
    19          || '"';
    20          v_states := LTRIM (SUBSTR (v_states, 3), ',');
    21        END LOOP;
    22        v_sql := v_sql
    23        || 'FROM     state_income, time_periods
    24            WHERE    time_periods.period = state_income.period (+)
    25            AND      time_periods.period IN (''' || v_periods || ''')
    26            GROUP BY ROLLUP (time_periods.period)';
    27        OPEN cursor_name FOR v_sql;
    28    END procedure_name;
    29  END package_name;
    30  /
    Package body created.
    SQL> -- sample executions from SQL:
    SQL> VARIABLE g_ref REFCURSOR
    SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2,PERIOD3','AK,CA,DE,FL', :g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         CA         DE         FL                                             
    PERIOD1       1222.23     2423.2     232.33     345.21                                             
    PERIOD2                                                                                            
    PERIOD3                                                                                            
                  1222.23     2423.2     232.33     345.21                                             
    SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2','AK,AL,AR', :g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         AL         AR                                                        
    PERIOD1       1222.23                                                                              
    PERIOD2                                                                                            
                  1222.23                                                                              
    SQL> -- sample execution from PL/SQL block
    SQL> -- using parameters derived from processing
    SQL> -- cursors containing results of other queries:
    SQL> DECLARE
      2    CURSOR c_period
      3    IS
      4    SELECT period
      5    FROM   time_periods;
      6    v_periods   VARCHAR2 (1000);
      7    v_delimiter VARCHAR2 (1) := NULL;
      8    CURSOR c_states
      9    IS
    10    SELECT state
    11    FROM   states;
    12    v_states    VARCHAR2 (1000);
    13  BEGIN
    14    FOR r_period IN c_period
    15    LOOP
    16        v_periods := v_periods || v_delimiter || r_period.period;
    17        v_delimiter := ',';
    18    END LOOP;
    19    v_delimiter := NULL;
    20    FOR r_states IN c_states
    21    LOOP
    22        v_states := v_states || v_delimiter || r_states.state;
    23        v_delimiter := ',';
    24    END LOOP;
    25    package_name.procedure_name (v_periods, v_states, :g_ref);
    26  END;
    27  /
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         AL         AR         CA         DE         FL                       
    PERIOD1       1222.23                           2423.2     232.33     345.21                       
    PERIOD2                                                                                            
    PERIOD3                                                                                            
    PERIOD4                                                                                            
                  1222.23                           2423.2     232.33     345.21                       

  • Dynamically loading a class that is part of a larger loaded package

    I am dynamically loading a class that is part of a large package, much of which is loaded at startup. The code directly references protected variables in the parts of the package that is loaded by the default class loader. Attempting to access these protected variables gives an access error when the class is dynamically loaded that doesnt occur when the class is loaded at startup.
    Is there a way to make this work?

    To answer my own question -- no
    A reference from http://access1.sun.com/techarticles/DR-article.html says:
    The use of Dynamic Class Reloading can introduce problems when classes that are being dynamically reloaded make calls to non-public methods of helper classes that are in the same package. Such calls are likely to cause a java.lang.IllegalAccesserror to be thrown. This is because a class that is dynamically reloaded is loaded by a different classloader than the one used to load the helper classes. Classes that appear to be in the same package are effectively in different packages when loaded by different classloaders. If class com.myapp.MyServlet is loaded by one classloader and an instance of it tries to call a non-public method of an instance of class com.myapp.Helper loaded by a different classloader, the call will fail because the two classes are in different packages.
    So not being able to access non-private variables in this scenario is the way it works.

  • How to move a dynamic variable to a FIELD-SYMBOL

    Hello:
    i would like to ask a favor i have been trying to move a dynamic variable to a FIELD-SYMBOL but, when i compile the programm it send a error message that say 'error with assign'.
    The FS is declared like this
    FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE, <dyn_wa>.
    and then there is a PERFORM that send a dynamic varible and then this variable is asigned to the <dyn_table> and after of this one variable is created like this CREATE DATA wa_dynamic LIKE LINE OF <dyn_table>.
    and finalilly there is a sentences where i trying to send the wa_dynamic to the <dyn_wa>.
    here is where the error appear.
    if you have any tips for this problem i will appreciate.
    thanks a lot
    Definition of FS
    FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE, <dyn_wa>.
    PERFORM
    Create dynamic internal table and Assign it to Field Symbol
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fldcat
        IMPORTING
          ep_table        = it_dynamic.
      ASSIGN it_dynamic->* TO <dyn_table>.
    Create dynamic work area and assign to FS
    CREATE DATA wa_dynamic LIKE LINE OF <dyn_table>.
    ASSIGN wa_dynamic->* TO <dyn_wa>. "HERE IS THE PROBLEM

    How is wa_dynamic defined?
    data: wa_dynamic type ref to data.
    Regards,
    Rich Heilman

  • Generate dynamic variables

    I'm kinda new to JSP, and have the following question:
    is it possible to generate dynamic variables in JSP? I searched the WWW, and it seems nobody ever used it. Or I just searched wrong :)
    So:
    String result = "";
    for(int i = 1; i <= 10; i++){
    result = "test" + i;
    // do something with result here
    I would like that the string "result" becomes a variable: test1, test2, test3, ...
    I know it is possible in PHP like this:
    for($i=1; $i<=$10; $i++){
    $result = ${"test".$i};
    // here I can do something with the generated variables $test1, $test2, $test3, ...
    Does anyone got a solution for this problem? Cause it's driving me crazy ;)

    I tried, but I keep getting error's... Anything wrong?
    import java.awt.event.*;
    import java.awt.*;
    import java.util.*;
    import java.util.Map;
    public class AwtCalculatorFrame extends Frame{
         private Button[] btnCalc;
         private Panel pnlLabel;
         private String[][] btnArrRow;
         private Label lblRes;
         private Panel[] pnlBtnRow;
        public AwtCalculatorFrame(String titel) {
            super(titel);
            MaakLayout();
            ToonFrame();
        private void ToonFrame() {
            setSize(250, 250);
            Dimension d = getToolkit().getScreenSize();
            setLocation((d.width - getSize().width) / 2, (d.height - getSize().height) / 2);
            addWindowListener(new AwtCalculatorListeners());
            setVisible(true);
        private void MaakLayout(){
            setBackground(new Color(224, 224, 224));
            setLayout(new GridLayout(6, 1, 5, 5));
            pnlLabel = new Panel(new GridLayout(1, 1, 5, 5));
            String[][] btnArrRow = new String[5][5];
            btnArrRow[0][0] = "Sin";
            btnArrRow[0][1] = "Cos";
            btnArrRow[0][2] = "Tan";
            btnArrRow[0][3] = "C";
            btnArrRow[0][4] = "CA";
            btnArrRow[1][0] = "7";
            btnArrRow[1][1] = "8";
            btnArrRow[1][2] = "9";
            btnArrRow[1][3] = "Sqrt";
            btnArrRow[1][4] = "Pow";
            btnArrRow[2][0] = "4";
            btnArrRow[2][1] = "5";
            btnArrRow[2][2] = "6";
            btnArrRow[2][3] = "x";
            btnArrRow[2][4] = "/";
            btnArrRow[3][0] = "1";
            btnArrRow[3][1] = "2";
            btnArrRow[3][2] = "3";
            btnArrRow[3][3] = "+";
            btnArrRow[3][4] = "-";
            btnArrRow[4][0] = "+/-";
            btnArrRow[4][1] = "0";
            btnArrRow[4][2] = ".";
            btnArrRow[4][3] = "Pi";
            btnArrRow[4][4] = "=";
            Label lblRes = new Label("0.");
            add(pnlLabel);
            Button[] btnCalc = new Button[btnArrRow.length];
            for(int c = 0; c < btnArrRow.length; c++){
                pnlBtnRow[c] = new Panel(new GridLayout(1, 5, 5, 5));
                for(int i = 0; i < btnArrRow.length; i++){
                    btnCalc[i] = new Button(btnArrRow[c]);
    pnlBtnRow[c].add(btnCalc[i]);
    add(pnlBtnRow[i]);

  • Binding dynamic variable in XQuery doesn't work: ORA-00932

    I have a table with several columns. One of those columns is a XMLType.
    My goal is to have a query which selects rows from the table of which the XML column matches certain criteria.
    I'm trying following example (JDBC) : http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb_xquery.htm#insertedID11
    First, I created my own query, which looks like:
    select * from MyTable t, XMLTABLE( xmlnamespaces (DEFAULT 'http://test), 'for $i in /RootElement where $i/SubElement[contains(Element, "someValue")] return "true"' passing t.xmlColumn)This works as expected. Next, as done in the example, I'm trying to replace the "someValue" with a dynamic variable.
    Query then looks like:
    select * from MyTable t, XMLTABLE( xmlnamespaces (DEFAULT 'http://test), 'for $i in /RootElement where $i/SubElement[contains(Element, $val)] return "true"' passing t.xmlColumn, :1 as "val")This does not seem to work, neither in SQLDeveloper nor in java.
    I always get the :
    java.sql.SQLException: ORA-00932: inconsistent datatypes: expected - got CHAR(SQLDeveloper just gives ORA-00932)
    When I put $val between quotes (so "$val") then I get no error, but then I get no results either.
    I think it will not replace $val in that case but just use it as a literal, so thats not what I want
    I also tried to remove "contains" xpath and use the exact same example as on the oracle page
    select * from MyTable t, XMLTABLE( xmlnamespaces (DEFAULT 'http://test), 'for $i in /RootElement where $i/SubElement/Key = $val return "true"' passing t.xmlColumn, :1 as "val")But this doens't help either.
    I'm clueless about this, so any help would be appreciated
    Edited by: user5893566 on Nov 29, 2008 6:24 AM

    Ok, I tested it using the latest enterprise edition (11g) and there it works as expected.
    However, on 10.2.0.1.0 and 10.2.0.3.0 it gives this error.
    Is this a bug which has been fixed or should I do something special on 10g ?
    I installed all of these as normal without any special settings, created the tables and ran the query...

  • How do I use a dynamic variable from a prolog script?

    I have my test broken in to three scripts, a login, an update, and a logout. There is a dynamic variable, SERVICE_VIRTUAL_CLIENT, from the login script that I need to use in the update script, but I can't figure out how to do it. Any help would be appreciated.
    Edit: I forgot to mention that the login script is only run in the prolog portion of the UDP.
    Scott
    Message was edited by: scottmorgan

    Scott,
    You would do this the same way you would in a stand-alone script. Create the variable pattern in the login in script and name the variable. Save the login script and open the other script and select the parameter where you need the value. Set the parameter value to {{variableNameFromLogin}} (Variables are transferred from one script to the next in a UDP).
    I hope this makes sense

  • Dynamic variable Time for Select

    Hi,
    I try to develop some scripts but always I have the same problem , when I try to put in a Select instruction the variable Time, it doesn´t work correctly (for example):
    *SELECT(%example%,"ID","TIME","[ID]='%TIME_SET%' ")
    It doesn´t read correctly the variable Time_Set.
    Have you got any idea to try to do selects using dynamic variable?
    Thanks for all.

    Hi,
    Dynamic variables like %TIME_SET% do not interact very well with the compiled default logic (LGX files) when it is run after a data send. If you look at the Default.LGX file, you will notice that your *SELECT statement does not appear there because that *SELECT statement has already been compiled. That is why the logic works when it is run via the debugger (because the LGF file is getting executed at run time) and it does not work when it is run via a data send (because the LGX is being executed).
    What you will need to do is:
    1. Create a another logic file (for example: Calculation1.LGF) and copy the text from the Default.LGF to this new logic file.
    2.  Place the following text in the Default.LGF file:
    *RUNLOGIC
    *LOGIC=Calculation1.LGF
    *ENDRUNLOGIC
    3. Validate and save the Default.LGF file
    Now try running the logic after a data send and see if that works.
    Good luck,
    John

  • IMPORT statement with dynamic variable

    Friends, Need Help!!!!!!!
    Im trying IMPORT variable contents from a cluster table VARI. I can do a IMPORT without issues when I use exact name of the variable but I have issues with dynamic variable selection. Pls see code below.
    loop at objects.
       assign objects-name to <fs>.
       IMPORT <fs> to tmp_var from database vari(va) id st_key.
    endloop.
    I do not get any value to tmp_var.  Need help!
    thanks
    Bhaskar

    Try this.
    loop at objects.
    IMPORT (objects-name) to tmp_var from database vari(va) id st_key.
    endloop.
    Does it work?
    Regards,
    RIch Heilman

  • Order by dynamic variable

    Hello,
    I am trying to sort my query based on a dynamic variable p_sorton in the cursor as follows:
    function getMarketView2(
    p_event_id in ex_event.event_id%type,
    p_fromrow in integer,
    p_torow in integer,
    p_appTZ in char,
    p_calcTZ in char,
    p_sorton in varchar2) return varchar2 as
    type t_ticket_trade is ref cursor return ex_ticket_trade%rowtype;
    v_return varchar2(32767);
    v_return_integer integer;
    v_String varchar2(32767);
    v_ex_ticket_trade_obj ex_ticket_trade_obj;
    v_rowcount integer:=0;
    v_rowtotal integer:=0;
    v_done boolean:=false;
    v_sysdate date:=NEW_TIME(SYSDATE,trim(p_appTZ),trim(p_calcTZ));
    cursor cur_ticket_trade_event_open (p_event_id in ex_event.event_id%type, v_sysdate in date) is
    select "TICKET_TRADE_ID","SELLER_ACCESS_ID","CREATE_DATETIME","MODIFY_DATETIME","LASTMODIFY_BY",
    "BUYER_ACCESS_ID","OPEN_TRADE_DATE","CLOSE_TRADE_DATE","TICKET_SUITE_CODE","TICKET_DATETIME",
    "TICKET_TIMEZONE","TICKET_EVENT_ID","TICKET_TYPE","TICKET_SEAT_TYPE","TICKET_OPPONENT",
    "TICKET_TOTAL_SEAT","TICKET_PRICE","TICKET_PRICE_EXT","START_BID_DATE","OPEN_BID_PRICE",
    "CURRENT_BID_COUNT","CURRENT_HIGH_BID","CURRENT_LAST_BID_DATETIME","CURRENT_BID_INCREMENT_BY","TICKET_TRANSACTION_DATE",
    "TICKET_TRADE_STATUS" from ex_ticket_trade
    where ex_ticket_trade.TICKET_EVENT_ID = p_event_id
    and (ex_ticket_trade.ticket_datetime > v_sysdate)
    and (ex_ticket_trade.ticket_trade_status in ('F','A','AB'))
    and (ex_ticket_trade.ticket_suite_code='N' OR ex_ticket_trade.ticket_suite_code='Y')
    order by p_sorton desc;
    --ex_ticket_trade.ticket_datetime desc;
    ........then comes the rest of the code........
    This code compiles fine but does not use the value passed in the param p_sorton in the order by clause.
    the same code works fine when hardcoded to "ex_ticket_trade.ticket_datetime"
    No idea where I may be going wrong?
    Also can I do anything like ORDER BY v1 v2
    where v1 specifies columns to sort on and v2 asc/desc, coz that's what I really need to do?
    Pls help ...
    Thanks,
    Karuna

    Hi,
    Thanks for the reply ... I tried the same but due to my basic knowledge of pl-sql, I'm running into some other problem.
    ================================================
    CREATE OR REPLACE FUNCTION testMarketView(p_event_id in ex_event.event_id%type,
    p_fromrow in integer,p_torow in integer,
    p_appTZ in char, p_calcTZ in char, p_sorton in varchar2
                   ) return varchar2 as
    type t_ticket_trade is ref cursor return ex_ticket_trade%rowtype;
         v_return varchar2(32767);
         v_return_integer integer;
         v_String varchar2(32767);
         v_ex_ticket_trade_obj ex_ticket_trade_obj;
         v_rowcount integer:=0;
         v_rowtotal integer:=0;
         v_done boolean:=false;
         v_sysdate date:=NEW_TIME(SYSDATE,trim(p_appTZ),trim(p_calcTZ));
         TYPE t_ticket_trade_event IS REF CURSOR;
         cur_ticket_trade_event t_ticket_trade_event;
         v_dynQuery VARCHAR2(1000);
         cursor cur_event_seat_section_row (p_ticket_trade in ex_event_seat_inv.ticket_trade_id%type) is
         select distinct event_seat_section, event_seat_row
         from ex_event_seat_inv
         where ticket_trade_id = p_ticket_trade;
         type t_event_seat_section_row is ref cursor return cur_event_seat_section_row%rowtype;
    /*v_section varchar2(32767);
         v_section_row varchar2(32767);
         the 26 variables that belong to table ex_ticket_trade-----------
         v_ticket_transaction_date date;
         v_ticket_trade_status varchar2(10);*/
    begin
    v_dynQuery := 'select
    "TICKET_TRADE_ID","SELLER_ACCESS_ID","CREATE_DATETIME","MODIFY_DATETIME","LASTMODIFY_BY",
    "BUYER_ACCESS_ID","OPEN_TRADE_DATE","CLOSE_TRADE_DATE","TICKET_SUITE_CODE","TICKET_DATETIME",
    "TICKET_TIMEZONE","TICKET_EVENT_ID","TICKET_TYPE","TICKET_SEAT_TYPE","TICKET_OPPONENT",
    "TICKET_TOTAL_SEAT","TICKET_PRICE","TICKET_PRICE_EXT","START_BID_DATE",
    "OPEN_BID_PRICE","CURRENT_BID_COUNT","CURRENT_HIGH_BID",
    "CURRENT_LAST_BID_DATETIME","CURRENT_BID_INCREMENT_BY",
    "TICKET_TRANSACTION_DATE","TICKET_TRADE_STATUS"
    from ex_ticket_trade where
    ex_ticket_trade.TICKET_EVENT_ID = ' || p_event_id || ' and (ex_ticket_trade.ticket_datetime > '|| v_sysdate||')
    and (ex_ticket_trade.ticket_trade_status in ('||'''F'''||','||'''A'''||','||'''AB'''||'))
    and (ex_ticket_trade.ticket_suite_code='||'''N'''||' OR ex_ticket_trade.ticket_suite_code='||'''Y'''||')
    order by '|| p_sorton ||'desc ' ;
    select count(*) into v_rowtotal
    from ex_ticket_trade
    where
    ex_ticket_trade.TICKET_EVENT_ID = p_event_id
    and (ex_ticket_trade.ticket_datetime > v_sysdate)
    and (ex_ticket_trade.ticket_trade_status in ('F','A','AB'))
    and (ex_ticket_trade.ticket_suite_code='N' OR ex_ticket_trade.ticket_suite_code='Y')
    order by ex_ticket_trade.ticket_datetime asc;
    v_ex_ticket_trade_obj:=ex_ticket_trade_tabobj.initialize;
    v_rowcount:=1;
    OPEN cur_ticket_trade_event FOR v_dynQuery;
         LOOP
         FETCH cur_ticket_trade_event INTO t_ticket_trade;
    /*     -- THIS IS WHAT I HAVE TO DEAL WITH IF I CAN"T
         --PUT THE RESULTS OF THE CURSOR in t_ticket_trade
         v_ticket_trade_id , v_seller_access_id , v_create_datetime, v_modify_datetime , v_lastmodify_by ,
         v_buyer_access_id, v_open_trade_date, v_close_trade_date, v_ticket_suite_code, v_ticket_datetime,
         v_ticket_timezone, v_ticket_event_id , v_ticket_type, v_ticket_seat_type,     v_ticket_opponent,
         v_ticket_total_seat, v_ticket_price ,     v_ticket_price_ext , v_start_bid_date, v_open_bid_price ,
         v_current_bid_count , v_current_high_bid , v_current_last_bid_datetime , v_current_bid_increment_by ,
         v_ticket_transaction_date , v_ticket_trade_status ;
    if (t_ticket_trade.TICKET_SEAT_TYPE is null) then
    for t_event_seat_section_row in cur_event_seat_section_row(t_ticket_trade.ticket_trade_id) loop
    if (t_event_seat_section_row.event_seat_section is not null) then
    v_section := t_event_seat_section_row.event_seat_section;
    BEGIN
    select alt_txt into v_parking_desc from ex_alt_txt
    where event_id = p_event_id
    and alt_txt_type = 'PARKING_DESC'
    and original_txt = v_section;
    t_ticket_trade.TICKET_SEAT_TYPE := v_parking_desc;
    EXCEPTION
    WHEN no_data_found THEN
    v_section_row := 'Sec. ' || v_section;
    if (t_event_seat_section_row.event_seat_row is not null) then
    v_section_row := v_section_row || ', Row ' || t_event_seat_section_row.event_seat_row;
    end if;
    v_section_row := substr(v_section_row, 1, 30);
    t_ticket_trade.TICKET_SEAT_TYPE := v_section_row;
    END;
    exit;
    end if;
    end loop;
    end if;
    if ((v_rowcount >= p_fromrow) and (v_rowcount <= p_torow)) then
    -- p_ex_ticket_trade => t_ticket_trade
         -- THIS IS WHAT I CAN'T DO in the next line IF I get the results of the cursor in seperate variables
         v_ex_ticket_trade_obj:=ex_ticket_trade_tabobj.maprowtoobj(p_ex_ticket_trade => t_ticket_trade);
    v_string:=v_string||v_ex_ticket_trade_obj.todatastring;
    end if;
    if (v_rowcount>=p_torow) then
    exit;
    end if;
    v_section := null;
    v_section_row := null;
    v_parking_desc := null;
    v_rowcount:=v_rowcount+1;
    end loop;
    v_prefix:='1' || v_delimiter || v_rowtotal || v_terminator;
    v_return:= v_prefix || v_ex_ticket_trade_obj.tometadata||v_string;
    return v_return;
    end;
    ===========================================
    I keep running into one error:
    PLS-00403: expression 'T_TICKET_TRADE' cannot be used as an INTO-target of a SELECT/FETCH statement
    How can I get each row of the cursor either as an object or as 'T_TICKET_TRADE' ?
    Thanks,
    Karuna

  • Dynamic Variable In a Type Definition

    Can someone tell me how to define and use a dynamic variable, which resides in a Type Definition.  I.E...
    Type: beg of type1,
            field 1 type c,
            field 2 <---this dynamic
            field 3 type c.
          end of type1.
    Can this be done in Netweaver 2004.  And if so, can you show me how?
    Thanks for your time.
    Kind Regards,
    Jason

    Don't think it is available now, but I do believe they are working on this for a future release.
    Regards,
    Rich Heilman

  • Dynamic variable value based on a value from xml

    I have a invoice template and it is for 4 different companies in my organization. Based on the organization I need to have a different value for a variable that adds blank lines to the end of the invoice. Is there anyway to assign a value to variable based on the value of a xml tag.
    Thanks

    I should have explained better before. I have one invoice template and we want to keep it one template for all companies. Each invoice is run individually, each companies footer is different, I am calling multiple headers and footers based on each company. Since the headers and footers are different I need to be able to add different amounts of lines and the end of each invoice depending on that company. I have accounted for the page break in my logic based on the amount lines the page is long. I just need a dynamic variable that I can assign different values on the fly.
    Thanks

Maybe you are looking for