Home » Developer & Programmer » Forms » serial sorting (forms 6i)
serial sorting [message #408115] Sun, 14 June 2009 05:38 Go to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
hi all

my problem is this that let suppose
serial is

sr.no
1
2---->if i deleted serial no 2
3
4
5
then serial should sort
automatically like

1
2
3
4
5

thnaks and pls find the solution


baba
Re: serial sorting [message #408161 is a reply to message #408115] Mon, 15 June 2009 00:09 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
After deleting a record, run UPDATE statement which will set new serial number values.
Re: serial sorting [message #408476 is a reply to message #408161] Tue, 16 June 2009 06:35 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
thanks for response

let me explain you again

1 -- john
2 -- rocky ------i deleted this one
3 -- martin
4 -- david

serial should sort automatically like

1 -- john
2 -- martin
3 -- david

can u give some example regarding updation

thanks




Re: serial sorting [message #408495 is a reply to message #408476] Tue, 16 June 2009 07:37 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I can not, because I don't know what makes those names sorted that way (John first, Rocky second, Martin third and David fourth) - it is not alphabetically (asc or desc), so - once you find out the way those names are sorted, write an UPDATE statement which should contain some kind of ORDER BY clause, such as (ordering them alphabetically descending)
SQL> select * from test;

        ID ENAME
---------- --------------------
           david
           john
           martin
           rocky

SQL> update test t set
  2    t.id = (select x.rb
  3            from (select t1.ename, row_number() over (order by t1.ename desc) rb
  4                  from test t1
  5                 ) x
  6            where x.ename = t.ename
  7           );

4 rows updated.

SQL> select * from test order by ename desc;

        ID ENAME
---------- --------------------
         1 rocky
         2 martin
         3 john
         4 david

SQL>

By the way, what makes this question related to Forms?
Re: serial sorting [message #408518 is a reply to message #408495] Tue, 16 June 2009 09:09 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
thanks for reply

thanks it really helped for me and icreased my knowledge

but it will happen totally on canvas only without saving data in databsae like






  • Attachment: example.PNG
    (Size: 59.69KB, Downloaded 565 times)
Re: serial sorting [message #409486 is a reply to message #408518] Mon, 22 June 2009 20:41 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Then display the 'rownum'.

David
Previous Topic: Chart Of Account
Next Topic: image uploading using bfile data type
Goto Forum:
  


Current Time: Fri Sep 20 10:26:30 CDT 2024