Which is correct Syntax for IN function in SQL expressions filters?

Hi,
I want to build a report which looks at the last 4 snapshot dates.
I obtained each snapshot date using this filter
Snapshot Date."Snapshot Date" =TIMESTAMPADD( SQL_TSI_WEEK,-10, TIMESTAMPADD(SQL_TSI_DAY, ( 7 - dayofweek(current_date) + 2), current_date) ) A
now the second one would be:
Snapshot Date."Snapshot Date" =TIMESTAMPADD( SQL_TSI_WEEK,-10, TIMESTAMPADD(SQL_TSI_DAY, ( 6 - dayofweek(current_date) + 2), current_date) ) B
third one
Snapshot Date."Snapshot Date" =TIMESTAMPADD( SQL_TSI_WEEK,-10, TIMESTAMPADD(SQL_TSI_DAY, ( 5- dayofweek(current_date) + 2), current_date) ) C
4th one
Snapshot Date."Snapshot Date" =TIMESTAMPADD( SQL_TSI_WEEK,-10, TIMESTAMPADD(SQL_TSI_DAY, ( 4 - dayofweek(current_date) + 2), current_date) ) D
to simplify them let's call the filters A, B , C, D
so, my sql expression should be like something like Snapshot Date."Snapshot Date" in 'A', 'B', 'D', 'C'
I have tried to combine the below, with brackets and comma separated, without brackets, with single quotes and without, but I always get a syntax error.
Snapshot Date."Snapshot Date" in TIMESTAMPADD( SQL_TSI_WEEK,-10, TIMESTAMPADD(SQL_TSI_DAY, ( 7 - dayofweek(current_date) + 2), current_date) ) ,
TIMESTAMPADD( SQL_TSI_WEEK,-10, TIMESTAMPADD(SQL_TSI_DAY, ( 6 - dayofweek(current_date) + 2), current_date) ) ,
TIMESTAMPADD( SQL_TSI_WEEK,-10, TIMESTAMPADD(SQL_TSI_DAY, ( 5 - dayofweek(current_date) + 2), current_date) ) ,
TIMESTAMPADD( SQL_TSI_WEEK,-10, TIMESTAMPADD(SQL_TSI_DAY, ( 4 - dayofweek(current_date) + 2), current_date) )
It doesn't seem to like the IN function either.
Any idea?
Regards
G.
Edited by: user6185307 on Oct 27, 2009 8:07 AM

Take each of these filters and union them in your answers report.
This way, you filter down to exactly the last 4 days.

Similar Messages

  • Can't figure out the correct syntax for this select statement

    Hello,
    The following statement works great and gives the desired results:
    prompt
    prompt Using WITH t
    prompt
    with t as
       select a.proj_id,
              a.proj_start,
              a.proj_end,
              case when (
                         select min(a.proj_start)
                           from v b
                          where (a.proj_start  = b.proj_end)
                            and (a.proj_id    != b.proj_id)
                        is not null then 0 else 1
              end as flag
         from v a
        order by a.proj_start
    select proj_id,
           proj_start,
           proj_end,
           flag,
           -- the following select statement is what I am having a hard time
           -- "duplicating" without using the WITH clause
            select sum(t2.flag)
              from t t2
             where t2.proj_end <= t.proj_end
           ) s
      from t;As an academic exercise I wanted to rewrite the above statement without using the WITH clause, I tried this (among dozens of other tries - I've hit a mental block and can't figure it out):
    prompt
    prompt without with
    prompt
    select c.proj_id,
           c.proj_start,
           c.proj_end,
           c.flag,
           -- This is what I've tried as the equivalent statement but, it is
           -- syntactically incorrect.  What's the correct syntax for what this
           -- statement is intended ?
            select sum(t2.flag)
              from c t2
             where t2.proj_end <= c.proj_end
           ) as proj_grp
      from (
            select a.proj_id,
                   a.proj_start,
                   a.proj_end,
                   case when (
                              select min(a.proj_start)
                                from v b
                               where (a.proj_start  = b.proj_end)
                                 and (a.proj_id    != b.proj_id)
                             is not null then 0 else 1
                   end as flag
              from v a
             order by a.proj_start
           ) c;Thank you for helping, much appreciated.
    John.
    PS: The DDL for the table v used by the above statements is:
    drop table v;
    create table v (
    proj_id         number,
    proj_start      date,
    proj_end        date
    insert into v values
           ( 1, to_date('01-JAN-2005', 'dd-mon-yyyy'),
                to_date('02-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 2, to_date('02-JAN-2005', 'dd-mon-yyyy'),
                to_date('03-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 3, to_date('03-JAN-2005', 'dd-mon-yyyy'),
                to_date('04-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 4, to_date('04-JAN-2005', 'dd-mon-yyyy'),
                to_date('05-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 5, to_date('06-JAN-2005', 'dd-mon-yyyy'),
                to_date('07-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 6, to_date('16-JAN-2005', 'dd-mon-yyyy'),
                to_date('17-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 7, to_date('17-JAN-2005', 'dd-mon-yyyy'),
                to_date('18-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 8, to_date('18-JAN-2005', 'dd-mon-yyyy'),
                to_date('19-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 9, to_date('19-JAN-2005', 'dd-mon-yyyy'),
                to_date('20-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (10, to_date('21-JAN-2005', 'dd-mon-yyyy'),
                to_date('22-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (11, to_date('26-JAN-2005', 'dd-mon-yyyy'),
                to_date('27-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (12, to_date('27-JAN-2005', 'dd-mon-yyyy'),
                to_date('28-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (13, to_date('28-JAN-2005', 'dd-mon-yyyy'),
                to_date('29-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (14, to_date('29-JAN-2005', 'dd-mon-yyyy'),
                to_date('30-JAN-2005', 'dd-mon-yyyy'));

    Hi, John,
    Not that you asked, but as you proabably know, analytic functions are much better at doing this kind of thing.
    You may be amazed (as I continually am) by how simple and efficient these queries can be.
    For example:
    WITH     got_grp          AS
         SELECT     proj_id, proj_start, proj_end
         ,     proj_end - SUM (proj_end - proj_start) OVER (ORDER BY  proj_start)     AS grp
         FROM     v
    SELECT       ROW_NUMBER () OVER (ORDER BY grp)     AS proj_grp
    ,       MIN (proj_start)                         AS proj_start
    ,       MAX (proj_end)               AS proj_end
    FROM       got_grp
    GROUP BY  grp
    ORDER BY  proj_start
    ;Produces the results you want:
      PROJ_GRP PROJ_START  PROJ_END
             1 01-Jan-2005 05-Jan-2005
             2 06-Jan-2005 07-Jan-2005
             3 16-Jan-2005 20-Jan-2005
             4 21-Jan-2005 22-Jan-2005
             5 26-Jan-2005 30-Jan-2005This is problem is an example of Neighbor-Defined Groups . You want to GROUP BY something that has 5 distinct values, to get the 5 rows above, but there's nothing in the table itself that tells you to which group each row belongs. The groups are not defined by any column in hte table, but by relationships between rows. In this case, a row is in the same group as its neighbor (the row immediatly before or after it when sorted by proj_start or proj_end) if proj_end of the earlier row is the same as proj_start of the later row. That is, there is nothing about 03-Jan-2005 that says the row with proj_id=2 is in the first group, or even that it is in the same group with its neighbor, the row with proj_id=3. Only the relation between those rows, the fact that the earlier row has end_date=03-Jan-2005 and the later row has start_date=03-Jan-2003, that says these neighbors belong to the same group.
    You're figuring out when a new group starts, and then counting how many groups have already started to see to which group each row belongs. That's a prefectly natural procedural way of approaching the problem. But SQL is not a procedural language, and sometimes another approach is much more efficient. In this case, as in many others, a Constant Difference defines the groups. The difference between proj_end (or proj_start, it doesn't matter in this case) and the total duratiojn of the rows up to that date determines a group. The actual value of that difference means nothing to you or anybody else, so I used ROW_NUMBER in the query above to map those distinct values into consecutive integers 1, 2, 3, ... which are a much simpler way to identify the groups.
    Note that the query above only requires one pass through the table, and only requires one sub-query. It does not need a WITH clause; you could easily make got_grp an in-line view.
    If you used analytic functions (LEAD or LAG) to compute flag, and then to compute proj_grp (COUNT or SUM), you would need two sub-queries, one for each analytic function, but you would still only need one pass through the table. Also, those sub-queries could be in-line views; yiou would not need to use a WITH clause.

  • The correct syntax for a recursive chmod command in Terminal

    I need to set recursive permissions on an external HDD to '777' or 'all read&write'.
    I have tried all of the following commands in Terminal:
    sudo chmod 777 -r /Volumes/...
    sudo chmod -r 777 /Volumes/...
    sudo chmod a+rw -r /Volumes/...
    sudo chmod -r a+rw /Volumes/...
    ...all of which being back a 'no such file or directory' error, e.g.
    sudo chmod 777 -r /Volumes/232Gb
    chmod: -r: No such file or directory
    Can anyone confirm the correct syntax for this command?
    Thanks in advance...
    Message was edited by: ChippyDeluxe

    If there were a solution that didn't involve using Terminal, I would prefer that.
    The reason I ask is, since my old iMac died and I connected my iMac's external HDD to my MacBook, thousands of folders on my external HDD have 'stop signs' on them and require me to go to
    Get Info -> Sharing & Permissions
    ...and add my MacBook username and set the privilege as "read and write". A bigger problem is, no backup software I've tried will back up this external HDD onto another external HDD any more, so I no longer have an up-to-date backup, which is very worrying.
    I am looking for a way of fixing this, and the chmod command appears to be the answer.
    Ideally, I don't want any permission restrictions on my external HDD at all, so I can connect it to any machine without problems.

  • Syntax for Evaluate function in OBIEE

    Hi
    I have browsed through the docs but couldn't find syntax for Evaluate function. Could someone pass me the full syntax and if possible a helpful example against essbase.
    Thanks

    Hi
    definitely
    syntax:- EVAULATE('your db function(%1,%2)', parameter list)
    here %1 and %2 are the no.of parameters (columns or may constant values) to be passed for the db-function
    if you have 3 parameters then you need to use %3 also.. means the columns to be passed.
    following exapmples are for ORACLE db,
    ex1: EVALUATE('upper(%1)', 'kishore kumar') gives the result as -> KISHORE KUMAR
    ex2: EVALUATE('upper(%1)', 'Markets.Region') here Markets.Region is column.
    you also can call the user-defined functions through evaulate
    EVALUATE('functioname(%1,%2), column1, column2)
    the above function has 2 parameters to be inputted
    Thanks & Regards
    Kishore Guggilla
    Edited by: Kishore Guggilla on Jan 16, 2009 11:00 PM

  • Syntax for existing function-based index

    Hi:
    I am on 10.2.0.3.
    Listed below is the list of indexes and index columns on one of the tables. Aparantly one of the columns (SYS_NC00220$ ) is in reality a function-based index.
    Anybody knows how to get SQL syntax for this index? TIA.
    INDEX_NAME UNIQUENES COLUMN_NAME COLUMN_POSITION
    PS0BI_HDR NONUNIQUE BILL_TO_CUST_ID 1
    PS0BI_HDR NONUNIQUE BUSINESS_UNIT 2
    PS0BI_HDR NONUNIQUE SYS_NC00220$ 3
    PS1BI_HDR NONUNIQUE BILL_STATUS 1
    PS1BI_HDR NONUNIQUE BUSINESS_UNIT 2
    PS1BI_HDR NONUNIQUE SYS_NC00220$ 3
    PS2BI_HDR NONUNIQUE CONTRACT_NUM 1
    PS2BI_HDR NONUNIQUE BUSINESS_UNIT 2
    PS2BI_HDR NONUNIQUE SYS_NC00220$ 3
    PSABI_HDR NONUNIQUE INVOICE 1
    PSABI_HDR NONUNIQUE BILL_TO_CUST_ID 2
    PSABI_HDR NONUNIQUE BUSINESS_UNIT 3
    PSABI_HDR NONUNIQUE BILL_STATUS 4
    PSBBI_HDR UNIQUE PROCESS_INSTANCE 1
    PSBBI_HDR UNIQUE BUSINESS_UNIT 2
    PSBBI_HDR UNIQUE INVOICE 3
    PS_BI_HDR UNIQUE BUSINESS_UNIT 1
    PS_BI_HDR UNIQUE SYS_NC00220$ 2

    query user_ind_expressions and look for COLUMN_EXPRESSION.
    this will give you expression.

  • Syntax for EVALUATE function - placing condition in it

    Hello All,
    I have a formula in discoverer like this
    SUM(col1)
    OVER(PARTITION BY col2, col3, col4
    ORDER BY col5 ASC
    RANGE BETWEEN col6-3 AND col6
    I need to implement the same in BI,
    I have used this to implement the SUM part
    EVALUATE( 'SUM(%1) OVER ( PARTITION BY %2,%3,%4) ORDER BY %5)' as double,
    col1,
    col2,
    col3,
    col4)
    But, couldn't get the syntax for 'RANGE BETWEEN' clause..
    i have tried like this
    EVALUATE( 'SUM(%1) OVER ( PARTITION BY %2,%3,%4) ORDER BY %5 RANGE BETWEEN %7 AND %6 )' as double,
    col1,
    col2,
    col3,
    col4,
    col5,
    col6,
    col7)
    Its throwing an error 'ORA-00905: missing keyword at OCI call OCIStmtExecute.'
    can anyone please suggest me some ideas to resolve this.
    Thanks in advance,
    Raghu

    Hi Goran,
    Thanks for the reply, it was of great help..
    Can you once check this please
    EVALUATE( 'SUM(%1) OVER ( PARTITION BY %2,%3,%4,%5
    ORDER BY %6 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW )' AS DOUBLE,
    "Global Distributor Sales (by Period)"."Net Sales",
    Specialist."Specialist Group Name", Specialist."Specialist Manager Name",
    Specialist."Specialist Name", "End Sold-To Customer"."Sold-To Customer
    Account Name", "Process Fiscal Period Calendar"."Fiscal Period")
    This is giving the running sum of values with in the partition window..
    but, can you suggest, how to modify the query, so as to get the values of 'Sales' between
    2 fiscal periods back and the current fiscal period..
    in the discoverer it is used like this,
    SUM(Net Sales SUM)
    OVER(PARTITION BY Specialist Group Name,Specialist Manager Name,Specialist Name,"Sold-To Customer Account Name",GPH Segment2
    ORDER BY "Fiscal Period (7)" ASC
    RANGE BETWEEN NUMTOYMINTERVAL("Fiscal Period Of Year"-1,'MONTH') PRECEDING AND CURRENT ROW )
    which gives the values between 2 periods back and current period
    Thank you,
    Raghu

  • Cannot find correct syntax for paint()

    Hi everyone,
    I am supposed to create an applet that has a textfield component and a button comp. the user is prompted to type in a drawing command press the "go" button and the program executes. here is an exampls of what the text should read like..FD 50, turn SW, BK 50, colour red.
    The FD is forward draw and the BK is backward. my problem is I am not using the correct syntax conventions when creating xnew and ynew coordinates. this might not be the best algorithm either, but with limited examples and resources it was the best I could come up with, any other suggestions would be much appreciated.
    Here is the problem code.
    public void init()
                   extraPanel.setBackground (Color.blue);
                   extraPanel.setLayout(new FlowLayout());//resizable panel
                   extraPanel.setBackground(Color.red);
                   extraPanel.add(button); button.addActionListener(this);
                   extraPanel.add(Mylabel);
                   Mylabel.setBackground(Color.white);
                   extraPanel.add(tf);
                   tf.setBackground(Color.green);
                   add(extraPanel);
                    //create a method to use the cursor to draw
                    public void paint(Graphics page)
                       //declare the coordinates and variables
                       int x;
                       int y;
                       int xcurrent;
                       int ycurrent;
                       int xnew;
                       int ynew;
                       String turn;
                       boolean FD;
                       String sData = new String();
                       //create an array object of commands
                       //create a bufferedReader to read in data
                       BufferedReader stdin = new BufferedReader(new
                                              InputStreamReader(System.in));
                       //create an object of commands[]and set its size
                       comm = new Commands[20];                      
                       //create a String Tokenizer to read the data in from the tf
                       StringTokenizer tok = new StringTokenizer(sData, ",");
                       //read the data in
                       for(int i = 0; i < comm.length; i++)
                          sData = stdin.readLine();
                          comm[i] = new Commands(tok.nextToken(),Integer.parseInt(tok.nextToken()),
                                    tok.nextToken(),Integer.parseInt(tok.nextToken()));
                          //use x and y coordinates to draw the image
                          xnew =  new (Commands(turn.x)* FD * dist + xcurrent + colour);
                          ynew =  new (Commands(turn.y)* FD * dist + ycurrent + colour);
                          repaint(xnew + ynew);
                          //set the focus on the new lines
                          xcurrent = xnew;
                          ycurrent = ynew;
    }//end of logo class                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Maybe I'm being dense but I don't see a question in here anywhere. Unless it the xnew ynew thing. You can't use new to create an int, an Integer object yes, but not int so get rid of the "new"s. Next look at the methods in http://java.sun.com/products/jdk/1.2/docs/api/java/awt/Graphics.html
    And get rid of all of that BufferedReader stuff.
    you applet should have something like:
    TextField commands = new TextField("",20);
    Button btn = new Button("Draw It");
    String cmds = null;
    // add the button and text field to the applet
    // add an action listener for the button
    // in the ActionPerformed method do somthing like
    cmds = commands.getText();
    repaint();
    // in the paint method parse the cmds string and do the drawing via the Graphics class's methods
    That you give a good idea of where to go now.

  • Function in SQL expression

    can we use function which has exception hadler defined in it in a SQL expression?

    That's not too hard to try for yourself, is it?
    SQL> create function a return number
      2  as
      3  begin
      4    return 1/0;
      5  exception
      6  when zero_divide then
      7    return 2;
      8  end;
      9  /
    Functie is aangemaakt.
    SQL> select a from dual
      2  /
                                         A
                                         2
    1 rij is geselecteerd.Regards,
    Rob.

  • Regarding Restrictions on calling functions from sql expressions

    Hi all,
    While going through the functions of oracle 9i plsql documentation i came across restrictions on calling a function, i that i did not understand the following statement. can anyone explain me with an example. Please.........
    Functions called from SQL statements cannot contain statements that end the transactions.
    Regards,
    Sri Ram.

    Some where from google
    http://www.ucertify.com/article/what-are-the-restrictions-on-a-user-defined-function-that-is-called-from-a-sql-expression.html
    >
    •The function cannot contain statements that end the transaction. For example, the function cannot contain transaction control statements (such as COMMIT), session control statements (such as SET ROLE), or system control statements (such as ALTER SYSTEM). Also, it cannot contain DDL statements (such as CREATE) because they are followed by an automatic COMMIT.

  • Proper syntax for email function including a repeat region

    Hey Guys, a fellow ADDT developer and myself ran into a odd challenge recently and was wondering if someone knew a shorter answer.
    LET ME BE CLEAR..I’m not looking for a suggestion, we have resolved the problem..we ARE LOOKING FOR PROPER or shortest FORMAT.
    (we used a submit redirect to a php page that used the “Send Page Section”  and then redirected back..the email looks great)
    This may be a mood point since ADDT is going away but, until then, we feel this will be an useful post because quite often you may have multiple products to email from your SQL statement.
    With that said. We used the send email function on submit.
    1.       Our email content was a HTML content file. Since it was not a php file our repeat region obviously did not work.
    2.       We substituted the HTML file for PHP (just for giggles)..no joy
    3.       We tried regular content as a string..no joy
    We know how to get single rows with the  {table.column} format…but we need to list all undetermined number of products/rows.
    So how would the string or function re-write look  if you needed a repeat region.
    EX:
    emailContent (“ this” . ‘does’. “work”);  regular string
    emailContent (“ this” . $var   . “work”);  regular string
    emailContent (“ this” .   do{  $row; } while( xxx = xxx)  . “work”);  DOES NOT WORK
    emailContent (“ this” .   while( xxx = xxx)  {  $row; }   . “work”);     DOES NOT WORK
    I assume the conflict is you can’t have a function like DO or While in the string….but I also can’t use a php include file.
    There must be a shorter, cleaner syntax that won’t require an advanced set of arrays or for each???
    so  how would a nice clean example of  repeat region results  inside email content, or include file for email contnent, look?
    Thanks

    David, in theory I agree with you, but to a large degree I am completely changing the logic of my human interface. My existing code pre-processes the raw data and saves the results to disk for any future usage. 
    It can then rapidly rebuild all pages for the entire Intranet site when your personal view of the data is changed. 
    After the full creation of all pages, the fixed pages can be viewed using your browser. 
    When you want to change your view, you run the code which completely rebuilds every Intranet page.
    My new software will approach the data differently.  My raw data will be stored with no pre-processing. The pre-processing will occur as the user changes dates and the pages will be built individually on demand, one at a time.
    The second phase of my Windows Form app will be to create pop-up windows that allow the users to modify the definitions for their custom views of the market. 
    When a view is changed, the software will be able to pre-process, as needed, the current date’s data and rebuild the current page with any new changes.
    I intend to create a Refresh.cpp file.  The various segments of the Form’s code will set variable such as date change, view changed, watch list changed, etc. and then call Refresh(). 
    The refresh code will then be able to do the minimum recalculation necessary to rebuild the proper HTML stream. 
    This is another reason to break up the code into various cpp segments such as: LoadRawData, RecalculateViews, BuildPage, etc.
    PS: David, I tried to send you a personal e-mail using your home page link. 
    Hope that was OK and not against forum rules!

  • What is the correct syntax for using a variable in an ad hoc query?

    Hi all
    I am an occasional DB user and at the moment need to update about 1000+ records so that a certain column gets a unique value.
    So I thought that I would use a variable for this.
    I then built this kind of SQL statement for just a small subset of the records:
    variable recNumber number;
    exec :recNumber := 1;
    UPDATE TABLE_TO_BE_UPD
    SET COL_TO_BE_UPD = COL_TO_BE_UPD + recNumber
    WHERE COL_TO_BE_UPD IN ('VAL_A','VAL_B');
    I get the invalid SQL statement error when attempting to execute above (besides the prompt that asks for a value which I would like to omit).
    Anyway I also tried this one:
    CREATE SEQUENCE seqCounter;
    UPDATE TABLE_TO_BE_UPD
    SET COL_TO_BE_UPD = COL_TO_BE_UPD + seqCounter.NEXTVAL
    WHERE COL_TO_BE_UPD IN ('VAL_A','VAL_B');
    From this one I got the error ORA-01722: invalid number...I am guessing this comes because seqCounter is of type number and the COL_TO_BE_UPD is of type character...(?)
    So what I would like to ask is what is the correct way to define and use a counter type of variable to append a number at the end of a character string?
    Also another question that I would like to ask is that are variables that are used in ad hoc queries also called 'bind variables'?
    Thanks muchly

    If you want to append a unique number to a column then this would do it:
    UPDATE TABLE_TO_BE_UPD
    SET COL_TO_BE_UPD = COL_TO_BE_UPD ||to_char(rownum)
    WHERE COL_TO_BE_UPD IN ('VAL_A','VAL_B');

  • What is the syntax for calling function from class file by jsp

    does anyone here knows what is the syntax of how to call a function from java class file by javascript code or any way to call it?
    and where should i put the calling function code? because the function is called depend on the user click.
    for example
    <%=pc.functionName(a,b)%>
    for the variable a and b, how can i get the value from html textbox and put it in a and b...
    urgent needed...
    thx

    Jsp's are executed before the Html forms are created and loaded. Dont try to use a java code function calling on a javascript click. You'll have to explicitly redirect it into a servlet where in you can call the function you want.
    Well! another way could be using AJAX. That seems to be powerfull enough and it might also serve your purpose.
    Hope this helps

  • Date Syntax for SUMIFS Function

    Converting my accounting from Excel to Numbers. Huge data sets ...
    I have a SUMIFS function that works properly using a manually typed date but I cannot figure out how to use the Today() function.
    This works: SUMIFS(Amounts, Account, B3, Check Date, B5) where B3 is the code for the specific account and B5 contains <=12/31/2009 - note there are no quotes around the expression.
    BUT, I don't want to manually enter the date everyday. I want to use the Today() function for condition. It works if I use Today() in B5 but returns only the totals for today's transactions. I need to be able to use "less than or equal to Today" for the condition but I cannot figure out the syntax.
    If we can figure that out, then I want to use "less than or equal to Today PLUS X" where X is a variable I can enter in B7 to look at projected cash flow 7, 14 or 21 days out.
    Any help? Thanks

    Jane Knox wrote:
    Yvan!
    That worked. Thank you! When I posted the question I thought you would be the one to answer.
    Thanks for the feedback.
    I'm sure that Ashka, Badunit, Barry, Fruhulda, Jaxjason, Jerrold … are able to respond the same.
    The difference is that I was in front of my computer when they weren't
    I would NEVER be able to figure that out
    Not surprising, the syntax required to use a reference to a cell in a testr is not described in delivered resources.
    Very different from Excel...
    Happily, Numbers isn't duplicating Excel behaviour. A world with a single kind of spreadsheet would be really annoying
    Yvan KOENIG (VALLAURIS, France) samedi 26 décembre 2009 18:12:19

  • Syntax for @MDSHIFT function

    I'm attempting to create matrix type results for several accounts, displaying a rolling 12 months. An alternate hierarchy is one solution, but would like to try a calcscript using @MDSHIFT."Incomeprior" =@MDSHIFT("MTotalIncome", 1, "2002", , 0,"Income Stmt Accounts",);The error received is "The 2nd parameter of function "2002" must be a non-negative number or Lev/gen name string"Any ideas?Thank you in advance,Cbucklin

    Hi
    definitely
    syntax:- EVAULATE('your db function(%1,%2)', parameter list)
    here %1 and %2 are the no.of parameters (columns or may constant values) to be passed for the db-function
    if you have 3 parameters then you need to use %3 also.. means the columns to be passed.
    following exapmples are for ORACLE db,
    ex1: EVALUATE('upper(%1)', 'kishore kumar') gives the result as -> KISHORE KUMAR
    ex2: EVALUATE('upper(%1)', 'Markets.Region') here Markets.Region is column.
    you also can call the user-defined functions through evaulate
    EVALUATE('functioname(%1,%2), column1, column2)
    the above function has 2 parameters to be inputted
    Thanks & Regards
    Kishore Guggilla
    Edited by: Kishore Guggilla on Jan 16, 2009 11:00 PM

  • Syntax for nested function/procedure?

    Hi,
    What's the syntax to create a sub function/procedure in another function/procedure? Is this available in 9i?
    Thanks.

    Nested functions and procedures have been available since at least 7.3. However, any nested functions or procedures need to be the last things in your declare section.
    This works:
    SQL> CREATE OR REPLACE PROCEDURE test_proc is
      2     l_v VARCHAR2(100);
      3     FUNCTION nested_function RETURN VARCHAR2 IS
      4     BEGIN
      5        RETURN('nested function call') ;
      6     END;
      7  BEGIN
      8     l_v := nested_function;
      9     DBMS_OUTPUT.Put_Line(l_v);
    10  END;
    11  /
    Procedure created.But this does not:
    SQL> CREATE OR REPLACE PROCEDURE test_proc is
      2
      3     FUNCTION nested_function RETURN VARCHAR2 IS
      4     BEGIN
      5        RETURN('nested function call') ;
      6     END;
      7     l_v VARCHAR2(100);
      8  BEGIN
      9     l_v := nested_function;
    10     DBMS_OUTPUT.Put_Line(l_v);
    11  END;
    12  /
    Warning: Procedure created with compilation errors.
    SQL> show err
    Errors for PROCEDURE TEST_PROC:
    LINE/COL ERROR
    7/4      PLS-00103: Encountered the symbol "L_V" when expecting one of the
             following:
    12/0     PLS-00103: Encountered the symbol "end-of-file" when expecting
             one of the following:
             begin function package pragma procedure formTTFN
    John

Maybe you are looking for

  • Save For Web always saves as a GIF

    Hi Guys, I think I may have a bit of a bug with Photoshop CS6 on my Mac. Every time I try to save an image through Save For Web, the file will automatically save as a GIF, regardless of what option I choose from the drop down menu. I have tried a rei

  • Aperture 3.0.3 annoying warning message

    Hi I have Aperture 3.0.3 running on both Macbook Pro and first generation iMac. Up until now I have enjoyed and had no problems running Aperture which i have used since version 1.5. Referenced Nef files 30K. Upgraded to 3.0.3 and now have an annoying

  • My iphone will not come on unless plugged into the wall charger

    my iphone 4 went completely dead since then i tried chargeing it with a charger bought from sams wholesale which was an aftermarket charger which did not work i then plugged it into the factory wall charger it comes on but says searching for signle i

  • Marking green screen video to know where to place background images

    My students want to create short green screen movies using a number of background photos that will change as they talk about their topic. How can they mark their green screen video so they will know where to place each photo?  We are using iMovie 11.

  • Dump-Phenomenon No Auth Function Group HRSSC00TRACKING

    Hi guys, we have a strange phenomenon occuring and I can't come up with an explanation, please help: On our production System we went productive on EHP 4 yesterday. I got a call from basis team today that we have about 2000 Dumps DAILY in production.