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

Similar Messages

  • 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                       

  • How to import files with static variables into a block with methods?

    i have a problem. is it possible to import files with static variables into tags like
    <%!
    //here i want to import a file named settings.inc
    //whitch is used to set jdbc constants like url,driver,...
    private void method() {
    private void method2() {
    %>
    <%@include file="xy"%>//dosn�t work above
    //only in <%%>tag

    This should be done using either the Properties class or ResourceBundle. Ex.
    <%
    ResourceBundle resBun = ResourceBundle.getBundle(String resource);
    String username = resBun.getString("username");
    String password = resBun.getString("password");
    // etc
    %>

  • How to run a sql statement with bind variable in a test environment

    Hello,
    I have a sql statement in prod that I like to run in test. I got the sql statement from statspack, but the statement has bind variables. How do I get this statement to run in test? Thank you.

    Hi,
    If you have the SQL statement and all the referenced objects are available in your test env then what is the problem to run it?
    If I am not wront to get your reqmnt...
    i.e
    SQL> select * from emp
    where emp_no = &empno
    and dept_code = &deptcode;
    Thanks

  • Equation with dynamic variable

    Is it possible to use one equation with 2 or more variables and make one of these variable as an output without changing the equation?
    Take the equation below example:
    R=x/(0.28706/0.46153+x)*(101.325/P)
    As usual, by inserting the values of x and P, then value of R will be answered.
    But if only the value of R and x can be inserted, how can the value of P to be answered without altering the equation.
    The equation is being used multiple time in the same VI. One is for generating one part of a graph (Mollier Diagram) and the others are to be used to find the value at the intersection.
    I hope my question is understandable.
    Thank you in advance
    -sikat
    Solved!
    Go to Solution.

    R = (x/(a+x)*(b/P) ... thx, this really will be helping me to make this Eq more understandable
    Formula Node:
    It seem that when i entered an equation(Eq), only the left side of the Eq can only be one variable thus producing a single output.
    Case Structure(or SELECT function):
    It changes the formula to a new form for every output. Let say i want make x an output. That means i need to create a new Eq : x=(P*R/b-1)*a, which i want to avoid if posible .
    .... Does this means that a new Eq must be created/converted for each output.
    Newton Raphson zero finder vi: (base on this N-R Example)
    I have tried using this VI by making my Eq equivalent to zero and using SELECT function depending on situation. Somehow i think it will work, but the VI seem too bulky for one simple formula (with 2 variable and 1 output), which i want to avoid since many more formula will be used.
    I ll be glad to see more suggestions.

  • How execute a dynamic statement with a variable number of bind variables

    Hi all.
    I would like to execute SQL statements in a PL/SQL function.
    SQL statements must use bind variable in order to avoid parsing time. But the number of arguments depends on the context. I can have from 10 to several hundreds of arguments (these arguments are used in a 'IN' clause).
    To minimise the number of differents signature (each new signature involve a parsing), the number of argument is rounded.
    My problem is : how to set dynamicaly the bind variables ?
    Cause it is pretty simple to construct dynamicaly the SQL statement, but using an
    " OPEN .... USING var1, var2, ..., varX "
    statement, it is not possible to handle a variable nomber of bind variable.
    I am looking for the best way to do the same thing that it can be done in java/JDBC with the PreparedStatement.setObject(int parameterIndex, Object x).
    I saw the dbms_sql package and bond_variable procedure : is a the good way to do such a thing ?
    Thanks

    If the variation is only values in an IN list, I would suggest using an object type for the bind variable. This lets you have just one bind variable, regardless of how many values are in the IN list.
    The dynamic SQL ends up looking like:
    ' ... where c in (select * from table(:mylist))' using v_list;where v_list is a collection based on a SQL user-defined type that can be populated incrementally, or in one shot from a delimited list of values using a helper function.
    I use this approach all the time in dynamic searches.
    See this link for more details:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:110612348061

  • Dynamic TSQL Statement with Dynamic Parameters

    I'm trying to utilize a dynamic TSQL Statement where I can have various parameters passed of differing kinds, e.g. In some cases parameter 1 would be an int, other cases it may be a datetime, or varchar, etc.
    I'm going to keep  a table of with certain key SQL Statements, and then parameters in another column so this can be resusable.
    Here is my code:
    Case 1
    Declare @FromDate as DATE='2013-10-01'
    Declare @ToDate as DATE='2013-10-31'
    Declare @FamilyMember as nvarchar(2)='20'
    DECLARE @retval int
    DECLARE @sSQL nvarchar(500);
    DECLARE @ParmDefinition nvarchar(500);
    DECLARE @tablename nvarchar(50)
    --Select Convert(nvarchar(15), @FromDate,126)
    SELECT @sSQL = N'select count(distinct id) as AggregateCount from [Table] where familyMember = @FamilyMember
    and DateStamp between @FromDate and @ToDate';
    SET @ParmDefinition = N'@retvalOUT int OUTPUT';
    EXEC sp_executesql @sSQL, @ParmDefinition, @retvalOUT=@retval OUTPUT;
    Case 2
    Declare @FromDate as DATE='2013-10-01'
    Declare @ToDate as DATE='2013-10-31'
    Declare @Id as int=3510021
    DECLARE @retval int
    DECLARE @sSQL nvarchar(500);
    DECLARE @ParmDefinition nvarchar(500);
    DECLARE @tablename nvarchar(50)
    --Select Convert(nvarchar(15), @FromDate,126)
    SELECT @sSQL = N'select count(distinct id) as AggregateCount from [Table] where Id=@Id
    and DateStamp between @FromDate and @ToDate';
    SET @ParmDefinition = N'@retvalOUT int OUTPUT';
    EXEC sp_executesql @sSQL, @ParmDefinition, @retvalOUT=@retval OUTPUT;
    John

    The following is an example I found, but I am receiving a Message "Must declare the scalar variable @StudentNumber"
    Alter Procedure [dbo].[spInsertStudentDoc2]
    @StudentNumber integer
    AS
    Begin
    DECLARE @P_StudentNumber integer
    DECLARE @ParameterList nvarchar(max)
    DECLARE @SQLSnippit as nvarchar(max)
    SET @ParameterList = N'@P_StudentNumber integer'
    SET @SQLSnippit = N'Select Count(*) from dbo.student where patid=@StudentNumber'
    PRINT @SqlSnippit -- debug & test
    Exec SP_EXECUTESQL @SqlSnippit, @ParameterList, @P_StudentNumber=@StudentNumber
    End
    John

  • MAXL import statement with ASO

    I am attempting to write a MAXL script to import data using a load rule and want this to subtract from any existing data already stored in the database. I am using a load buffer and my syntax is as follows:
    alter database App.DB initialize load_buffer with buffer_id 1;
    import database App.DB data from data_file 'RnBF2B1.txt' using server rules_file 'Rev2B.rul' to load_buffer with buffer_id 1 on error write to 'Rev2B.err';
    import database App.DB data from load_buffer with buffer_id 1 subtract values;
    I am getting the error :
    essmsh error: Parse error near subtract
    Any ideas?

    I am using Essbase 9.3.1
    If I go to the command prompt and type line by line, I do not get an error but if I put it in a mshs file, it appears like there is an extra space before the word subtract and that's where I have the error. I have checked and there really is only one space.
    This is what my command file looks like
    MAXL> import database App.db data from load_buffer with buffer_id 1 subtract values;
    essmsh errro: Parse error near subtract
    Do you think MAXL is puttin in an extra space or something? I feel like my code is haunted by a ghost.
    Edited by: Jeanette R. on Aug 2, 2011 1:42 PM

  • Navigation list issue with dynamic variable

    Hi All,
    I'm a little bit stock with (maybe) a little issue. I'm looking for a way to put variable on a navigation list in the same page. E.X. there is where my navigation list is pointing : f?p=&APP_ID.:20:&SESSION.::&DEBUG.::P20_3,P20_1,P20_2:#État#,#Année Comptable#,#Période Comptable#: .
    I Need to inherit the value ( #État#,#Année Comptable#,#Période Comptable#:) from a sql query from the main region (list are in a subregion ).
    Could some one help me with that please ?
    Thanks in advance !!
    Eric

    Hmm.. on the last APEX SIG day in Belgium Oracle was very dark about that (as usual).
    They even were not sure what features would definitely be present in the new version.
    They did however expect it to be somewhere in october / november
    again. you can mimic by using a report-region looking like a list
    regards,
    Richard

  • C:set with dynamic variable name

    Hello,
    we have a litte market system.
    we iterate over the articles to display them on a page
    foreach article type we have to include a popup, but only once foreach article type.
    So if we have more than one article of the same type, the popup should be included only one time.
    <c:forEach var="article" items="#{MyArticleController.entities}">
        <c:if test="${requestScope[article.dtype] != true}">
            <!-- <ui:include src="/market/details/#{article.dtype}.xhtml"/>  -->          
            <c:set scope="request" var="${article.dtype}" value="1" />
        </c:if>
        <!-- <ui:include src="/market/preview/#{article.dtype}.xhtml"/>-->
    </c:forEach>I think the line with the c:set seems to be the problem.
    How can I solve this problem. How can I set a dynamic value and test against it later?
    Thanks
    Dirk

    You were close with your first example.
    However as noted, the <c:set> tag doesn't accept a dynamic expression for the "var" attribute.
    Suggested alternative: instead of using request attributes, have a seperate map
    <jsp:useBean id="articleTypeUsed" class="java.util.HashMap"/>
    <c:forEach var="article" items="#{MyArticleController.entities}">
        <c:if test="${not empty articleTypeUsed[article.dtype]}">
            <!-- <ui:include src="/market/details/#{article.dtype}.xhtml"/>  -->          
            <c:set target="${articleTypeUsed}" property="${article.dtype}" value="1" />
        </c:if>
        <!-- <ui:include src="/market/preview/#{article.dtype}.xhtml"/>-->
    </c:forEach>That should solve your issue with translating this java code into jstl.
    Whether the mix of JSTL and JSF/ui will work well together is a completely seperate issue, and one I can't really help with.

  • READ statement with dynamic key

    Can i READ a dynamic table with a dynamic key combination?
    READ TABLE <dyn_sel_table>
      INTO       <dyn_sel_wa>
      WITH KEY   ? .

    yes i guess u can do it
    READ TABLE <dyn_sel_table>
    <b>ASSIGNING</b> <dyn_sel_wa>
    WITH KEY <field1> eq ...

  • Directive.include with dynamic variable

    How would I put a variable I have called ${includeFile} into an include directive below? I tried
    <jsp:directive.include file="${includeFile} " />
    And this did not work...

    How would I put a variable I have called
    ${includeFile} into an include directive below? I
    tried
    <jsp:directive.include file="${includeFile} " />are you sure of the Syntax ?
    >
    And this did not work...We can do 2 types of include in a jsp file see the Syntax .....
    1.<jsp:include> ----Includes a static file or sends a request to a dynamic file
    <jsp:include page="{relativeURL | <%= expression %>}" flush="true" />
    or
    <jsp:include page="{relativeURL | <%= expression %>}" flush="true" >
    <jsp:param name="parameterName"
              value="{parameterValue | <%= expression %>}" />+
    </jsp:include>
    2.Include Directive
    <%@ include file="relativeURL" %> -----Includes a static file in a JSP file, parsing the file's JSP elements.
    Deside which one you want to use...
    ---Vidya

  • Import Script with Temp Variable at Bottom of Load File - No Results

    I am running into an issue while trying to load an entity's financials using a Data Pump script to assign a temporary value for the entity number, which is located at the bottom of the report.  Here is how the import file is layed out:
    Account                Description                  Final Balance                                    
    All Accounts and information....
    Entidad: 93          A: 93
    I am trying to pull the 93 into PvarTemp1.  Is there something I need to do special in the scripting since the variable I am trying to extract is at the bottom of the data?  All examples I have been able to find on the forms show the temp variable at the top of the data that the temp vaiable is being applied.  I am very new to VB and would appreicate any help.
    Here are the scripts that I am running:
    GET:
    If Mid(strRecord, 23, 8) = "Entidad:" Then
    RES.PvarTemp1 = Mid(strRecord, 32, 2)
    End If
    GetMexicoEntity = strField
    End Function
    PUT:
    PutMexicoEntity = RES.PvarTemp1
    End Function
    Thanks in advance!

                                                               Saldo Inicial     Activ Período        Balance Final
    Cuenta                 Descripción                          06/01/13                                 06/30/13       Ajuste Balance
    12012                  PTU DIFERIDO                              -489.00                  .00              -489.00
    12018                  IETU DIFERIDO                          -13,100.00                  .00           -13,100.00
    13520                  CREDITO MERCANTIL                   13,682,407.05                  .00        13,682,407.05
    20819                  OTRAS RESERVAS                         445,751.35            86,957.38           532,708.73
    21402                  PASIVO NETO PROYECTADO                   4,887.65                  .00             4,887.65
    30101                  CAPITAL SOCIAL HISTORICO                25,791.04                  .00            25,791.04
    30151                  CAPITAL SOC. ACTUALIZADO                87,406.99                  .00            87,406.99
    30201                  RVA. LEGAL HISTORICO                  -210,712.72                  .00          -210,712.72
    30301                  UTIL/(PERD) AC. HISTORIC            -2,605,881.57                  .00        -2,605,881.57
    30501                  RESUL. ACUM. HIST.                 -10,969,131.88                  .00       -10,969,131.88
    30502                  OCI                                    -22,567.00                  .00           -22,567.00
    30721                  POSICION MONETARIA                     233,964.17                  .00           233,964.17
    30801                  CXREEXP.TRASP. DEL EJERC             1,164,673.76                  .00         1,164,673.76
    77403                  OTROS                                 -445,751.35           -86,957.38          -532,708.73
                                                                 1,377,248.49                  .00         1,377,248.49
                                                         ==================== ==================== ====================
    Criterio del Reporte:                   Reporte pedido por:        iochoa
                          Entidad: 93          A: 93
                   Fecha Efectiva: 06/01/13
                                A: 06/30/13
                 Sumar Subcuentas: S
              Sumar Centros Costo: N
                           Moneda: MN
             Suprimir Montos Cero: S
      Redondeo al Millar más Cerc: No
      Redondeo a Unid más Cercana: No
                  Moneda Reportes:                               Salida: Bal93
                                                               ID Batch:

  • Create a Java Object with Dynamic Variables

    Hi ,
    I am constructing a web based system which stores personal information on people. I have created a Person class with all the obvoius variables, forename, surname, address etc.. My problem is that some clients wish to make use of some of the variables, some want other variables and as i meet others they wish to add in some new variables eg
    Client 1 wishes to store; Forename, Surname and Address
    Client 2 wishes to store Forename, AltForename, Surname, AltSurname and Address ( AltForename - this is an alternative Forename in this case the Irish translation of their English name)
    Client 3 wishes to store Forename, Surname, Title, Address, Height, Weight, DOB, School, Occcupation.
    Each of the clients above need to submit these in an online form with each form looking different due to the fields they have to enter and also with different validation rules.
    At present i have a Person object handling all fields i can think of and different validation methods depending on the client, but there must be a better way of doing this as each time a new field is added by a new or existing client, i not only have to update the java and jsp but also the DB.
    This is all web based and i wish to use the same code base and data source for all clients. I also wish it to be all web based. So in theory if a client asked to add in a "middle name" field to their form and make it mandatory, i could go to an admin page which lists all the possible input element types and select the "field type" then set validation rules on it.
    All the web based and DB parts can be ignored - the main issue here is creating a Person class which can have any number of variables of varying types ( String, Int, etc)
    Regards,
    Cormac
    Edited by: cormacodonnell on Jun 27, 2008 6:33 AM

    cormacodonnell wrote:
    Hi ,
    I am constructing a web based system which stores personal information on people. I have created a Person class with all the obvoius variables, forename, surname, address etc.. My problem is that some clients wish to make use of some of the variables, some want other variables and as i meet others they wish to add in some new variables eg
    Client 1 wishes to store; Forename, Surname and Address
    Client 2 wishes to store Forename, AltForename, Surname, AltSurname and Address ( AltForename - this is an alternative Forename in this case the Irish translation of their English name)
    Client 3 wishes to store Forename, Surname, Title, Address, Height, Weight, DOB, School, Occcupation.You could extend the Person class with 3 sub classes, but that might be overkill just to store personal info.
    Each of the clients above need to submit these in an online form with each form looking different due to the fields they have to enter and also with different validation rules.
    At present i have a Person object handling all fields i can think of and different validation methods depending on the client, That's probably how I'd do it if it's not too much trouble. But to be OO you should probably go the inheritence route.
    but there must be a better way of doing this as each time a new field is added by a new or existing client, i not only have to update the java and jsp but also the DB. Welcome to software development. It's called "feature creep" or "scope creep". As soon as you get your code working right and deploy it and get ready to go on vacation, the customer always comes back with something else they "need" or "forgot". The app I'm building right now I've rewritten or changed 7 times in 3 months because nobody has a clue what they really need.

  • Help With A Case Statement With Multiple Variables

    I apologize if this is the incorrect Forum for this type of question, but it was the closest one that I could find. I'm pretty new with SQL and am stuck on this issue. I have roughly 26 dates that I need to compare to one another. Each date is tied to a step code. I also have a Stop value that is tied directly to the "max date" of the step codes. So, I need to compare 30 dates against one another to 1st - ID the max date; 2nd - ID if the Stop value is correct; 3rd - if the stop value is incorrect, identify what the correct value would be.
    At first, this seemed like it wouldn't be that hard. I wrote a query that found the max date for each step code. Then I realized that multiple step codes could have the same date. So, I tried using this case statement, but I did not get the expected results. Is there a more efficient way of getting what I need? This code seems like it's not necessary and probably the source of my issue.
    CASE
    WHEN FS25.ACTUAL_COMPLETION_DATE > FS.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS1.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS2.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS3.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS4.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS5.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS6.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS7.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS8.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS9.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS10.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS11.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS12.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS13.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS14.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS15.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS16.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS17.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS18.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS19.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS20.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS21.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS22.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS23.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS24.ACTUAL_COMPLETION_DATE AND L.FORECLOSURE_STOP_CODE <= '8' THEN '9'
    ELSE 'UH OH'
    END AS "CHANGE FC STOP TO"
    Any assistance is appreciated!

    I think Igor pointed out a working solution before.
    Applying it at your examples (you missed the operator after STOP_CODE, I assume it =):
    CASE
    WHEN FS25 = GREATEST(FS25, FS24, FS23) AND STOP_CODE = '9' THEN '9'
    ELSE 'UH OH'
    END AS 'CHANGE STOP CODE TO'
    {code}
    Be careful at the second example. You are checking:
    {code:sql}
    FS25 > FS24 OR FS25 IS NOT NULL AND FS24 IS NULL AND FS25 > FS23
    OR
    FS25 IS NOT NULL AND FS23 IS NULL AND STOP_CODE = '9'
    {code}
    Remember that AND has higher priority among operators than OR so if FS25 is greater than FS24 and FS23 the condition will be true even if STOP_CODE is not equal 9.
    Regards.
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for