Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

emulate "ignore nulls" of Lead of DB2 V9.7

Aketi JyuuzouJun 22 2009 — edited Sep 8 2009
I am using Oracle10gR2.

http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=/com.ibm.db2.luw.sql.ref.doc/doc/r0023461.html
In DB2 V9.7, there is new future which is "ignore nulls" of "lead" and "Lag"
I want to emulate below DB2 V9.7 SQL.
select SortKey,Val,
Lag (Val,2,999,ignore nulls) over(order by SortKey) as Lag2,
Lead(Val,2,999,ignore nulls) over(order by SortKey) as Lead2
  from W;
Therefore I want below output.
SortKey   Val  Lag2  Lead2
-------  ----  ----  -----
      1     2   999      6
      2  null   999      6
      5     4   999      5
      9  null     2      5
     11     6     2      3
     12  null     4      3
     14  null     4      3
     16     5     4      4
     17  null     6      4
     20     3     6    999
     21  null     5    999
     22     4     5    999
I like using "case expression" and "ignore nulls".
But first study step should be easy.
create table W as
select  1 as SortKey,2 as Val from dual union all
select  2,null from dual union all
select  5,   4 from dual union all
select  9,null from dual union all
select 11,   6 from dual union all
select 12,null from dual union all
select 14,null from dual union all
select 16,   5 from dual union all
select 17,null from dual union all
select 20,   3 from dual union all
select 21,null from dual union all
select 22,   4 from dual;

select SortKey,Val,Lag2,Lead2,
First_Value(Lag2 ignore nulls)
over(order by SortKey rows between current row
                               and Unbounded Following) as Lag3,
Last_Value(Lead2 ignore nulls) over(order by SortKey) as Lead3
from (select SortKey,Val,
      case when Val is not null then Lag (Val,2,999)
      over(partition by nvl2(Val,0,1) order by SortKey) end as Lag2,
      case when Val is not null then Lead(Val,2,999)
      over(partition by nvl2(Val,0,1) order by SortKey) end as Lead2
        from W)
order by SortKey;
Is there solution of Oracle more easy of my above solution?

Comments

Narayan
HI user,

I think you mean the multi-Scene Interface , if so then In javafx you can change many scenes in a single Stage so that you can swap those scene. All things in the JavaFX is customizable.

Simple going code:
private Scene s1,s2;
private Stage stage;

public void start(Stage stage) {
	this.stage = stage;
	s1 = new Scene(panel1); //Contains the first window element
	s2 = new Scene(panel2)  //Contains the second window elements
	stage.setScene(s1);
}


//Anywhere in the code after certain condition matches in existing class
this.stage.setScene(s2); //this code changes the scene of your main program Stage/Window
For more about this you can head toward the Stage and Scene API

Thanks
Narayn
986307
Hi Narayan,

In your example there is only one scene visible at time.

What I'm looking for is JavaFX version of Swing JDesktopPane which can serve as container for individual "child" JInternalFrames frames.
If you minimize child frame, icon of it is located on the bottom of the container pane instead of Windows task bar.
You can have several child frames and they can overlap each other. You cannot move child frame out of the container.

http://en.wikipedia.org/wiki/Multiple_document_interface

http://docs.oracle.com/javase/tutorial/uiswing/components/internalframe.html
986307
There is an old thread about JDesktopPane here: 10057351

Using Netbeans or Eclipse platform only for this purpose sounds a bit heavy solution.
Narayan
Hi user,
Currently there is nothing like that in JavaFX internal API. But you can use third party free library like JFXTras.
They already have the VFXWindow class which helps to run the multiple window inside the window like the JInternalFrame of Swing.

Or Alternatively you can even make the custom as well. It's all about the Layouts and the Node. :)


-------------
Links to the VFXWindows library:
- http://jfxtras.org
- http://www.youtube.com/watch?v=QH_A9rWc4zg


Thanks
Narayan
JAVA_AGM

HI

Can u please send me the implementaion details of MDI using swing in javafx.

It will be helpful for me.

1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 6 2009
Added on Jun 22 2009
16 comments
6,849 views