Home » Developer & Programmer » Forms » displaying serial no in the detail block
displaying serial no in the detail block [message #78961] Mon, 08 April 2002 03:47 Go to next message
ayaz
Messages: 4
Registered: April 2002
Junior Member
I am having master detail form. In detail block I want to show serial number of the item . It should be displayed as the user goes to next record...

Help is needed urgently....

Thanks for your effort...

regards,
Re: displaying serial no in the detail block [message #78988 is a reply to message #78961] Thu, 11 April 2002 00:40 Go to previous messageGo to next message
Subhash
Messages: 105
Registered: October 2001
Senior Member
Use :system.cursor_record
Re: displaying serial no in the detail block [message #198909 is a reply to message #78988] Thu, 19 October 2006 02:26 Go to previous messageGo to next message
ali1983
Messages: 13
Registered: October 2006
Location: Faisalabad
Junior Member
It's ok when creating new record. But when we view the record by It does not show the Serial Number. Now tell me that how can we do it.
Re: displaying serial no in the detail block [message #198918 is a reply to message #198909] Thu, 19 October 2006 02:59 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please post a description of the table in the master and detail blocks. Is this field a database field? Is it part of one of these two tables? MORE DESCRIPTION PLEASE.

David
Re: displaying serial no in the detail block [message #199058 is a reply to message #198918] Thu, 19 October 2006 22:38 Go to previous messageGo to next message
ali1983
Messages: 13
Registered: October 2006
Location: Faisalabad
Junior Member
MasterTable

REFNO (P.K) NOT NULL VARCHAR2(50)
REFID (P.K) NOT NULL VARCHAR2(50)
VENDORID NUMBER(4)
TERMS VARCHAR2(100)
E_DATE DATE
SYS_DATE DATE

-----------------------------------------------------------------
Detail Table

REFNO (F.K) NOT NULL VARCHAR2(50)
REFID (F.K) NOT NULL VARCHAR2(50)
P_IN NUMBER
ITEM_CODE NOT NULL NUMBER(4)
ITEM_NAME VARCHAR2(100)
RATE NUMBER(8,4)
UOM VARCHAR2(100)

-----------------------------------------------------------------
above is a structure of a Master Detail Table.
Now In detail block I add a text Item for Serial Number(Not part of a dtaabase) and assign a value ":System.Coursor_record" It works fine when inserting new records in Detail Block.But when it comes to viewing record it don't work. The Serial Number field(Non Database Item) remains empty. Now I hope that u have got my question. Waiting 4 ur reply with full solution.
Re: displaying serial no in the detail block [message #199062 is a reply to message #199058] Thu, 19 October 2006 23:52 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
You say 'serial number'. Do you mean 'row number'? That is, the first line in the detail block has a '1', the second line has a '2', etc?

David
Re: displaying serial no in the detail block [message #199078 is a reply to message #199062] Fri, 20 October 2006 00:56 Go to previous messageGo to next message
ali1983
Messages: 13
Registered: October 2006
Location: Faisalabad
Junior Member
Hello:-
Yes exactly this is the thing which I want. And can I have ur personal email address.
Re: displaying serial no in the detail block [message #199084 is a reply to message #199078] Fri, 20 October 2006 01:27 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
No you may NOT have my personal email address.

To populate a row number (crudely), create a non-database item in your block, create a Post-Query trigger which populates this field with the 'get_block_property' command 'current_record' property.

Just remember that if you intend to insert a record above an existing record, or delete an existing record, you will need to create a 'when-new-reocrd-instance' trigger which also populates this field and then write a loop in a procedure to traverse ALL the records so that their 'number' is reset. This procedure would be called from the 'insert' and 'delete' triggers.

David
Re: displaying serial no in the detail block [message #199091 is a reply to message #199084] Fri, 20 October 2006 02:06 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I really wouldn't know whether this might work or not (David surely will!), but - here it is: if a detail block's source is a FROM clause (which would select all necessary columns from the detail table), one column might be created as RANK() OVER (...) which would (would it?) fetch that "serial number" of the record. SELECT operation might be OK; how about INSERTing new record or DELETing existing ones?

I can't try it myself - I don't have a database here - but *perhaps* this might be another option. To me, even if it is possible to accomplish, this approach seems to be more complicated that the one David already suggested.
Re: displaying serial no in the detail block [message #199247 is a reply to message #199084] Sun, 22 October 2006 20:42 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Doh! Try putting 'rownum' as a column in your select. It will work.

David

Upd-mod: I tested it a bit. Yes it works but you need to do an 'execute_query' after an insert or delete to get the field to be updated (this seems the easiest way to me).

[Updated on: Sun, 22 October 2006 21:01]

Report message to a moderator

Previous Topic: ODBC Connection / Non Oracle Data Connection
Next Topic: password using rand key in ora8i and 9i
Goto Forum:
  


Current Time: Fri Sep 20 12:36:01 CDT 2024