Home » Developer & Programmer » Forms » serial number (forms 10g)
serial number [message #458849] Wed, 02 June 2010 03:23 Go to next message
lokeshsurana
Messages: 212
Registered: April 2010
Location: India
Senior Member
I have created simple data block by wizard and taken tabular layout
10 rows and 6 columns

i want to generate serial number on first column .....


what need to use..?
Re: serial number [message #458853 is a reply to message #458849] Wed, 02 June 2010 03:28 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
A sequence?
Re: serial number [message #458859 is a reply to message #458853] Wed, 02 June 2010 04:14 Go to previous messageGo to next message
aftab248
Messages: 14
Registered: August 2007
Location: Bangladesh
Junior Member
You can try with system variable like :system.cursor_record or :system.trigger_record
Re: serial number [message #458874 is a reply to message #458859] Wed, 02 June 2010 05:20 Go to previous messageGo to next message
lokeshsurana
Messages: 212
Registered: April 2010
Location: India
Senior Member
:system.cursor_record how to use that????
Re: serial number [message #458877 is a reply to message #458874] Wed, 02 June 2010 05:30 Go to previous messageGo to next message
lokeshsurana
Messages: 212
Registered: April 2010
Location: India
Senior Member
is it possible to restart sequence from 1 again when form again opened?
Re: serial number [message #458878 is a reply to message #458877] Wed, 02 June 2010 05:36 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It means that the "sequence" item is a non-database item. Therefore, you'd use :SYSTEM.CURSOR_RECORD or :SYSTEM.TRIGGER_RECORD system variables.
Re: serial number [message #458887 is a reply to message #458859] Wed, 02 June 2010 06:29 Go to previous messageGo to next message
yeahia
Messages: 22
Registered: June 2010
Location: Bangladesh
Junior Member
create a trigger in the block;
trigger: when_new_record_instance
begin
:col :=:system.cursor_record;
end;
i think this will help to you.

Yeahia
Re: serial number [message #458992 is a reply to message #458887] Wed, 02 June 2010 18:14 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
hi try this


declare
a number;
begin
a:=1;
while :empno is not null loop
:d:=a;
a:=a+1;
next_record;
end loop;
end;

import emp table on canvas and take one field with the name of
D

I HOPE IT WILL HELP YOU

Re: serial number [message #458993 is a reply to message #458992] Wed, 02 June 2010 18:15 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
O Yah one more thing this code you have to write on when-button-pressed

Re: serial number [message #459143 is a reply to message #458877] Thu, 03 June 2010 09:47 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
lokeshsurana wrote on Wed, 02 June 2010 12:30
is it possible to restart sequence from 1 again when form again opened?

What does that, actually, mean?

If we talk about querying, you should put code (one you find the most useful - a few have been offered here, as well as in the Forms Forum) into the POST-QUERY trigger.

If it is about new records, I guess that the easiest way to do that is to use one of earlier suggested :SYSTEM variables.
Re: serial number [message #459416 is a reply to message #459143] Fri, 04 June 2010 17:18 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member

try this put this code on when-new-form-insta



BEGIN
If :SYSTEM.RECORD_STATUS in('NEW') THEN
--seqno_prc('block_name','item_name');
seqno_prc('dept','deptno');
END IF;
END;
Re: serial number [message #459455 is a reply to message #459416] Sat, 05 June 2010 10:46 Go to previous message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It will most probably fail. Can you guess why?
That's why
Previous Topic: 10g Forms On 9i Database
Next Topic: Set_menu_item property not work
Goto Forum:
  


Current Time: Fri Sep 20 03:43:05 CDT 2024