First Row, Next Row, Prior Row, Last Row

I have a SQL Anywhere 7.0 Database, have  a  table
Product_detail  which contains
Column Name  Datatype      width          Null       
Default
batch_id     char(10)                      No         None
prod_id     Integer                        No         None
employee_id Integer                        No         None
quantity   Integer                         No         None
price      Numeric      (14, 2)            No          None

Its primary key is   batch_id
I have a Freeform   Datawindow with this table
I want to provide the first row, next row, prior row and
last row
How to get the first , next, prior and last row record from
the above table?
If the primary key datatype is integer, I know how to get
first, next, prior and last row. But here
Primary column datatype is char(10)
Any idea?
0
ghkumartklm
2/1/2007 5:34:37 AM
sybase.powerbuilder.datawindow 28057 articles. 4 followers. Follow

9 Replies
1319 Views

Similar Articles

[PageSpeed] 17

ORDER BY is the only method offered in ANSI SQL to control the ordering 
of the resultset. In the absence of ORDER BY, the resultset can be 
returned in any order that the engine chooses. Changes in the optimizer 
in recent versions of SQL Anywhere make the resultset even less 
deterministic.

If your are not using ORDER BY when your primary key is integer, it is 
only by happen chance that you are getting consistent resultset 
ordering. You should not rely on that resultset ordering will be 
maintained.

ghkumartklm@yahoo.com wrote:
> I have a SQL Anywhere 7.0 Database, have  a  table
> Product_detail  which contains
> Column Name  Datatype      width          Null       
> Default
> batch_id     char(10)                      No         None
> prod_id     Integer                        No         None
> employee_id Integer                        No         None
> quantity   Integer                         No         None
> price      Numeric      (14, 2)            No          None
> 
> Its primary key is   batch_id
> I have a Freeform   Datawindow with this table
> I want to provide the first row, next row, prior row and
> last row
> How to get the first , next, prior and last row record from
> the above tabl
> If the primar key datatype is integer, I know how to get
> first, next, prior and last row. But here
> Primary column datatype is char(10)
> Any idea?

-- 

Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8

*****************************************************************************

Sign up today for your copy of the SQL Anywhere Studio 9 Developer 
Edition =and try out the market-leading database for mobile, embedded 
and small to medium sized business environments for free!

http://www.ianywhere.com/promos/deved/index.html

*****************************************************************************

iAnywhere Solutions  http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use Case Express to report bugs http://case-express.sybase.com

*****************************************************************************
0
Chris
2/1/2007 10:57:19 AM
If I use select * from prod_details order by batch_id ASC,
shall i get the result ?
> ORDER BY is the only method offered in ANSI SQL to control
> the ordering  of the resultset. In the absence of ORDER BY
> , the resultset can be  returned in any order that the
> engine chooses. Changes in the optimizer  in recent
> versions of SQL Anywhere make the resultset even less
> deterministic.
>
> If your are not using ORDER BY when your primary key is
> integer, it is  only by happen chance that you are getting
> consistent resultset  ordering. You should not rely on
> that resultset ordering will be  maintained.
>
> ghkumartklm@yahoo.com wrote:
> > I have a SQL Anywhere 7.0 Database, have  a  table
> > Product_detail  which contains
> > Column Name  Datatype      width          Null
> > Default
> > batch_id     char(10)                      No
> > None prod_id     Integer                        No
> >   None employee_id Integer                        No
> >     None quantity   Integer                         No
> >       None price      Numeric      (14, 2)            No
> >          None
> > Its primary key is   batch_id
> > I have a Freeform   Datawindow with this table
> > I want to provide the first row, next row, prior row and
> > last row
> > How to get the first , next, prior and last row record
> > from the above tabl
> > If the primar key datatype is integer, I know how to get
> > first, next, prior and last row. But here
> > Primary column datatype is char(10)
> > Any idea?
>
> --
>
> Chris Keating
> Sybase Adaptive Server Anywhere Professional Version 8
>
> **********************************************************
> *******************
>
> Sign up today for your copy of the SQL Anywhere Studio 9
> Developer  Edition =and try out the market-leading
> database for mobile, embedded  and small to medium sized
> business environments for free!
>
> http://www.ianywhere.com/promos/deved/index.html
>
> **********************************************************
> *******************
>
> iAnywhere Solutions  http://www.iAnywhere.com
>
> ** Please only post to the newsgroup
>
> ** Whitepapers can be found at
> http://www.iAnywhere.com/developer ** EBFs can be found at
> http://downloads.sybase.com/swx/sdmain.stm ** Use Case
> Express to report bugs http://case-express.sybase.com
>
> **********************************************************
> *******************
0
ghkumartklm
2/1/2007 11:16:30 AM
You will get a resultset that is ordered by batch_id in ascending order. 
  You can navigate that resultset in the same way that you navigate the 
resultset where the primary key is an integer.

ghkumartklm@yahoo.com wrote:
> If I use select * from prod_details order by batch_id ASC,
> shall i get the result ?
>> ORDER BY is the only method offered in ANSI SQL to control
>> the ordering  of the resultset. In the absence of ORDER BY
>> , the resultset can be  returned in any order that the
>> engine chooses. Changes in the optimizer  in recent
>> versions of SQL Anywhere make the resultset even less
>> deterministic.
>>
>> If your are not using ORDER BY when your primary key is
>> integer, it is  only by happen chance that you are getting
>> consistent resultset  ordering. You should not rely on
>> that resultset ordering will be  maintained.
>>
>> ghkumartklm@yahoo.com wrote:
>>> I have a SQL Anywhere 7.0 Database, have  a  table
>>> Product_detail  which contains
>>> Column Name  Datatype      width          Null
>>> Default
>>> batch_id     char(10)                      No
>>> None prod_id     Integer                        No
>>>   None employee_id Integer                        No
>>>     None quantity   Integer                         No
>>>       None price      Numeric      (14, 2)            No
>>>          None
>>> Its primary key is   batch_id
>>> I have a Freeform   Datawindow with this table
>>> I want to provide the first row, next row, prior row and
>>> last row
>>> How to get the first , next, prior and last row record
>>> from the above tabl
>>> If the primar key datatype is integer, I know how to get
>>> first, next, prior and last row. But here
>>> Primary column datatype is char(10)
>>> Any idea?
>> --
>>
>> Chris Keating
>> Sybase Adaptive Server Anywhere Professional Version 8
>>
>> **********************************************************
>> *******************
>>
>> Sign up today for your copy of the SQL Anywhere Studio 9
>> Developer  Edition =and try out the market-leading
>> database for mobile, embedded  and small to medium sized
>> business environments for free!
>>
>> http://www.ianywhere.com/promos/deved/index.html
>>
>> **********************************************************
>> *******************
>>
>> iAnywhere Solutions  http://www.iAnywhere.com
>>
>> ** Please only post to the newsgroup
>>
>> ** Whitepapers can be found at
>> http://www.iAnywhere.com/developer ** EBFs can be found at
>> http://downloads.sybase.com/swx/sdmain.stm ** Use Case
>> Express to report bugs http://case-express.sybase.com
>>
>> **********************************************************
>> *******************

-- 

Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8

*****************************************************************************

Sign up today for your copy of the SQL Anywhere Studio 9 Developer 
Edition =and try out the market-leading database for mobile, embedded 
and small to medium sized business environments for free!

http://www.ianywhere.com/promos/deved/index.html

*****************************************************************************

iAnywhere Solutions  http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use Case Express to report bugs http://case-express.sybase.com

*****************************************************************************
0
Chris
2/1/2007 12:24:41 PM
Hi Chris,

The OP's Batch_id is char(10), so order by Batch_id can be tricky.
Of the lenght of every value in this field is not equal, this could result
to mistakes.

eg.: Batch_id's "1","2","3","10","20" ordered would give this result:
"1","10","2","20","3"

The only soultion then would be filling up these values with "0",
so the order become "01","02","03","10","20".

Cheers,
Pascal B.


"Chris Keating(iAnywhere Solutions)"
<NoSpamPlease_k_e_a_t_i_n_g@i_A_n_y_w_h_e_r_e.com> wrote in message
news:45c1ea19$1@forums-1-dub...
> You will get a resultset that is ordered by batch_id in ascending order.
>   You can navigate that resultset in the same way that you navigate the
> resultset where the primary key is an integer.
>
> ghkumartklm@yahoo.com wrote:
> > If I use select * from prod_details order by batch_id ASC,
> > shall i get the result ?
> >> ORDER BY is the only method offered in ANSI SQL to control
> >> the ordering  of the resultset. In the absence of ORDER BY
> >> , the resultset can be  returned in any order that the
> >> engine chooses. Changes in the optimizer  in recent
> >> versions of SQL Anywhere make the resultset even less
> >> deterministic.
> >>
> >> If your are not using ORDER BY when your primary key is
> >> integer, it is  only by happen chance that you are getting
> >> consistent resultset  ordering. You should not rely on
> >> that resultset ordering will be  maintained.
> >>
> >> ghkumartklm@yahoo.com wrote:
> >>> I have a SQL Anywhere 7.0 Database, have  a  table
> >>> Product_detail  which contains
> >>> Column Name  Datatype      width          Null
> >>> Default
> >>> batch_id     char(10)                      No
> >>> None prod_id     Integer                        No
> >>>   None employee_id Integer                        No
> >>>     None quantity   Integer                         No
> >>>       None price      Numeric      (14, 2)            No
> >>>          None
> >>> Its primary key is   batch_id
> >>> I have a Freeform   Datawindow with this table
> >>> I want to provide the first row, next row, prior row and
> >>> last row
> >>> How to get the first , next, prior and last row record
> >>> from the above tabl
> >>> If the primar key datatype is integer, I know how to get
> >>> first, next, prior and last row. But here
> >>> Primary column datatype is char(10)
> >>> Any idea?
> >> --
> >>
> >> Chris Keating
> >> Sybase Adaptive Server Anywhere Professional Version 8
> >>
> >> **********************************************************
> >> *******************
> >>
> >> Sign up today for your copy of the SQL Anywhere Studio 9
> >> Developer  Edition =and try out the market-leading
> >> database for mobile, embedded  and small to medium sized
> >> business environments for free!
> >>
> >> http://www.ianywhere.com/promos/deved/index.html
> >>
> >> **********************************************************
> >> *******************
> >>
> >> iAnywhere Solutions  http://www.iAnywhere.com
> >>
> >> ** Please only post to the newsgroup
> >>
> >> ** Whitepapers can be found at
> >> http://www.iAnywhere.com/developer ** EBFs can be found at
> >> http://downloads.sybase.com/swx/sdmain.stm ** Use Case
> >> Express to report bugs http://case-express.sybase.com
> >>
> >> **********************************************************
> >> *******************
>
> -- 
>
> Chris Keating
> Sybase Adaptive Server Anywhere Professional Version 8
>
>
****************************************************************************
*
>
> Sign up today for your copy of the SQL Anywhere Studio 9 Developer
> Edition =and try out the market-leading database for mobile, embedded
> and small to medium sized business environments for free!
>
> http://www.ianywhere.com/promos/deved/index.html
>
>
****************************************************************************
*
>
> iAnywhere Solutions  http://www.iAnywhere.com
>
> ** Please only post to the newsgroup
>
> ** Whitepapers can be found at http://www.iAnywhere.com/developer
> ** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
> ** Use Case Express to report bugs http://case-express.sybase.com
>
>
****************************************************************************
*


0
PascalB
2/2/2007 6:57:26 AM
Hi guys,

Pardon me if I'm mistaken. But based on the initial
question, I believe that what he wanted was to have the
users traverse the records through a freeform DATAWINDOW
(one record) and how he could do it. If this is just what he
wanted, then dw.ScrollToRow(), dw.ScrollPriorRow() and
dw.ScrollNextRow() is all that he needs to use.

Sort order is a different topic that can easily be solved
via ORDER BY in his SQL or by his Sort Order in the
Datawindow.

Arman

> Hi Chris,
>
> The OP's Batch_id is char(10), so order by Batch_id can be
> tricky. Of the lenght of every value in this field is not
> equal, this could result to mistakes.
>
> eg.: Batch_id's "1","2","3","10","20" ordered would give
> this result: "1","10","2","20","3"
>
> The only soultion then would be filling up these values
> with "0", so the order become "01","02","03","10","20".
>
> Cheers,
> Pascal B.
>
>
> "Chris Keating(iAnywhere Solutions)"
> <NoSpamPlease_k_e_a_t_i_n_g@i_A_n_y_w_h_e_r_e.com> wrote
> in message news:45c1ea19$1@forums-1-dub...
> > You will get a resultset that is ordered by batch_id in
> >   ascending order. You can navigate that resultset in
> > the same way that you navigate the resultset where the
> primary key is an integer. >
> > ghkumartklm@yahoo.com wrote:
> > > If I use select * from prod_details order by batch_id
> > > ASC, shall i get the result ?
> > >> ORDER BY is the only method offered in ANSI SQL to
> > control >> the ordering  of the resultset. In the
> > absence of ORDER BY >> , the resultset can be  returned
> > in any order that the >> engine chooses. Changes in the
> > optimizer  in recent >> versions of SQL Anywhere make
> > the resultset even less >> deterministic.
> > >>
> > >> If your are not using ORDER BY when your primary key
> > is >> integer, it is  only by happen chance that you are
> > getting >> consistent resultset  ordering. You should
> > not rely on >> that resultset ordering will be
> > maintained. >>
> > >> ghkumartklm@yahoo.com wrote:
> > >>> I have a SQL Anywhere 7.0 Database, have  a  table
> > >>> Product_detail  which contains
> > >>> Column Name  Datatype      width          Null
> > >>> Default
> > >>> batch_id     char(10)                      No
> > >>> None prod_id     Integer                        No
> > >>>   None employee_id Integer                        No
> > >>>     None quantity   Integer
> > No >>>       None price      Numeric      (14, 2)
> >     No >>>          None
> > >>> Its primary key is   batch_id
> > >>> I have a Freeform   Datawindow with this table
> > >>> I want to provide the first row, next row, prior row
> > and >>> last row
> > >>> How to get the first , next, prior and last row
> > record >>> from the above tabl
> > >>> If the primar key datatype is integer, I know how to
> > get >>> first, next, prior and last row. But here
> > >>> Primary column datatype is char(10)
> > >>> Any idea?
> > >> --
> > >>
> > >> Chris Keating
> > >> Sybase Adaptive Server Anywhere Professional Version
> > 8 >>
> > >>
> >
> **********************************************************
> > >> ******************* >>
> > >> Sign up today for your copy of the SQL Anywhere
> > Studio 9 >> Developer  Edition =and try out the
> > market-leading >> database for mobile, embedded  and
> > small to medium sized >> business environments for free!
> > >>
> > >> http://www.ianywhere.com/promos/deved/index.html
> > >>
> > >>
> >
> **********************************************************
> > >> ******************* >>
> > >> iAnywhere Solutions  http://www.iAnywhere.com
> > >>
> > >> ** Please only post to the newsgroup
> > >>
> > >> ** Whitepapers can be found at
> > >> http://www.iAnywhere.com/developer ** EBFs can be
> > found at >> http://downloads.sybase.com/swx/sdmain.stm
> > ** Use Case >> Express to report bugs
> > http://case-express.sybase.com >>
> > >>
> >
> **********************************************************
> >> ******************* >
> > --
> >
> > Chris Keating
> > Sybase Adaptive Server Anywhere Professional Version 8
> >
> >
> **********************************************************
> ****************** *
> >
> > Sign up today for your copy of the SQL Anywhere Studio 9
> > Developer Edition =and try out the market-leading
> > database for mobile, embedded and small to medium sized
> business environments for free! >
> > http://www.ianywhere.com/promos/deved/index.html
> >
> >
> **********************************************************
> ****************** *
> >
> > iAnywhere Solutions  http://www.iAnywhere.com
> >
> > ** Please only post to the newsgroup
> >
> > ** Whitepapers can be found at
> > http://www.iAnywhere.com/developer ** EBFs can be found
> > at http://downloads.sybase.com/swx/sdmain.stm ** Use
> Case Express to report bugs http://case-express.sybase.com
> > >
> **********************************************************
> ****************** *
>
>
0
ArmanPorky
2/2/2007 7:22:37 AM
The initial question also indicated that he had this working already 
with integer.

As Pascal correctly picked up, the issue is likely that the batch_id is 
storing the text equivalent of a number i.e., '1','2', '20', '30' and 
not 1,2,20,30. The sort rules for characters do not following the sort 
rules for numbers. As a result, storing numbers in a character field is 
fine provided sorting is not a requirement. If sorting is required, you 
must account for requirement either by padding values or other means 
(depending on the exact nature of the data).

ArmanPorky wrote:
> Hi guys,
> 
> Pardon me if I'm mistaken. But based on the initial
> question, I believe that what he wanted was to have the
> users traverse the records through a freeform DATAWINDOW
> (one record) and how he could do it. If this is just what he
> wanted, then dw.ScrollToRow(), dw.ScrollPriorRow() and
> dw.ScrollNextRow() is all that he needs to use.
> 
> Sort order is a different topic that can easily be solved
> via ORDER BY in his SQL or by his Sort Order in the
> Datawindow.
> 
> Arman
> 
>> Hi Chris,
>>
>> The OP's Batch_id is char(10), so order by Batch_id can be
>> tricky. Of the lenght of every value in this field is not
>> equal, this could result to mistakes.
>>
>> eg.: Batch_id's "1","2","3","10","20" ordered would give
>> this result: "1","10","2","20","3"
>>
>> The only soultion then would be filling up these values
>> with "0", so the order become "01","02","03","10","20".
>>
>> Cheers,
>> Pascal B.
>>
>>
>> "Chris Keating(iAnywhere Solutions)"
>> <NoSpamPlease_k_e_a_t_i_n_g@i_A_n_y_w_h_e_r_e.com> wrote
>> in message news:45c1ea19$1@forums-1-dub...
>>> You will get a resultset that is ordered by batch_id in
>>>   ascending order. You can navigate that resultset in
>>> the same way that you navigate the resultset where the
>> primary key is an integer. >
>>> ghkumartklm@yahoo.com wrote:
>>>> If I use select * from prod_details order by batch_id
>>>> ASC, shall i get the result ?
>>>>> ORDER BY is the only method offered in ANSI SQL to
>>> control >> the ordering  of the resultset. In the
>>> absence of ORDER BY >> , the resultset can be  returned
>>> in any order that the >> engine chooses. Changes in the
>>> optimizer  in recent >> versions of SQL Anywhere make
>>> the resultset even less >> deterministic.
>>>>> If your are not using ORDER BY when your primary key
>>> is >> integer, it is  only by happen chance that you are
>>> getting >> consistent resultset  ordering. You should
>>> not rely on >> that resultset ordering will be
>>> maintained. >>
>>>>> ghkumartklm@yahoo.com wrote:
>>>>>> I have a SQL Anywhere 7.0 Database, have  a  table
>>>>>> Product_detail  which contains
>>>>>> Column Name  Datatype      width          Null
>>>>>> Default
>>>>>> batch_id     char(10)                      No
>>>>>> None prod_id     Integer                        No
>>>>>>   None employee_id Integer                        No
>>>>>>     None quantity   Integer
>>> No >>>       None price      Numeric      (14, 2)
>>>     No >>>          None
>>>>>> Its primary key is   batch_id
>>>>>> I have a Freeform   Datawindow with this table
>>>>>> I want to provide the first row, next row, prior row
>>> and >>> last row
>>>>>> How to get the first , next, prior and last row
>>> record >>> from the above tabl
>>>>>> If the primar key datatype is integer, I know how to
>>> get >>> first, next, prior and last row. But here
>>>>>> Primary column datatype is char(10)
>>>>>> Any idea?
>>>>> --
>>>>>
>>>>> Chris Keating
>>>>> Sybase Adaptive Server Anywhere Professional Version
>>> 8 >>
>> **********************************************************
>>>>> ******************* >>
>>>>> Sign up today for your copy of the SQL Anywhere
>>> Studio 9 >> Developer  Edition =and try out the
>>> market-leading >> database for mobile, embedded  and
>>> small to medium sized >> business environments for free!
>>>>> http://www.ianywhere.com/promos/deved/index.html
>>>>>
>>>>>
>> **********************************************************
>>>>> ******************* >>
>>>>> iAnywhere Solutions  http://www.iAnywhere.com
>>>>>
>>>>> ** Please only post to the newsgroup
>>>>>
>>>>> ** Whitepapers can be found at
>>>>> http://www.iAnywhere.com/developer ** EBFs can be
>>> found at >> http://downloads.sybase.com/swx/sdmain.stm
>>> ** Use Case >> Express to report bugs
>>> http://case-express.sybase.com >>
>> **********************************************************
>>>> ******************* >
>>> --
>>>
>>> Chris Keating
>>> Sybase Adaptive Server Anywhere Professional Version 8
>>>
>>>
>> **********************************************************
>> ****************** *
>>> Sign up today for your copy of the SQL Anywhere Studio 9
>>> Developer Edition =and try out the market-leading
>>> database for mobile, embedded and small to medium sized
>> business environments for free! >
>>> http://www.ianywhere.com/promos/deved/index.html
>>>
>>>
>> **********************************************************
>> ****************** *
>>> iAnywhere Solutions  http://www.iAnywhere.com
>>>
>>> ** Please only post to the newsgroup
>>>
>>> ** Whitepapers can be found at
>>> http://www.iAnywhere.com/developer ** EBFs can be found
>>> at http://downloads.sybase.com/swx/sdmain.stm ** Use
>> Case Express to report bugs http://case-express.sybase.com
>> **********************************************************
>> ****************** *
>>
>>

-- 

Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8

*****************************************************************************

Sign up today for your copy of the SQL Anywhere Studio 9 Developer 
Edition =and try out the market-leading database for mobile, embedded 
and small to medium sized business environments for free!

http://www.ianywhere.com/promos/deved/index.html

*****************************************************************************

iAnywhere Solutions  http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use Case Express to report bugs http://case-express.sybase.com

*****************************************************************************
0
Chris
2/2/2007 12:43:36 PM
For the integer datatype , i used Count(*) function to find
the highest value and decrease 1 to get prior record , but
for batch_id datatype is char(10).its values are DD5060,
SP100, 150 like this. It varies and not in a specific order.
I want to display the first record, prior record, next
record and last record using menue or buttons in a freeform
datawindow . Order by clause is not applied because the
freeform datawindow's retrieval argument is :batchid
Any idea?

> The initial question also indicated that he had this
> working already  with integer.
>
> As Pascal correctly picked up, the issue is likely that
> the batch_id is  storing the text equivalent of a number
> i.e., '1','2', '20', '30' and  not 1,2,20,30. The sort
> rules for characters do not following the sort  rules for
> numbers. As a result, storing numbers in a character field
> is  fine provided sorting is not a requirement. If sorting
> is required, you  must account for requirement either by
> padding values or other means  (depending on the exact
> nature of the data).
>
> ArmanPorky wrote:
> > Hi guys,
> >
> > Pardon me if I'm mistaken. But based on the initial
> > question, I believe that what he wanted was to have the
> > users traverse the records through a freeform DATAWINDOW
> > (one record) and how he could do it. If this is just
> > what he wanted, then dw.ScrollToRow(),
> > dw.ScrollPriorRow() and dw.ScrollNextRow() is all that
> > he needs to use.
> > Sort order is a different topic that can easily be
> > solved via ORDER BY in his SQL or by his Sort Order in
> > the Datawindow.
> >
> > Arman
> >
> >> Hi Chris,
> >>
> >> The OP's Batch_id is char(10), so order by Batch_id can
> be >> tricky. Of the lenght of every value in this field
> is not >> equal, this could result to mistakes.
> >>
> >> eg.: Batch_id's "1","2","3","10","20" ordered would
> give >> this result: "1","10","2","20","3"
> >>
> >> The only soultion then would be filling up these values
> >> with "0", so the order become "01","02","03","10","20".
> >>
> >> Cheers,
> >> Pascal B.
> >>
> >>
> >> "Chris Keating(iAnywhere Solutions)"
> >> <NoSpamPlease_k_e_a_t_i_n_g@i_A_n_y_w_h_e_r_e.com>
> wrote >> in message news:45c1ea19$1@forums-1-dub...
> >>> You will get a resultset that is ordered by batch_id
> in >>>   ascending order. You can navigate that resultset
> in >>> the same way that you navigate the resultset where
> the >> primary key is an integer. >
> >>> ghkumartklm@yahoo.com wrote:
> >>>> If I use select * from prod_details order by batch_id
> >>>> ASC, shall i get the result ?
> >>>>> ORDER BY is the only method offered in ANSI SQL to
> >>> control >> the ordering  of the resultset. In the
> >>> absence of ORDER BY >> , the resultset can be
> returned >>> in any order that the >> engine chooses.
> Changes in the >>> optimizer  in recent >> versions of SQL
> Anywhere make >>> the resultset even less >>
> deterministic. >>>>> If your are not using ORDER BY when
> your primary key >>> is >> integer, it is  only by happen
> chance that you are >>> getting >> consistent resultset
> ordering. You should >>> not rely on >> that resultset
> ordering will be >>> maintained. >>
> >>>>> ghkumartklm@yahoo.com wrote:
> >>>>>> I have a SQL Anywhere 7.0 Database, have  a  table
> >>>>>> Product_detail  which contains
> >>>>>> Column Name  Datatype      width          Null
> >>>>>> Default
> >>>>>> batch_id     char(10)                      No
> >>>>>> None prod_id     Integer                        No
> >>>>>>   None employee_id Integer
> No >>>>>>     None quantity   Integer
> >>> No >>>       None price      Numeric      (14, 2)
> >>>     No >>>          None
> >>>>>> Its primary key is   batch_id
> >>>>>> I have a Freeform   Datawindow with this table
> >>>>>> I want to provide the first row, next row, prior
> row >>> and >>> last row
> >>>>>> How to get the first , next, prior and last row
> >>> record >>> from the above tabl
> >>>>>> If the primar key datatype is integer, I know how
> to >>> get >>> first, next, prior and last row. But here
> >>>>>> Primary column datatype is char(10)
> >>>>>> Any idea?
> >>>>> --
> >>>>>
> >>>>> Chris Keating
> >>>>> Sybase Adaptive Server Anywhere Professional Version
> >>> 8 >>
> >>
> **********************************************************
> >>>>> ******************* >> >>>>> Sign up today for your
> copy of the SQL Anywhere >>> Studio 9 >> Developer
> Edition =and try out the >>> market-leading >> database
> for mobile, embedded  and >>> small to medium sized >>
> business environments for free! >>>>>
> http://www.ianywhere.com/promos/deved/index.html >>>>>
> >>>>>
> >>
> **********************************************************
> >>>>> ******************* >> >>>>> iAnywhere Solutions
> http://www.iAnywhere.com >>>>>
> >>>>> ** Please only post to the newsgroup
> >>>>>
> >>>>> ** Whitepapers can be found at
> >>>>> http://www.iAnywhere.com/developer ** EBFs can be
> >>> found at >> http://downloads.sybase.com/swx/sdmain.stm
> >>> ** Use Case >> Express to report bugs
> >>> http://case-express.sybase.com >>
> >>
> **********************************************************
> >>>> ******************* > >>> --
> >>>
> >>> Chris Keating
> >>> Sybase Adaptive Server Anywhere Professional Version 8
> >>>
> >>>
> >>
> **********************************************************
> >> ****************** * >>> Sign up today for your copy of
> the SQL Anywhere Studio 9 >>> Developer Edition =and try
> out the market-leading >>> database for mobile, embedded
> and small to medium sized >> business environments for
> free! > >>>
> http://www.ianywhere.com/promos/deved/index.html >>>
> >>>
> >>
> **********************************************************
> >> ****************** * >>> iAnywhere Solutions
> http://www.iAnywhere.com >>>
> >>> ** Please only post to the newsgroup
> >>>
> >>> ** Whitepapers can be found at
> >>> http://www.iAnywhere.com/developer ** EBFs can be
> found >>> at http://downloads.sybase.com/swx/sdmain.stm **
> Use >> Case Express to report bugs
> http://case-express.sybase.com >>
> **********************************************************
> >> ****************** * >>
> >>
>
> --
>
> Chris Keating
> Sybase Adaptive Server Anywhere Professional Version 8
>
> **********************************************************
> *******************
>
> Sign up today for your copy of the SQL Anywhere Studio 9
> Developer  Edition =and try out the market-leading
> database for mobile, embedded  and small to medium sized
> business environments for free!
>
> http://www.ianywhere.com/promos/deved/index.html
>
> **********************************************************
> *******************
>
> iAnywhere Solutions  http://www.iAnywhere.com
>
> ** Please only post to the newsgroup
>
> ** Whitepapers can be found at
> http://www.iAnywhere.com/developer ** EBFs can be found at
> http://downloads.sybase.com/swx/sdmain.stm ** Use Case
> Express to report bugs http://case-express.sybase.com
>
> **********************************************************
> *******************
0
ghkumartklm
2/3/2007 12:12:30 PM
Hi,

This is such a tedious task, retrieving one row only and
providing First, Next, Prior and Last Row Navigation.
Commonly, this is used for multi-row retrieves, but on your
case its not. Are you expecting a very large resultset? If
you are and your intention is to retrieve only one row, you
have different options I could think of:

1) Have a datastore that retrieves all of the batch ids
only. This is then your basis for navigation and retrieving
the actual batch id details (in the freeform).

2) You can do the following:
  - Initially, retrieve the first and last batch id, using
Min (batch_id) and Max (batch_id) in your SELECT. Store this
in an instance variable. This will be your basis for
retrieving the First and Last Rows.
  - You should also have another instance variable that will
hold the current batch_id.
  - For Next Row, base on the current batch_id, issue
    SELECT Min (batch_id)
      INTO :ls_next_id
      FROM <yourtable>
      WHERE batch_id > :is_batch_id
  - For Previous Row, base on the current batch_id, issue
    SELECT Max (batch_id)
      INTO :ls_prev_id
      FROM <yourtable>
      WHERE batch_id < :is_batch_id

  * is_batch_id is the instance variable that holds your
current row, you must assign the batch id of the current
displayed row to this variable.

  * #2 will do a table scan every time if batch_id is not
contained on any index (primary key or regular index).



> For the integer datatype , i used Count(*) function to
> find the highest value and decrease 1 to get prior record
> , but for batch_id datatype is char(10).its values are
> DD5060, SP100, 150 like this. It varies and not in a
> specific order. I want to display the first record, prior
> record, next record and last record using menue or buttons
> in a freeform datawindow . Order by clause is not applied
> because the freeform datawindow's retrieval argument is
> :batchid Any idea?
>
> > The initial question also indicated that he had this
> > working already  with integer.
> >
> > As Pascal correctly picked up, the issue is likely that
> > the batch_id is  storing the text equivalent of a number
> > i.e., '1','2', '20', '30' and  not 1,2,20,30. The sort
> > rules for characters do not following the sort  rules
> > for numbers. As a result, storing numbers in a character
> > field is  fine provided sorting is not a requirement. If
> > sorting is required, you  must account for requirement
> > either by padding values or other means  (depending on
> > the exact nature of the data).
> >
> > ArmanPorky wrote:
> > > Hi guys,
> > >
> > > Pardon me if I'm mistaken. But based on the initial
> > > question, I believe that what he wanted was to have
> > > the users traverse the records through a freeform
> > > DATAWINDOW (one record) and how he could do it. If
> > > this is just what he wanted, then dw.ScrollToRow(),
> > > dw.ScrollPriorRow() and dw.ScrollNextRow() is all that
> > > he needs to use.
> > > Sort order is a different topic that can easily be
> > > solved via ORDER BY in his SQL or by his Sort Order in
> > > the Datawindow.
> > >
> > > Arman
> > >
> > >> Hi Chris,
> > >>
> > >> The OP's Batch_id is char(10), so order by Batch_id
> > can be >> tricky. Of the lenght of every value in this
> > field is not >> equal, this could result to mistakes.
> > >>
> > >> eg.: Batch_id's "1","2","3","10","20" ordered would
> > give >> this result: "1","10","2","20","3"
> > >>
> > >> The only soultion then would be filling up these
> > values >> with "0", so the order become "01","02","03"
> > ,"10","20". >>
> > >> Cheers,
> > >> Pascal B.
> > >>
> > >>
> > >> "Chris Keating(iAnywhere Solutions)"
> > >> <NoSpamPlease_k_e_a_t_i_n_g@i_A_n_y_w_h_e_r_e.com>
> > wrote >> in message news:45c1ea19$1@forums-1-dub...
> > >>> You will get a resultset that is ordered by batch_id
> > in >>>   ascending order. You can navigate that
> > resultset in >>> the same way that you navigate the
> > resultset where the >> primary key is an integer. >
> > >>> ghkumartklm@yahoo.com wrote:
> > >>>> If I use select * from prod_details order by
> > batch_id >>>> ASC, shall i get the result ?
> > >>>>> ORDER BY is the only method offered in ANSI SQL to
> > >>> control >> the ordering  of the resultset. In the
> > >>> absence of ORDER BY >> , the resultset can be
> > returned >>> in any order that the >> engine chooses.
> > Changes in the >>> optimizer  in recent >> versions of
> > SQL Anywhere make >>> the resultset even less >>
> > deterministic. >>>>> If your are not using ORDER BY when
> > your primary key >>> is >> integer, it is  only by
> > happen chance that you are >>> getting >> consistent
> > resultset ordering. You should >>> not rely on >> that
> > resultset ordering will be >>> maintained. >>
> > >>>>> ghkumartklm@yahoo.com wrote:
> > >>>>>> I have a SQL Anywhere 7.0 Database, have  a
> > table >>>>>> Product_detail  which contains
> > >>>>>> Column Name  Datatype      width          Null
> > >>>>>> Default
> > >>>>>> batch_id     char(10)                      No
> > >>>>>> None prod_id     Integer
> > No >>>>>>   None employee_id Integer
> > No >>>>>>     None quantity   Integer
> > >>> No >>>       None price      Numeric      (14, 2)
> > >>>     No >>>          None
> > >>>>>> Its primary key is   batch_id
> > >>>>>> I have a Freeform   Datawindow with this table
> > >>>>>> I want to provide the first row, next row, prior
> > row >>> and >>> last row
> > >>>>>> How to get the first , next, prior and last row
> > >>> record >>> from the above tabl
> > >>>>>> If the primar key datatype is integer, I know how
> > to >>> get >>> first, next, prior and last row. But here
> > >>>>>> Primary column datatype is char(10)
> > >>>>>> Any idea?
> > >>>>> --
> > >>>>>
> > >>>>> Chris Keating
> > >>>>> Sybase Adaptive Server Anywhere Professional
> > Version >>> 8 >>
> > >>
> >
> >
> **********************************************************
> > >>>>> ******************* >> >>>>> Sign up today for
> > your copy of the SQL Anywhere >>> Studio 9 >> Developer
> > Edition =and try out the >>> market-leading >> database
> > for mobile, embedded  and >>> small to medium sized >>
> > business environments for free! >>>>>
> > http://www.ianywhere.com/promos/deved/index.html >>>>>
> > >>>>> >>
> >
> >
> **********************************************************
> > >>>>> ******************* >> >>>>> iAnywhere Solutions
> > http://www.iAnywhere.com >>>>> >>>>> ** Please only post
> > to the newsgroup >>>>>
> > >>>>> ** Whitepapers can be found at
> > >>>>> http://www.iAnywhere.com/developer ** EBFs can be
> > >>> found at >>
> > http://downloads.sybase.com/swx/sdmain.stm >>> ** Use
> > Case >> Express to report bugs >>>
> > http://case-express.sybase.com >> >>
> >
> >
> **********************************************************
> > >>>> ******************* > >>> -- >>>
> > >>> Chris Keating
> > >>> Sybase Adaptive Server Anywhere Professional Version
> > 8 >>>
> > >>>
> > >>
> >
> >
> **********************************************************
> > >> ****************** * >>> Sign up today for your copy
> of the SQL Anywhere Studio 9 >>> Developer Edition =and
> > try out the market-leading >>> database for mobile,
> > embedded and small to medium sized >> business
> > environments for free! > >>>
> > http://www.ianywhere.com/promos/deved/index.html >>>
> > >>>
> > >>
> >
> >
> **********************************************************
> > >> ****************** * >>> iAnywhere Solutions
> > http://www.iAnywhere.com >>> >>> ** Please only post to
> > the newsgroup >>>
> > >>> ** Whitepapers can be found at
> > >>> http://www.iAnywhere.com/developer ** EBFs can be
> > found >>> at http://downloads.sybase.com/swx/sdmain.stm
> > ** Use >> Case Express to report bugs
> > http://case-express.sybase.com >>
> >
> >
> **********************************************************
> > >> ****************** * >> >>
> >
> > --
> >
> > Chris Keating
> > Sybase Adaptive Server Anywhere Professional Version 8
> >
> >
> >
> **********************************************************
> ******************* >
> > Sign up today for your copy of the SQL Anywhere Studio 9
> > Developer  Edition =and try out the market-leading
> > database for mobile, embedded  and small to medium sized
> > business environments for free!
> >
> > http://www.ianywhere.com/promos/deved/index.html
> >
> >
> >
> **********************************************************
> ******************* >
> > iAnywhere Solutions  http://www.iAnywhere.com
> >
> > ** Please only post to the newsgroup
> >
> > ** Whitepapers can be found at
> > http://www.iAnywhere.com/developer ** EBFs can be found
> > at http://downloads.sybase.com/swx/sdmain.stm ** Use
> > Case Express to report bugs
> http://case-express.sybase.com >
> >
> >
> **********************************************************
> *******************
0
ArmanPorky
2/5/2007 2:15:09 AM
What you want is more recent SQL Anywhere software that supports the 
following

	SELECT TOP n START AT x



If you *must* access the rows this way, consider
1) using a CURSOR

--or--

2) retrieve into a datastore (with the dwo using Rows as Needed) the 
resultset and navigate the ds.

--or--

3)ASA7 also has NUMBER(*) that you can use for row numbered. I am 
reluctant to recommend its use as there are changes made in current SQL 
Anywhere versions that affect its use. You can use number(*) to impart a 
row ordering value in the resultset.



ghkumartklm@yahoo.com wrote:
> For the integer datatype , i used Count(*) function to find
> the highest value and decrease 1 to get prior record , but
> for batch_id datatype is char(10).its values are DD5060,
> SP100, 150 like this. It varies and not in a specific order.
> I want to display the first record, prior record, next
> record and last record using menue or buttons in a freeform
> datawindow . Order by clause is not applied because the
> freeform datawindow's retrieval argument is :batchid
> Any idea?
> 
>> The initial question also indicated that he had this
>> working already  with integer.
>>
>> As Pascal correctly picked up, the issue is likely that
>> the batch_id is  storing the text equivalent of a number
>> i.e., '1','2', '20', '30' and  not 1,2,20,30. The sort
>> rules for characters do not following the sort  rules for
>> numbers. As a result, storing numbers in a character field
>> is  fine provided sorting is not a requirement. If sorting
>> is required, you  must account for requirement either by
>> padding values or other means  (depending on the exact
>> nature of the data).
>>
>> ArmanPorky wrote:
>>> Hi guys,
>>>
>>> Pardon me if I'm mistaken. But based on the initial
>>> question, I believe that what he wanted was to have the
>>> users traverse the records through a freeform DATAWINDOW
>>> (one record) and how he could do it. If this is just
>>> what he wanted, then dw.ScrollToRow(),
>>> dw.ScrollPriorRow() and dw.ScrollNextRow() is all that
>>> he needs to use.
>>> Sort order is a different topic that can easily be
>>> solved via ORDER BY in his SQL or by his Sort Order in
>>> the Datawindow.
>>>
>>> Arman
>>>
>>>> Hi Chris,
>>>>
>>>> The OP's Batch_id is char(10), so order by Batch_id can
>> be >> tricky. Of the lenght of every value in this field
>> is not >> equal, this could result to mistakes.
>>>> eg.: Batch_id's "1","2","3","10","20" ordered would
>> give >> this result: "1","10","2","20","3"
>>>> The only soultion then would be filling up these values
>>>> with "0", so the order become "01","02","03","10","20".
>>>>
>>>> Cheers,
>>>> Pascal B.
>>>>
>>>>
>>>> "Chris Keating(iAnywhere Solutions)"
>>>> <NoSpamPlease_k_e_a_t_i_n_g@i_A_n_y_w_h_e_r_e.com>
>> wrote >> in message news:45c1ea19$1@forums-1-dub...
>>>>> You will get a resultset that is ordered by batch_id
>> in >>>   ascending order. You can navigate that resultset
>> in >>> the same way that you navigate the resultset where
>> the >> primary key is an integer. >
>>>>> ghkumartklm@yahoo.com wrote:
>>>>>> If I use select * from prod_details order by batch_id
>>>>>> ASC, shall i get the result ?
>>>>>>> ORDER BY is the only method offered in ANSI SQL to
>>>>> control >> the ordering  of the resultset. In the
>>>>> absence of ORDER BY >> , the resultset can be
>> returned >>> in any order that the >> engine chooses.
>> Changes in the >>> optimizer  in recent >> versions of SQL
>> Anywhere make >>> the resultset even less >>
>> deterministic. >>>>> If your are not using ORDER BY when
>> your primary key >>> is >> integer, it is  only by happen
>> chance that you are >>> getting >> consistent resultset
>> ordering. You should >>> not rely on >> that resultset
>> ordering will be >>> maintained. >>
>>>>>>> ghkumartklm@yahoo.com wrote:
>>>>>>>> I have a SQL Anywhere 7.0 Database, have  a  table
>>>>>>>> Product_detail  which contains
>>>>>>>> Column Name  Datatype      width          Null
>>>>>>>> Default
>>>>>>>> batch_id     char(10)                      No
>>>>>>>> None prod_id     Integer                        No
>>>>>>>>   None employee_id Integer
>> No >>>>>>     None quantity   Integer
>>>>> No >>>       None price      Numeric      (14, 2)
>>>>>     No >>>          None
>>>>>>>> Its primary key is   batch_id
>>>>>>>> I have a Freeform   Datawindow with this table
>>>>>>>> I want to provide the first row, next row, prior
>> row >>> and >>> last row
>>>>>>>> How to get the first , next, prior and last row
>>>>> record >>> from the above tabl
>>>>>>>> If the primar key datatype is integer, I know how
>> to >>> get >>> first, next, prior and last row. But here
>>>>>>>> Primary column datatype is char(10)
>>>>>>>> Any idea?
>>>>>>> --
>>>>>>>
>>>>>>> Chris Keating
>>>>>>> Sybase Adaptive Server Anywhere Professional Version
>>>>> 8 >>
>> **********************************************************
>>>>>>> ******************* >> >>>>> Sign up today for your
>> copy of the SQL Anywhere >>> Studio 9 >> Developer
>> Edition =and try out the >>> market-leading >> database
>> for mobile, embedded  and >>> small to medium sized >>
>> business environments for free! >>>>>
>> http://www.ianywhere.com/promos/deved/index.html >>>>>
>> **********************************************************
>>>>>>> ******************* >> >>>>> iAnywhere Solutions
>> http://www.iAnywhere.com >>>>>
>>>>>>> ** Please only post to the newsgroup
>>>>>>>
>>>>>>> ** Whitepapers can be found at
>>>>>>> http://www.iAnywhere.com/developer ** EBFs can be
>>>>> found at >> http://downloads.sybase.com/swx/sdmain.stm
>>>>> ** Use Case >> Express to report bugs
>>>>> http://case-express.sybase.com >>
>> **********************************************************
>>>>>> ******************* > >>> --
>>>>> Chris Keating
>>>>> Sybase Adaptive Server Anywhere Professional Version 8
>>>>>
>>>>>
>> **********************************************************
>>>> ****************** * >>> Sign up today for your copy of
>> the SQL Anywhere Studio 9 >>> Developer Edition =and try
>> out the market-leading >>> database for mobile, embedded
>> and small to medium sized >> business environments for
>> free! > >>>
>> http://www.ianywhere.com/promos/deved/index.html >>>
>> **********************************************************
>>>> ****************** * >>> iAnywhere Solutions
>> http://www.iAnywhere.com >>>
>>>>> ** Please only post to the newsgroup
>>>>>
>>>>> ** Whitepapers can be found at
>>>>> http://www.iAnywhere.com/developer ** EBFs can be
>> found >>> at http://downloads.sybase.com/swx/sdmain.stm **
>> Use >> Case Express to report bugs
>> http://case-express.sybase.com >>
>> **********************************************************
>>>> ****************** * >>
>>>>
>> --
>>
>> Chris Keating
>> Sybase Adaptive Server Anywhere Professional Version 8
>>
>> **********************************************************
>> *******************
>>
>> Sign up today for your copy of the SQL Anywhere Studio 9
>> Developer  Edition =and try out the market-leading
>> database for mobile, embedded  and small to medium sized
>> business environments for free!
>>
>> http://www.ianywhere.com/promos/deved/index.html
>>
>> **********************************************************
>> *******************
>>
>> iAnywhere Solutions  http://www.iAnywhere.com
>>
>> ** Please only post to the newsgroup
>>
>> ** Whitepapers can be found at
>> http://www.iAnywhere.com/developer ** EBFs can be found at
>> http://downloads.sybase.com/swx/sdmain.stm ** Use Case
>> Express to report bugs http://case-express.sybase.com
>>
>> **********************************************************
>> *******************

-- 

Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8

*****************************************************************************

Sign up today for your copy of the SQL Anywhere Studio 9 Developer 
Edition =and try out the market-leading database for mobile, embedded 
and small to medium sized business environments for free!

http://www.ianywhere.com/promos/deved/index.html

*****************************************************************************

iAnywhere Solutions  http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use Case Express to report bugs http://case-express.sybase.com

*****************************************************************************
0
Chris
2/5/2007 12:37:57 PM
Reply:

Similar Artilces:

Compare the last in one row with the first in the next row
--____QVLZYPRMMGJPQCYPSFRH____ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable In our timecard datawindow, I want to highlight where there are 'gaps'. 1/1/08 08:00 1/1/08 11:00 1/1/08 12:00 1/1/08 05:00 I want the 12:00 to be highlighted because it isn't the same as the second = datetime in the previous row. Can someone help me with some script for this? --____QVLZYPRMMGJPQCYPSFRH____ Content-Type: multipart/related; boundary="____RNQEGPGXMIMQCYOCQRWY____" --____RNQEGPGXMIMQCYOCQRWY____ Content-Type: tex...

I want to select top 3 rows except the first from 4 rows of a Table. It should select from top 2 row,top3 row and top4 row.
 Hi, Let say I've 4 rows in a table. I want to select top 3 rows except the first from 4 rows of a Table. It should select from top 2 row,top3 row and top4 row. Thanks in advance Asghar Ali Mohammed http://www.aliwebdev.com(Web Designer and Developer)Do not forget to "MARK AS ANSWER" on the post that helped you. If you can use Linq, you can use Skip. http://msdn.microsoft.com/en-us/vcsharp/aa336757.aspxThanks, EdMicrosoft MVP - ASP/ASP.NET Hii dear..U can fire the Query select Top(3) from Table1 order by id desc.. "A conclusion is whe...

Select first row or last rows!
Dear experts: i would like to know how to fetch in an select statement the first 20 rows from 2 tables. I want to show first 20 the records from sales,members where sales>4000 thank you... "John Vai" <john_vai[at]hotmail[dot]com> wrote: > i would like to know how to fetch in an select statement the first 20 rows SELECT TOP 20 .... Adding ORDER BY is strongly recommended. Dmitri. This TOP 20 doesn't work for sybase , its works for MySQL and i've already tried it. I am using for the moment set rowcount 20 but there should be ...

How to display data row by row from a View, using First, Previous, Next & Last buttons.
Hello All! I am developing an AJAX-enabled ASP.NET web app that consists of a tab container containing 5 tabs. I am retrieving data from a SQL Server database, putting it into a view and would like to display the data, row by row, in the different controls that are contained in the 5 tabs of my app. To display the data row by row, I am using 4 buttons: First, Previous, Next & Last buttons. I am pretty sure you see what I mean here: to display the last row of the view, for instance, I'll be clicking the Last button, etc. This is the stage where I am having trouble: ev...

adding a blank header row /row above the header row
is it possible to add a blank row above the header row in gridview for adding some links and buttons the links will respond to thae data in the grid and the buttons are for login / regisration etc....  if yes how it can be done or how do i achieve it. Its better that u create a table with a single row with columns matching the GridView columns. Set the table width same as the GridView width. This will make the GridView Look as if there is a row above its header.Please do not forget to click Mark As Answer on the post that helped you. Regards,Iam Srikanth Reddy....

accessing row by row
first of all sorry if i posted this in a wrong place but i'm new to powerbuilder and i have to develop a program quite quickly ( i only worked with acces until now) i have been provided a excel spreadsheet that contains all coloms and rows from all tables wich i have to insert in a database. The difficulty is that i can't use a datapipeline because i need to use a string function to check in wich table i have to put it: TABLENAME_COLUMNNAME -> i thought about using the string function to find out the right column in the right database. however i don't know how you ...

retrieving from row # to row #.
I have over 750 000 rows to retrieve from a table using a datawindow, but my system can only handle approx 30 000 rows and I would like to start from the end of the table. Is it possible to set the row numbers to retrieve? For example, start the retrieve from row 750 000 and stop at row 720 000. There must be a way. thanks, Vern what backend are you using? <Vern> wrote in message news:6BA241541AAD7F2F0063357385256C40.0063358685256C40@webforums... > I have over 750 000 rows to retrieve from a table using a datawindow, but > my system can only handle approx 30 ...

Selecting a gridview row and keeping the last selected row in a gridview highlighted after mouse moves over a new row.
What is the best way to show a gridview row highlighted once selected and keep it highlighted once the mouse moves over a different row? Thanks, Steve hi,you can use <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="#FFFFFF" /> plz let me know if i misunderstood you Thanks for your help. One problem; however, is that after the row has been selected and I check the "grid.SelectedIndex" it has a value of -1 and not the index of the row that was selected on the grid. What do you recommend? Thanks, Steve hi, sorry i din...

how to compare rows in the datatable and remove the duplicate rows (before removal of duplicate row i need to append those values to original rows)
Hii.             I have a datatable in that i have some rows.. i need to compare those rows one among the other based on first column only. If its duplicate row i need to append those col values to original row. For example here is the data in the table.: Total - 13 columns Name:     Jan:   Feb:   March:...............................Dec  Phani      2        4          ...

Reduce rows displayed but putting 3 rows in one row
Hi all, I'm using PB6.5. I have an SQL DW that fetch some information from the DB but should display only two columns: a code and a value. Also they are displayed in the trailer of a group if that's actually important. In order to reduce displayed rows count, i would like to display each 3 rows in one row(Code,Value,Code,Value,Code,Value). The question is how can i do that?. I've tried to use computed fields and in the second and third pair values to use code[1],value[1],code[2],value[2] but only the code[1],value[1] are OK(Showing next row's data), the third ...

Scroll row by row in a datawindow control
Hi. I have a tabular datawindow object with one group and all my data is displayed in the header group and the detail band is not visible. when i run my application and i want to scroll the data the datawindow control scrolls the data page by page and i need it row by row. How can i do this? thank you in advanced You will have to move your data into the detail band. "Row" in datawindow is contents of the detail band. Igor "Fernando Pe�a" <Fernando_Pe0xL1A4za> wrote in message news:943886BF87C590640077873785256A65.0077874785256A65@webforums.....

How to stop the last detail row to print on next page together with the group trailer and summary even the second last page has lot's of space for the last row but not for the summary...
Hi, Can anyone please help me on this : My reports have quite a lot in the group trailers and summary, so that the last detail row will print on the last page with the trailers and summary even though the second last page has a lot of spaces for the detail, but just not enough for the trailers and summary. Therefore it looks very odd that there are lots of space in the second last page, and clients thought the report is finished while the last detail row is printed on the every end page. How can I force the report to fill up the second last page before printing the las...

Datawindow returns 1 row not 105 rows... Web Datawindow
Is there a special setting I'm missing to retrieve all rows in the datawindow control, The sqlselect statment pulls 105 from Microsoft SQL Server. But When I run the datawindow through debug it returns 1 row. Please help! Check RowCount after Retrieve. Yossi Dallal <jfinnell> wrote in message news:42b1b05f.467f.1681692777@sybase.com... > Is there a special setting I'm missing to retrieve all rows > in the datawindow control, The sqlselect statment pulls 105 > from Microsoft SQL Server. But When I run the datawindow > through debug it returns 1 row....

how to select first row or first 3 rows from my database with linq?
Hi, I am trying to retrieve the latest record from my database. have created a repeater and it works just fine selecting all the data from the db with: protected void Page_Load(object sender, EventArgs e) {MMDataContext db = new MMDataContext(strConnection);var qvote = from vote in db.Votes                 orderby vote.VoteDate descending                 select vote; Repeater1.DataSource = qvote;Repeater1.DataBind();} How to...

Web resources about - First Row, Next Row, Prior Row, Last Row - sybase.powerbuilder.datawindow

Israeli fatally stabbed, 3 Palestinian attackers killed in West Bank
An Israeli woman was stabbed to death and three Palestinian attackers were killed in a series of incidents in the Israeli-occupied West Bank ...

Noted Racist Donald Trump Tweets Out Anti-Black Propaganda
Perpetual embarrassment Donald Trump can look almost thoughtful next to his rock-solid, occasionally violent base of racist voters . Except, ...

Watch: ‘Star Wars: The Force Awakens’ TV Spot Shows New X-Wing, BB-8 Footage
As the countdown to the release of “Star Wars: The Force Awakens” continues (25 days left, to be exact), yet another short TV spot has hit the ...

Little-Known Democrat Defeats Republican Frontrunner To Win Governor's Race in Louisiana
A relatively unknown Democrat won a runoff election for governor of Louisiana on Saturday night, taking over in a red state that’s been inundated ...

Djokovic beats Federer in straight sets to win at ATP finals
LONDON (AP) — As usual this season, Novak Djokovic was the best player on the court.

Southwest Flight Diverted Due to 'Suspicious Behavior'
Southwest Flight Diverted Due to 'Suspicious Behavior'

Are these the remains of last tsar Nicholas II’s son? Bone fragments locked in a safe in Russia’s state ...
A probe is being launched to determine whether the remains can be laid to rest next to the other members of Russia's last royal family, interred ...

Washington Post Reporter Jason Rezaian Sentenced By Secret Iranian Court
Jason Rezaian, the Washington Post reporter who has been held by Iran on espionage charges that most everyone agrees are nonsense, has apparently ...

‘Hunger Games: Mockingjay – Part 2’ is a Smash Hit, So Why the Disappointment?
The final film in the “Hunger Games” series debuted to numbers that few pictures in history have ever enjoyed, but not everyone seems impressed. ...

Malaysian police report warns of suicide bombers ahead of Asean summit - World news - The Guardian
Police chief says threats unverified following leaked memo warning Islamic State and regional ally Abu Sayyaf have 10 suicide bombers in Kuala ...

Resources last updated: 11/22/2015 10:26:09 PM