Return-Path: X-Original-To: apmail-empire-db-user-archive@www.apache.org Delivered-To: apmail-empire-db-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B886511358 for ; Wed, 18 Jun 2014 14:04:16 +0000 (UTC) Received: (qmail 30045 invoked by uid 500); 18 Jun 2014 14:04:16 -0000 Delivered-To: apmail-empire-db-user-archive@empire-db.apache.org Received: (qmail 30029 invoked by uid 500); 18 Jun 2014 14:04:16 -0000 Mailing-List: contact user-help@empire-db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@empire-db.apache.org Delivered-To: mailing list user@empire-db.apache.org Received: (qmail 30019 invoked by uid 99); 18 Jun 2014 14:04:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jun 2014 14:04:16 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of chieu.nguyen@verizon.com designates 199.249.25.208 as permitted sender) Received: from [199.249.25.208] (HELO omzsmtpe03.verizonbusiness.com) (199.249.25.208) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jun 2014 14:04:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verizon.com; i=chieu.nguyen@verizon.com; q=dns/txt; s=corp; t=1403100246; x=1434636246; h=from:to:date:subject:message-id:references:in-reply-to: mime-version; bh=14jOqpk0JmIa1IAAMp6CktrpeK5ot8JbELvMJ6U1C5U=; b=eK4DAznAnA7xwsTECNLSiWRjZOWi3rj6FXEfxUkgQ2QF3dBJwuHo+C// XDNYmdfHiLtyug7H0zi1lMe1PgI7d+0iL5cnybj3XFAOvmoNUuxGuItAj PN7K5q53THkUw6WrICRAbaZ3rebWGYrqP+R6oA8qnHDw/3qwNgavbZFEf 0=; X-IronPort-Anti-Spam-Filtered: false Received: from unknown (HELO fldsmtpi02.verizon.com) ([166.68.71.144]) by omzsmtpe03.verizonbusiness.com with ESMTP; 18 Jun 2014 14:03:44 +0000 From: "Nguyen, Chieu X" X-IronPort-AV: E=Sophos;i="5.01,501,1400025600"; d="scan'208,217";a="746548885" Received: from fhdp1lumxc7hb02.verizon.com (HELO FHDP1LUMXC7HB02.us.one.verizon.com) ([166.68.59.189]) by fldsmtpi02.verizon.com with ESMTP; 18 Jun 2014 14:03:39 +0000 Received: from FHDP1LUMXC7V41.us.one.verizon.com ([166.68.125.36]) by FHDP1LUMXC7HB02.us.one.verizon.com ([166.68.59.189]) with mapi; Wed, 18 Jun 2014 10:03:39 -0400 To: "user@empire-db.apache.org" Date: Wed, 18 Jun 2014 10:03:38 -0400 Subject: RE: Building DBCommand Thread-Topic: Building DBCommand Thread-Index: Ac+Ky1+fePuomhXjTuWApKY1D73rrQAMbYlA Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_DB0A1CB7BBFBB9499155678C54C1BF7B013C117FB3FHDP1LUMXC7V4_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_DB0A1CB7BBFBB9499155678C54C1BF7B013C117FB3FHDP1LUMXC7V4_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Rainer, Thank you for responding to my email. I have try what you suggested and it= works. The only issue with that is Oracle randomly selected # of rows to = return. The reason I need to put in that format is because I want this sce= nario. Let say I have 400 rows in a table, and I want to select those 400 row orde= r by customer name. Now, I want to return that 1st 100 in that order. Nex= t, I want to run the same query but this time I want it to return rows 101-= 200, then, rows 201-300, and finally rows 301-400. I think the only I can achieved this is by running the query below. select * from ( select a.*, ROWNUM rnum from ( // I know how to write this qu= ery. ) a where rownum <=3D MAX_ROW ) where rnum >=3D MIN_ROW I would appreciate any suggestions. Thank You, Chieu Nguyen Chieu.nguyen@verizon.com --_000_DB0A1CB7BBFBB9499155678C54C1BF7B013C117FB3FHDP1LUMXC7V4_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi Rainer,

 

Thank you for responding to my email.=A0 I have t= ry what you suggested and it works.=A0 The only issue with that is Oracle r= andomly selected # of rows to return.=A0 The reason I need to put in that f= ormat is because I want this scenario.

 

Let say I have 400 rows in a table,= and I want to select those 400 row order by customer name.=A0 Now, I want = to return that 1st 100 in that order. =A0Next, I want to run the= same query but this time I want it to return rows 101-200, then, rows 201-= 300, and finally rows 301-400.

 

I think the only I can achieved this is by = running the query below.

 

select * from (=

  select a.*, ROWNUM rnum from (

    <select statemenet with order by clause>= ; // I know how to write this query.

  ) a w= here rownum <=3D MAX_ROW

) where rnum >=3D = MIN_ROW

 

 

Thank You,

 

 

 

Chieu Nguy= en

Chieu.nguyen@verizon.com

 

From: Rainer= D=F6bele [mailto:doebele@esteam.de]
Sent: Wednesday, June 18, 2= 014 3:01 AM
To: user@empire-db.apache.org
Subject: re: = Building DBCommand

 

Hi Nhuyen,

this is Oracle Syntax and it is already = implemented for the Oracle driver.

All you need to to is the f= ollowing:

1. Make sure you are using de DBDatabaseDriverOracle= .

= 2. Use cmd. lim= itRows(…) and cmd. skipR= ows(…)

then it should generate the desired statement for= you.

There is no need to wrap the command inside another comm= and.

Best regards

Rainer

 =

 

Von: Nguyen, Chieu X [mail= to:chieu.nguyen@verizon.com]
Gesendet: Dienstag, 17. Juni 20= 14 22:43
An: user@em= pire-db.apache.org
Betreff: Building DBCommand

 

Hi Rainer,

 

I was wondering how would I writ= e the following SQL using EmpireDB.

 

select * from (

  sele= ct a.*, ROWNUM rnum from (

    <= ;select statemenet with order by clause> // I know how to write this que= ry.

  ) a where rownum <=3D MAX_ROW<= /o:p>

) where rnum >=3D MIN_ROW

 

I would apprecia= te any suggestions.

 

Thank You,

 

 

=  

Chieu Nguyen

Chieu.nguyen@verizon.com

 

= --_000_DB0A1CB7BBFBB9499155678C54C1BF7B013C117FB3FHDP1LUMXC7V4_--