Null handling with greatest function

Hi , My oracle version is 10.2 and I am trying to get max value from three dates.
col1,                col2,               col3                                max_date
*12/4/2007 12/5/2009 7:14:57 PM*
col1 value is null . so when I use below sql
select greatest(NVL(col1,col2)) from temp_greatest where rec_id=366957734, I got value 12/4/2007
I want to get max date from col1,col2 and col3, even though col1 is null.
I have couple of rows with col2 acnd col3 as null values.
How to get the max values.. any help appreciate
Thanks

Here you go.
CREATE TABLE SSPTRIG.TEMP_GREATEST_1207
COl1_DATE DATE,
col2_DATE DATE,
col3_DATE DATE,
max_date DATE
SET DEFINE OFF;
Insert into TEMP_GREATEST_1207
(COL1_DATE,COL2_DATE,COL3_DATE)
Values
(NULL, TO_DATE('12/04/2007 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/05/2009 19:14:57', 'MM/DD/YYYY HH24:MI:SS'));
Insert into TEMP_GREATEST_1207
(COL1_DATE,COL2_DATE,COL3_DATE)
Values
(TO_DATE('12/03/2009 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, TO_DATE('12/05/2009 05:26:08', 'MM/DD/YYYY HH24:MI:SS'));
Insert into TEMP_GREATEST_1207
(COL1_DATE,COL2_DATE,COL3_DATE)
Values
(TO_DATE('12/03/2009 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, TO_DATE('12/05/2009 05:26:07', 'MM/DD/YYYY HH24:MI:SS'));
Insert into TEMP_GREATEST_1207
(COL1_DATE,COL2_DATE,COL3_DATE)
Values
(TO_DATE('12/04/2009 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, TO_DATE('12/05/2009 06:10:55', 'MM/DD/YYYY HH24:MI:SS'));
Insert into TEMP_GREATEST_1207
(COL1_DATE,COL2_DATE,COL3_DATE)
Values
(TO_DATE('08/09/2005 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/05/2009 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/05/2009 21:01:12', 'MM/DD/YYYY HH24:MI:SS'));
Insert into TEMP_GREATEST_1207
(COL1_DATE,COL2_DATE,COL3_DATE)
Values
(TO_DATE('12/04/2009 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, TO_DATE('12/05/2009 05:44:37', 'MM/DD/YYYY HH24:MI:SS'));
Insert into TEMP_GREATEST_1207
(COL1_DATE,COL2_DATE,COL3_DATE)
Values
(TO_DATE('12/04/2009 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, TO_DATE('12/05/2009 05:44:33', 'MM/DD/YYYY HH24:MI:SS'));
Insert into TEMP_GREATEST_1207
(COL1_DATE,COL2_DATE,COL3_DATE)
Values
(TO_DATE('12/04/2009 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, TO_DATE('12/05/2009 06:41:14', 'MM/DD/YYYY HH24:MI:SS'));
Insert into TEMP_GREATEST_1207
(COL1_DATE,COL2_DATE,COL3_DATE)
Values
(TO_DATE('12/04/2009 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, TO_DATE('12/05/2009 05:44:31', 'MM/DD/YYYY HH24:MI:SS'));
Insert into TEMP_GREATEST_1207
(COL1_DATE,COL2_DATE,COL3_DATE)
Values
(TO_DATE('10/08/2008 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, TO_DATE('12/05/2009 21:02:38', 'MM/DD/YYYY HH24:MI:SS'));
COMMIT;
i NEED TO POPULATE MAX DATE INTO MAX_DATE COLUMN IN TEMP_GRATEST_1207.
THANKS.

Similar Messages

  • Error while replacing IF statements with DECODE function in procedure

    Hi All,
    I have created a procedure which has nested IF statements. Now I want to replace the IF statements with DECODE functions to improve performance.
    Procedure:
    IF (var_int_sev = '0')
    THEN
    var_sev := '2';
    ELSE
    SELECT sev
    INTO var_int_sev
    FROM errorconfig
    WHERE errorcode = var_errorcode;
    var_sev := var_int_sev;
    END IF;
    I converted the above IF statement into DECODE function as mentioned below:
    var_Sev := DECODE(var_int_sev,0,2,SELECT severity FROM errorconfig WHERE errorcode=var_ErrorCode)
    But it throws below error at the select statement used inside DECODE.
    Error(58,51): PLS-00103: Encountered the symbol "SELECT" when expecting one of the following: ( - + case mod new not null others <an identifier> <a double-quoted delimited-identifier> <a bind variable> avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date <a string literal with character set specification> <a number> <a single-quoted SQL string> pipe <an alternatively-quoted string literal with character set specification> <an alternativ
    Can someone help me in converting the IF to DECODE in the above case. Also how can we use a select statement inside decode.

    instead of trying to rewrite all your code and hoping that the performance will be better, it's a better option to investigate and find out which part of your application is slow
    read this:
    When your query takes too long ...

  • How to find the number of data items in a file written with ArryToFile function?

    I have written an array of number in 2 column groups to a file using the LabWindows/CVI function ArrayToFile...Now if I want to read the file with FileToArray Function then how do I know the number of items in the file. during the write time I know how many array items to write. but suppose I want the file to read at some later time then How to find the number of items in the file,So that I can read the exact number and present it. Thanks to all
    If you are young work to Learn, not to earn.
    Solved!
    Go to Solution.

    What about:
    OpenFile ( your file );
    cnt = 0;
    while ((br = ReadLine ( ... )) != -2) {
    if (br == -1) {
    // I/O error: handle it!
    break;
    cnt++;
    CloseFile ( ... );
    There are some ways to improve performance of this code, but if you are not reading thousands of lines it's quite fast.
    After this part you can dimension the array to pass to FileToArray... unless you want to read it yourself since you already have it open!
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • JDBC MS Access--- cannot extract entry with null value with data type Meta

    I'm trying to extract a data entry with null value by using JDBC. The database is MS Access.
    The question is how to extract null entry with data type memo? The following code works when the label has data type Text, but it throws sqlException when the data type is memo.
    Any advice will be appreciated! thanks!
    Following are the table description and JDBC code:
    test table has the following attributes:
    Field name Data Type
    name Text
    label Memo
    table contents:
    name label
    me null
    you gates
    Code:
    String query = "SELECT name, label FROM test where name like 'me' ";
    ResultSet rs = stmt.executeQuery(query);
    while (rs.next())
    String name = rs.getString("name");
    rs.getString("val");
    String label = rs.getString("label");
    System.out.println("\t"+name+"\t"+label);
    catch (SQLException ex)
    System.out.println(ex.getSQLState());
    System.out.println(ex.getErrorCode());
    System.out.println("in sqlexception");
    output:
    C:\Temp\SEFormExtractor>java DBTest
    yet SELECT name, label FROM test
    null
    0
    in sqlexception

    The question is how to extract null entry with data type memo?Okay, what you need to do is this:
    if (rs.getString("val") == null)
      // do something
    }This way, when it's a null value, you can check it first, and then handle it how you want, rather than getting an exception.

  • Error thread java : problem with the function "resume 0x***"  (forum sun)

    One problem with the function of jdb occured when I tried to use it to
    pilot the processor with differents threads. In fact, I use a simple example with 2 threads.
    I stop the two threads with two breakpoint, and I want to resume one or the other (with the function "resume 0x****"), the one wich I resumed stop again on the breackpoint and I decide again to resume one or the other. All of that to obtain a tree of execution.
    I give you the code of the class and the code of jdb.
    CLASS: (it's just a object Room with a variable degre that I increment and decrement with two threads increase and decrease)
    public class Test{
         public static void main(String[] args){
              Room r = new Room();
              decrease de = new decrease(r);
              increase in = new increase(r);
              de.start();
              in.start();
    class Room {
         private volatile int degre=20;
         public void more(){
         degre += 4;
         public void less(){      
         degre -= 3;
    class decrease extends Thread{
    private Room room;
    public decrease(Room r){
              room =r;
    public void run(){
    try{ 
         while (!interrupted()){ 
              room.less();
    catch(InterruptedException e) {}
    class increase extends Thread{
    private Room room;
    public increase(Room r){
         room =r;
    public void run(){ 
         try{ 
              while (!interrupted()){
                   room.more();
    catch(InterruptedException e) {}
    JDB:
    Initializing jdb ...
    stop at Test:7Deferring breakpoint Test:7.
    It will be set after the class is loaded.
    runrun Test
    Set uncaught java.lang.Throwable
    Set deferred uncaught java.lang.Throwable
    >
    VM Started: Set deferred breakpoint Test:7
    Breakpoint hit: "thread=main", Test.main(), line=7 bci=30
    7 in.start();
    main[1] stop at room:16
    Set breakpoint room:16
    main[1] stop at room:20
    Set breakpoint room:20
    main[1] resume
    All threads resumed.
    >
    Breakpoint hit: "thread=Thread-0", room.less(), line=20 bci=0
    20 degre -= 3;
    Thread-0[1] threads
    Group system:
    (java.lang.ref.Reference$ReferenceHandler)0x10d Reference Handler cond. waiting
    (java.lang.ref.Finalizer$FinalizerThread)0x10c Finalizer cond. waiting
    (java.lang.Thread)0x10b Signal Dispatcher running
    Group main:
    (decrease)0x146 Thread-0 running (at breakpoint)
    (increase)0x147 Thread-1 running (at breakpoint)
    (java.lang.Thread)0x148 DestroyJavaVM running
    Thread-0[1] resume 0x147
    Thread-0[1]
    Breakpoint hit: "thread=Thread-1", room.more(), line=16 bci=0
    16 degre += 4;
    Thread-1[1] resume 0x147
    Thread-1[1]
    Breakpoint hit: "thread=Thread-1", room.more(), line=16 bci=0
    16 degre += 4;
    Thread-1[1] print degre
    degre = 24
    Thread-1[1] resume 0x146 //It's here the problem, thread 0x146 have to stop on the //next breakpoint of decrease but nothing happen
    Thread-1[1] resume 0x147
    Thread-1[1]
    Breakpoint hit: "thread=Thread-1", room.more(), line=16 bci=0
    16 degre += 4;
    Thread-1[1] clear
    Breakpoints set:
    breakpoint Test:7
    breakpoint room:16
    breakpoint room:20
    PS: I tried many other examples with other class and other kind of breakpoints, but, in any cases, on thread doesn't manage to resume. When I try with general resume (no specification of the thread), It works but it isn't interresting for me because I want to decide wich thread continue his execution.

    Hi,
    I have read the FAQ of the JMF.
    The problem was the jar files of the JMF were not in the JRE\BIN\EXT
    folder of the Java runtime!
    now it works!
    thanks
    Reg

  • How to encrypt password with hash function in Java?

    Hello, everybody!
    I will need to store user passwords in a database, but for stronger security I want to store these passwords hashed, so I know I will need a column for the password and for the salt value.
    So, I'd like that you indicate me a very good article or tutorial (preferable from Sun) that shows me how to use Java to encrypt and decrypt passwords with hash. It doesn't necessarily need to deal with database. I can implement this part myself after seeing how Java manage encryption with hash functions.
    Thank you very much.
    Marcos

    I will tell you more precisely what I want to get better for you to help me.
    As I said I implemented in .NET what I need to implement in Java now. In my
    database I have a table with this structure (I omitted that columns that are not
    necessary to our discussion):
    CREATE TABLE EMPLOYEES
    ID NOT NULL PRIMARY KEY,
    PASSWORD VARCHAR(40), -- password encrypted
    HASH_SALT VARCHAR(10) -- salt value used to encrypt password
    So, in the table I have a column to store the password encrypted and a column to
    store the salt value.
    Below is a little utility class (in C#) that I use to generate the salt and
    the hashed password.
    public static class PasswordUtilities
        public static string GenerateSalt()
            RNGCryptoServiceProvider encoder = new RNGCryptoServiceProvider();
            byte[] buffer = new byte[5];
            encoder.GetBytes(buffer);
            return Convert.ToBase64String(buffer);
        public static string EncryptPassword(string password, string salt)
            string encryptedPassword =
                FormsAuthentication.HashPasswordForStoringInConfigFile(
                password + salt, "SHA1");
            return encryptedPassword;
    }As you can see, the class is fairly simple. It only has two methods: one to
    generate the salt value that will be used to encrypt the password and another
    one to encrypt the password. The method HashPasswordForStoringInConfigFile of
    the FormsAuthentication class is what really hash the password with the salt
    value. This class belongs to the .NET library, so we can't see its source code,
    but it doesn't matter for our discussion as I know that we can implement
    something similar in Java.
    Below is a little sample code showing the use of the utility class above to
    encrypt a password.
    public class Encrypt
        public static void Main(string args[])
            string password = "Secret";
            string salt = PasswordUtilities.GenerateSalt();
            string encryptedPassword = PasswordUtilities.EncryptPassword(password, salt);
            // now I store 'encryptedPassword' in the PASSWORD column and 'salt'
            // in the HASH_SALT column in the EMPLOYEES table.
    }To verify if a password is correct I can use the code below:
    public class VerifyPassword
        public static void Main(string args[])
            string password = GetPasswordFromUser();
            // Let's assume that employee is an instance that corresponds to a row
            // in the database and the properties HashSalt and Password correspond
            // to the HASH_SALT and PASSWORD columns respectively.
            Employee employee = GetEmployeeFromDatabase(1);
            string salt = employee.HashSalt;
            string encryptedPassword = PasswordUtilities.EncryptPassword(password, salt);
            bool passwordMatch = employee.Password.Equals(encryptedPassword);
            System.Console.WriteLine(passwordMatch);
    }The only thing that interest me in this discussion is the PasswordUtilities class.
    As you saw its code is in C#, using the .NET framework libraries.
    What I want is to have this same little class coded in Java, to generate the salt
    value and to encrypt the password passed in using salt value generated. If you could
    help me to do that with articles that have what I want or with code that already do
    that I would really appreciate.
    Thank you in advance.
    Marcos

  • Queries with custom functions

    Hi, Oracle gurus,
    I experienced recently an issue with SQL performance when playing with queries using PL/SQL functions.
    Let’s look at the following query:
    SELECT my_package.my_function(x)
    FROM Xvalues
    This query returns values calculated by a PL/SQL function “my_function” in “my_package” package. The function performs some CPU intensive computations so that it takes it approx. 1 second to return a value. If the “Xvalues” table contains 100 rows then it takes Oracle 100 seconds to complete the query. OK.
    Now I want to filter only non null results so that my query may look as:
    SELECT y
    FROM (
    SELECT my_package.my_function(x) y
    FROM Xvalues
    WHERE y IS NOT NULL
    It was surprising for me that it took Oracle ca. 200 seconds to complete this query, twice as long as the original one. I believe that the optimizer resolves this query to something like this:
    SELECT my_package.my_function(x) y
    FROM Xvalues
    WHERE my_package.my_function(x) IS NOT NULL
    When processing such a query Oracle first evaluates the WHERE clause to decide to return output values specified in the SELECT clause or not. That’s logical in most situations, but in this particular case it leads to longer execution time.
    What I do to workaround this problem is splitting the query. First I put all values into a temporary table using
    INSERT INTO TempTable
    (SELECT my_package.my_function(x)
    FROM Xvalues)
    and then select non null results with another query
    SELECT y
    FROM TempTable
    WHERE y IS NOT NULL
    The whole execution time shrinks to original ca. 100 seconds what I wanted to achieve. Nevertheless I am not satisfied with this solution because it introduces some intermediate steps. This is only a simplified example but in fact my query is much more complex, consists of many nested subqueries, etc. and this approach – although effective – would require dozens of temporary tables and make the whole query unclear.
    I wonder if there is a simpler solution possible, for example to have one single hierarchical query like above one and force Oracle first to fully process the nested subquery and then the embracing one? The goal is to decrease waiting for filtered results down to original 100 seconds (or a bit longer) …
    Any suggestions will be greatly appreciated!
    Greg

    Maybe Tom Kyte's "trick" of the "select pl_sql_function () from dual" to invoke scalar subquery caching can help you:
    select ename
      from emp, dept
    where (select dname_lookup(emp.deptno) from dual) = 'SALES'
       and dept.deptno = 30
       and emp.deptno = dept.deptno;http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1547006324238
    As Tom says, in 11g you'll be able to cache that function (new 11g feature) which removes the need for the "trick":
    Oracle® Database PL/SQL Language Reference 11g Release 1 (11.1)
    - 8 Using PL/SQL Subprograms
    -- Using the Cross-Session PL/SQL Function Result Cache
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/subprograms.htm#BABFHACJ
    "On the PL/SQL Function Result Cache" by Steven Feuerstein
    http://www.oracle.com/technology/oramag/oracle/07-sep/o57plsql.html
    Regards,
    Zlatko

  • General Inquiry Regarding Error Handling with System Exec.vi

    I have a sub vi that uses the System Exec.vi to send SMS messages when triggered. I am confused as to how the error handling works and why all of the errors seem to go to the "standard error" vs the "Error out". The reason I am interested is because I am trying to interrupt the error out of another script to execute a command if error=true.
    I have intentionally created an error to test this, however it does not seem that the signal is ever being sent to the error out, only to the standard error.
    Any help/explanation as to how this works would be greatly appreciated.

    The Facebook discussion board is just a pilot and that functionality is not available yet (as to my knowledge). You will have to use the actual forum thread to add attachments. You can click the arrow just to the right of thread topic in the Facebook thread and that will take you to the ni.com/forums thread. Or you can navigate here:
    http://forums.ni.com/t5/LabVIEW/General-Inquiry-Regarding-Error-Handling-with-System-Exec-vi/m-p/246...
    Having a look at your VI would help to clarify the error handling issue.
    Daniel K | NI Applications Engineer | Certified LabVIEW Developer

  • Interface with SHBrowseForFolder Function (shell32.dll)

    Dear OTN members,
    Anyone there know how to interface with SHBrowseForFolder
    Function in "shell32.dll" Windows NT's library ?
    Regards
    Khoo
    null

    I am currently using oracle developer Forms4.5 (release 1.6).
    TQ
    Regards,
    Khoo
    null

  • [SOLVED] dwm doesn't compile with moveresize function

    I'am trying to compile dwm with moveresize function but I get this error:
    dwm build options:
    CFLAGS = -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/include/X11 -DVERSION="5.7.2" -DXINERAMA
    LDFLAGS = -s -L/usr/lib -lc -L/usr/lib/X11 -lX11 -L/usr/lib/X11 -lXinerama
    CC = cc
    CC dwm.c
    In file included from dwm.c:254:0:
    config.h: In function 'moveresize':
    config.h:23:7: error: dereferencing pointer to incomplete type
    config.h:23:34: error: dereferencing pointer to incomplete type
    config.h:26:9: error: dereferencing pointer to incomplete type
    config.h:26:17: error: dereferencing pointer to incomplete type
    config.h:27:6: error: dereferencing pointer to incomplete type
    config.h:28:6: error: dereferencing pointer to incomplete type
    config.h:29:6: error: dereferencing pointer to incomplete type
    make: *** [dwm.o] Error 1
    Here's my config.h
    /* See LICENSE file for copyright and license details. */
    /* appearance */
    static const char font[] = "-*-terminus-*-*-*-*-12-*-*-*-*-*-*-*";
    static const char normbordercolor[] = "#454545";
    static const char normbgcolor[] = "#454545";
    static const char normfgcolor[] = "#C0C0C0";
    static const char selbordercolor[] = "#C0C0C0";
    static const char selbgcolor[] = "#454545";
    static const char selfgcolor[] = "#FFFFFF";
    static const unsigned int borderpx = 1; /* border pixel of windows */
    static const unsigned int snap = 32; /* snap pixel */
    static const Bool showbar = True; /* False means no bar */
    static const Bool topbar = True; /* False means bottom bar */
    /* moveresize */
    static void moveresize(const Arg *arg) {
    XEvent ev;
    Monitor *m = selmon;
    if(!(m->sel && arg && arg->v && m->sel->isfloating))
    return;
    resize(m->sel, m->sel->x + ((int *)arg->v)[0],
    m->sel->y + ((int *)arg->v)[1],
    m->sel->w + ((int *)arg->v)[2],
    m->sel->h + ((int *)arg->v)[3],
    True);
    while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
    /* tagging */
    static const char *tags[] = { "term", "web", "fm", "im", "media", "float" };
    static const Rule rules[] = {
    /* class instance title tags mask isfloating monitor */
    { "Gimp", NULL, NULL, 1 << 5, True, -1 },
    { "Chromium", NULL, NULL, 1 << 1, True, -1 },
    { "MPlayer", NULL, NULL, 0, True, -1 },
    { "Wine", NULL, NULL, 1 << 5, True, -1 },
    { "Gpicview", NULL, NULL, 0, True, -1 },
    { "Pcmanfm", NULL, NULL, 1 << 2, True, -1 },
    { "Xarchiver", NULL, NULL, 0, True, -1 },
    { "Amsn", NULL, NULL, 1 << 3, True, -1 },
    /* layout(s) */
    static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
    static const Bool resizehints = False; /* True means respect size hints in tiled resizals */
    static const Layout layouts[] = {
    /* symbol arrange function */
    { "[]=", tile }, /* first entry is default */
    { "><>", NULL }, /* no layout function means floating behavior */
    { "[M]", monocle },
    /* key definitions */
    #define MODKEY Mod4Mask
    #define TAGKEYS(KEY,TAG) \
    { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
    { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
    { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
    { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
    /* helper for spawning shell commands in the pre dwm-5.0 fashion */
    #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
    /* commands */
    static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
    static const char *tdmenucmd[] = { "tdmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
    static const char *termcmd[] = { "roxterm", NULL };
    static const char *mutecmd[] = { "amixer", "-q", "sset", "Master", "toggle", NULL };
    static const char *volupcmd[] = { "amixer", "-q", "sset", "Master", "5-", "unmute", NULL };
    static const char *voldowncmd[] = { "amixer", "-q", "sset", "Master", "5+", "unmute", NULL };
    static const char *bgltupcmd[] = { "xbacklight", "-inc", "15", NULL };
    static const char *bgltdowncmd[] = { "xbacklight", "-dec", "1", NULL };
    static const char *displayoff[] = { "xset", "dpms", "force", "off", NULL };
    static const char *suspend[] = { "sudo", "pm-suspend", NULL };
    static Key keys[] = {
    /* modifier key function argument */
    { 0, 0x1008ff12, spawn, {.v = mutecmd } },
    { 0, 0x1008ff11, spawn, {.v = volupcmd } },
    { 0, 0x1008ff13, spawn, {.v = voldowncmd } },
    { 0, 0x1008ff02, spawn, {.v = bgltupcmd } },
    { 0, 0x1008ff03, spawn, {.v = bgltdowncmd } },
    { 0, 0x1008ff59, spawn, {.v = displayoff } },
    { 0, 0x1008ff2f, spawn, {.v = suspend } },
    { MODKEY, XK_p, spawn, {.v = dmenucmd } },
    { MODKEY, XK_r, spawn, {.v = tdmenucmd } },
    { MODKEY, XK_Return, spawn, {.v = termcmd } },
    { MODKEY, XK_b, togglebar, {0} },
    { MODKEY, XK_j, focusstack, {.i = +1 } },
    { MODKEY, XK_k, focusstack, {.i = -1 } },
    { MODKEY, XK_h, setmfact, {.f = -0.05} },
    { MODKEY, XK_l, setmfact, {.f = +0.05} },
    { MODKEY|ShiftMask, XK_Return, zoom, {0} },
    { MODKEY, XK_Tab, view, {0} },
    { MODKEY, XK_c, killclient, {0} },
    { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
    { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
    { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
    { MODKEY, XK_space, setlayout, {0} },
    { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
    { MODKEY, XK_0, view, {.ui = ~0 } },
    { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
    { MODKEY, XK_comma, focusmon, {.i = -1 } },
    { MODKEY, XK_period, focusmon, {.i = +1 } },
    { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
    { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
    { MODKEY|ShiftMask, XK_q, quit, {0} },
    { MODKEY, XK_Down, moveresize, {.v = (int []){ 0, 25, 0, 0 }}},
    { MODKEY, XK_Up, moveresize, {.v = (int []){ 0, -25, 0, 0 }}},
    { MODKEY, XK_Right, moveresize, {.v = (int []){ 25, 0, 0, 0 }}},
    { MODKEY, XK_Left, moveresize, {.v = (int []){ -25, 0, 0, 0 }}},
    { MODKEY|ShiftMask, XK_Down, moveresize, {.v = (int []){ 0, 0, 0, 25 }}},
    { MODKEY|ShiftMask, XK_Up, moveresize, {.v = (int []){ 0, 0, 0, -25 }}},
    { MODKEY|ShiftMask, XK_Right, moveresize, {.v = (int []){ 0, 0, 25, 0 }}},
    { MODKEY|ShiftMask, XK_Left, moveresize, {.v = (int []){ 0, 0, -25, 0 }}},
    TAGKEYS( XK_1, 0)
    TAGKEYS( XK_2, 1)
    TAGKEYS( XK_3, 2)
    TAGKEYS( XK_4, 3)
    TAGKEYS( XK_5, 4)
    TAGKEYS( XK_6, 5)
    TAGKEYS( XK_7, 6)
    TAGKEYS( XK_8, 7)
    TAGKEYS( XK_9, 8)
    /* button definitions */
    /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    static Button buttons[] = {
    /* click event mask button function argument */
    { ClkLtSymbol, 0, Button1, setlayout, {0} },
    { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
    { ClkWinTitle, 0, Button2, zoom, {0} },
    { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
    { ClkClientWin, MODKEY, Button1, movemouse, {0} },
    { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
    { ClkClientWin, MODKEY|ShiftMask, Button1, resizemouse, {0} },
    { ClkTagBar, 0, Button1, view, {0} },
    { ClkTagBar, 0, Button3, toggleview, {0} },
    { ClkTagBar, MODKEY, Button1, tag, {0} },
    { ClkTagBar, MODKEY, Button3, toggletag, {0} },
    Last edited by Aakko (2010-05-30 18:21:30)

    ber_t wrote:A vanilla dwm compiles fine with your config.h. So I guess you're using other patches that rearrange the #include directive for config.h in dwm.c, e.g. pertag. If that's the case, you have to put the moveresize function in dwm.c and declare it before config.h get's included, just like any other function in dwm.c.
    Yes I had dwm.c patched with pertag. Vanilla compiles fine. Thanks!

  • Error TypeError: null has no such function "getAppView" logical transform script version 4.1.0.866

    Hello,
    I am using Oracle Data Modeler version 4.1.0.866 and when I created a transform script in object logical, motor Oracle Nasnhorm give the error TypeError: null has no such function "getAppView".
    The code is:
    var guipkgs = JavaImporter(java.lang, java.awt, java.awt.event, java.awt.Window, Packages.javax.swing ,java.lang, Packages.javax.swing.border);
    with (guipkgs) {
        log_rep = new Packages.oracle.dbtools.crest.swingui.LogReport(model.getAppView());
        log_rep.setName("CONTADOR");
        var cont = 0;
        var text = "";
    entities = model.getDesign().getLogicalDesign().getEntitySet().toArray();
    for (var t = 0; t<entities.length;t++){
      entity = entities[t];
        Name = entity.getName();
        cont = cont + 1;
        text = text + " " + Name + "\n";  
    text = text + cont + "\n";
                log_rep.setLog(text);
        log_rep.showModalDialog(new java.awt.Dimension(1300, 550));
    Already you can not use log_rep = new Packages.oracle.dbtools.crest.swingui.LogReport(model.getAppView());? Is there any alternative?
    This error does not come with previous versions.
    Thanks.

    Hello,
    I modified the script add following at the beginning of script:
    model = model.getDesign().getLogicalDesign();   and carry on the error TypeError: null has no such function "getAppView".
    var guipkgs = JavaImporter(java.lang, java.awt, java.awt.event, java.awt.Window, Packages.javax.swing ,java.lang, Packages.javax.swing.border);
    with (guipkgs) {
        model = model.getDesign().getLogicalDesign();
        log_rep = new Packages.oracle.dbtools.crest.swingui.LogReport(model.getAppView());
        log_rep.setName("CONTADOR");
        var cont = 0;
        var text = "";
    entities = model.getDesign().getLogicalDesign().getEntitySet().toArray();
    for (var t = 0; t<entities.length;t++){
      entity = entities[t];
        Name = entity.getName();
        cont = cont + 1;
        text = text + " " + Name + "\n"; 
    text = text + cont + "\n";
                log_rep.setLog(text);
        log_rep.showModalDialog(new java.awt.Dimension(1300, 550))
    Any idea?
    Thanks

  • How to achieve an outer join with existsNode() function

    I have a requirement to do an outer join with existsNode() function in my where clause. At present my where clause for join is like below
    WHERE A.SOME_ID= “XYZ”
    AND existsNode (B.SOMEXML_FEILD , …. ) = 1
    AND existsNode (C.SOMEOTHERXML_FEILD , …. ) = 1
    In this case if the existsNode fails on B or C, I still want data from A to be selected. How to rewrite this query to achieve that? I kinda want to achieve an outer join

    Hi,
    is this what you are looking for:
    SQL> with t as(select 1 id1,'A' name from dual union all
      2            select 2 ,'B' name from dual union all
      3            select 3,'C' from dual)
      4      ,x as(select 1 id2,xmltype('<a>a</a>') xcol from dual union all
      5            select 2 ,xmltype('<b>b</b>') xcol from dual)
      6  select *
      7  from t,x
      8  where t.id1=x.id2(+)
      9    and (existsNode(x.xcol,'/a')=1 or x.xcol is null);
           ID1 N        ID2 XCOL                                                   
             1 A          1 <a>a</a>                                               
             3 C                                                                   
    SQL> spool off;

  • TNS:listener could not find available handler with matching protocol stack

    Hi,
    I am getting the following stack trace in b2b.log file:
    2009.01.06 at 14:34:35:869: Thread-108: BusinessLogicLayer - (ERROR) caught error: Error -: AIP-13002: SQL error getting the DataSource
    2009.01.06 at 14:34:35:870: Thread-108: IP - (ERROR) java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12516, TNS:listener could not find available handler with matching protocol stack
    The Connection descriptor used by the client was:
    (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))(LOAD_BALANCE=yes)(CONNECT_DATA=(SERVICE_NAME=test)))
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:137)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:292)
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:327)
         at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:429)
         at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:150)
         at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:31)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:608)
         at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:217)
         at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:113)
         at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:76)
         at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:58)
         at oracle.jdbc.pool.OracleConnectionCacheImpl.getNewPoolOrXAConnection(OracleConnectionCacheImpl.java:493)
         at oracle.jdbc.pool.OracleConnectionCacheImpl.getPooledConnection(OracleConnectionCacheImpl.java:368)
         at oracle.jdbc.pool.OracleConnectionCacheImpl.getConnection(OracleConnectionCacheImpl.java:306)
         at oracle.jdbc.pool.OracleConnectionCacheImpl.getConnection(OracleConnectionCacheImpl.java:285)
         at oracle.tip.buslogic.common.DBConnectivity.getConnection(DBConnectivity.java:151)
         at oracle.tip.buslogic.common.ExecutionContextImpl.getService(ExecutionContextImpl.java:379)
         at oracle.tip.buslogic.common.ExecutionContextImpl.setRuntimeActiveandQuiescing(ExecutionContextImpl.java:799)
         at oracle.tip.adapter.b2b.data.B2BExecutionContext.setRuntimeActiveAndQuiescing(B2BExecutionContext.java:130)
         at oracle.tip.adapter.b2b.data.B2BExecutionContext.activate(B2BExecutionContext.java:98)
         at oracle.tip.adapter.b2b.data.DBContext.initialize(DBContext.java:90)
         at oracle.tip.adapter.b2b.data.DataContext.getNewDBContext(DataContext.java:365)
         at oracle.tip.adapter.b2b.data.DataContext.getDBContext(DataContext.java:346)
         at oracle.tip.adapter.b2b.transport.InterfaceListener.onMessage(InterfaceListener.java:232)
         at oracle.tip.transport.basic.FileSourceMonitor.processMessages(FileSourceMonitor.java:858)
         at oracle.tip.transport.basic.FileSourceMonitor.run(FileSourceMonitor.java:302)
    When I ran the enquire script. I am getting the following exception:
    IPEnqueue start...
    Action Name = null
    oracle.jms.AQjmsException: ORA-00600: internal error code, arguments: [kwqbgqc: bad state], [1], [1], [], [], [], [], []
    ORA-06512: at "SYS.DBMS_AQIN", line 454
    ORA-06512: at line 1
    at oracle.jms.AQjmsProducer.enqueue(AQjmsProducer.java:1180)
    at oracle.jms.AQjmsProducer.publish(AQjmsProducer.java:1407)
    at oracle.jms.AQjmsProducer.publish(AQjmsProducer.java:1512)
    at oracle.tip.adapter.b2b.data.IPEnqueue.main(IPEnqueue.java:201)
    [Linked-exception]
    java.sql.SQLException: ORA-00600: internal error code, arguments: [kwqbgqc: bad state], [1], [1], [], [], [], [], []
    ORA-06512: at "SYS.DBMS_AQIN", line 454
    ORA-06512: at line 1
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:315)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:281)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:638)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:183)
    at oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(T4CCallableStatement.java:872)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1085)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2983)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3025)
    at oracle.jms.AQjmsProducer.enqueue(AQjmsProducer.java:1110)
    at oracle.jms.AQjmsProducer.publish(AQjmsProducer.java:1407)
    at oracle.jms.AQjmsProducer.publish(AQjmsProducer.java:1512)
    at oracle.tip.adapter.b2b.data.IPEnqueue.main(IPEnqueue.java:201)
    Error -: AIP-13121: Connection-related error. Please verify that the database server is running.: java.sql.SQLException: Closed Connection
    at oracle.tip.buslogic.common.SessionDownException.isSessionDown(SessionDownException.java:96)
    at oracle.tip.common.IPException.initIPException(IPException.java:179)
    at oracle.tip.common.IPException.<init>(IPException.java:114)
    at oracle.tip.repos.core.persistency.DCException.<init>(DCException.java:68)
    at oracle.tip.repos.core.driver.CatalogDriver.disconnect(CatalogDriver.java:1666)
    at oracle.tip.repos.core.persistency.PersistencyService.disconnect(PersistencyService.java:578)
    at oracle.tip.buslogic.common.ExecutionContextImpl.disconnectService(ExecutionContextImpl.java:602)
    at oracle.tip.buslogic.common.ExecutionContextManager.cleanContextResources(ExecutionContextManager.java:629)
    at oracle.tip.buslogic.common.ExecutionContextManager.leaveContext(ExecutionContextManager.java:581)
    at oracle.tip.buslogic.common.ExecutionContextManager.leaveContext(ExecutionContextManager.java:720)
    at oracle.tip.adapter.b2b.data.IPEnqueue.main(IPEnqueue.java:245)
    Caused by: java.sql.SQLException: Closed Connection
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:161)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:226)
    at oracle.jdbc.driver.PhysicalConnection.rollback(PhysicalConnection.java:1041)
    at oracle.jdbc.OracleConnectionWrapper.rollback(OracleConnectionWrapper.java:90)
    at oracle.tip.repos.core.driver.CatalogDriver.disconnect(CatalogDriver.java:1662)
    ... 6 more
    I tested the database and it was up. Any help is appreciated.

    You may be interested in http://www.tek-tips.com/viewthread.cfm?qid=1368266&page=10

  • Found no handler for remote function module SPC_GET_PRICING_PROCEDURE_INFO

    Hi
    We are on CRM 7.0 with ECC 6.0 as backend system.
    I have maintained all the settings that are required to create a sales order.
    But i am getting one error in header area::
    Found no handler for remote function module SPC_GET_PRICING_PROCEDURE_INFO
    Could any one provide me information on this.
    Thanks in advance

    Hi,
    Check this note.
    884991
    Your problem is related to VMC
    Feel free to revert back.
    -=-Ragu

  • Problems with GREATEST() = Bug?

    I'm working on a view and got a problem with the GREATEST()-function - I'm using 11.2.
    Below I#ve past some code with comments which should explain the problem - but you're welcome to ask any more questions ;)
    -- first executeing the query separated to check it return valus   2.
    (SELECT nvl(max(acqtime),to_timestamp('01-01-1971','dd-mm-yyyy')) FROM rfm_meas_hr WHERE box_id IN (SELECT...WHERE id=4) );   
    -- returns: 01.01.71 00:00:00,000000000
    (SELECT nvl(max(acqtime),to_timestamp('01-01-1971','dd-mm-yyyy')) FROM rfm_meas_10m WHERE box_id IN (SELECT...WHERE id=4) );
    -- returns: 11.08.10 16:00:00,000000000
    -- therefore i assume if i use GREATEST() with this both timestamps ist would return the second one
    SELECT GREATEST(
            to_timestamp('01-01-1971 00:00:00,000','dd-mm-yyyy hh24:mi:ss,ff'),
            to_timestamp('11-08-2010 16:00:00,000','dd-mm-yyyy hh24:mi:ss,ff')
    ) FROM dual;
    -- do that job like expected
    -- BUT
    SELECT GREATEST(
            (SELECT nvl(max(acqtime),to_timestamp('01-01-1971','dd-mm-yyyy')) FROM rfm_meas_hr WHERE box_id IN (SELECT...WHERE id=4) ),
            (SELECT nvl(max(acqtime),to_timestamp('01-01-1971','dd-mm-yyyy')) FROM rfm_meas_10m WHERE box_id IN (SELECT...WHERE id=4) )
    ) FROM dual;
    -- returns the 1971 timestamp wich is the wrong result!
    -- any ideas?alternativly you can view the code on pastebin: http://pastebin.com/uGVDUMuU
    I want to know if this behaviour of GREATEST() is on purpose or if I did some mistake or anything else!?
    Thanks!

    As you read my examples above I worked with two tables (rfm_meas_hr and rfm_meas_10m). In a job i take the timestamp from rfm_meas_hr and put it into the rfm_meas_10m table. And at this point the full year information gets lost!
    Code example from that job:
    FOR meas IN
                SELECT
                    to_timestamp(MIN(acqtime),'dd-mm-yyyy hh24:mi:ss,ff3') AS acqtime,
                FROM
                    rfm_meas_hr
                WHERE
                GROUP BY
                ORDER BY
                    acqtime
    LOOP
                -- each result row containing summarized data is accesible on "meas"
                INSERT INTO rfm_meas_10m VALUES meas;
    END LOOP;The acqtime which is inserted to rfm_meas_10m contains the lost year-information, but in the acqtime-column of rfm_meas_hr are the full information avaiable. I've tested this with:
    SELECT to_char(acqtime,'dd-mm-yyyy hh24:mi:ss,ff') FROM rfm_meas_hr;
    -- and compare it to
    SELECT to_char(acqtime,'dd-mm-yyyy hh24:mi:ss,ff') FROM rfm_meas_10m;So may be it worth a try to leave out the to_timestamp-call in the select inside of the job code?! .. I'm going to try.
    [edit]
    @ user503699      
    No .. it produces a year like: 0010 ;) But as we see the error might not be a problem with LEAST/GREATEST anymore.
    Edited by: Stede on 12.08.2010 05:24

Maybe you are looking for