Method 1,
You only need"Serial number"Define it as a formula and set it:Get_block_property ('block _ name', current_record)This can be done, or put this line of statement into"When-create-record"Trigger.
Disadvantage: the row number cannot be automatically refreshed when adding, modifying, or deleting data.
Method 2,
InBlockAdd the correspondingCode:
Key-crerec:
Declare
Line number;
Begin
Line: =: system. cursor_record;
Loop
If: system. last_record = 'true' then
Exit;
Else
Next_record;
: BLK. ID: =: system. cursor_record + 1;
End if;
End loop;
Go_record (line );
Create_record;
: BLK. ID: =: system. cursor_record;
End;
Key-delrec:
Declare
Line number;
Begin
Delete_record;
Line: =: system. cursor_record;
Loop
: BLK. ID: =: system. cursor_record;
If: system. last_record = 'true' then
Exit;
Else
Next_record;
End if;
End loop;
Go_record (line );
End;
When-create-record:
: BLK. ID: =: system. trigger_record;
Disadvantage: the number of records is small.TableApplicable whenTableWhen many records exist, the efficiency is affected due to the use of loop operations.