Home » Developer & Programmer » Forms » oracle forms (oracle 9i, form9i)
oracle forms [message #483637] Tue, 23 November 2010 11:54 Go to next message
ankit3010
Messages: 17
Registered: November 2010
Location: Indore
Junior Member

Hi to all,
I have a small problem like I have one table named "retail" in database like
prod_id prod_name price discount date
and in form I have made two blocks.
First blck is CONTROL block and second is database block..
In control block I take two text fields named
PROD_NAME and NUMBER OF RECORD I want from the table..
In database block I take all the fields except PROD_NAME field..
and now I want to insert data in to the table and I dont have PROD_NAME coloumn in the database block..
I am thinking to write block level ON-INSERT TRIGGER but what do I can write in the PL/SQL block..Please suggest me
Re: oracle forms [message #483640 is a reply to message #483637] Tue, 23 November 2010 12:03 Go to previous messageGo to next message
Michel Cadot
Messages: 68686
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Reporting your question to get an answer is NOT the way.
Please carefully read OraFAQ Forum Guide.
And if you want an answer in less than 5 minutes, I advise you to hire an expert at home and not ask in a forum.

Regards
Michel

[Updated on: Tue, 23 November 2010 12:04]

Report message to a moderator

Re: oracle forms [message #483641 is a reply to message #483640] Tue, 23 November 2010 12:11 Go to previous messageGo to next message
ankit3010
Messages: 17
Registered: November 2010
Location: Indore
Junior Member
Sorry Sir,
I was just curious toknow the answer..
Sorry again..
I will wait for the answer
Re: oracle forms [message #483644 is a reply to message #483641] Tue, 23 November 2010 15:25 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
You don't want an on-insert trigger.
You do want to have the prod_name field in the database block - it doesn't have to be on screen.
If you want it populated automatically do it from pre-insert.
Re: oracle forms [message #483655 is a reply to message #483644] Wed, 24 November 2010 00:05 Go to previous messageGo to next message
ankit3010
Messages: 17
Registered: November 2010
Location: Indore
Junior Member
I will try to do it..
but how can I? Do I have to write INSERT query in to the pl/sql block or what?

[Updated on: Wed, 24 November 2010 00:06]

Report message to a moderator

Re: oracle forms [message #483661 is a reply to message #483655] Wed, 24 November 2010 00:35 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
No, not the INSERT statement.

You'd create (as Cookiemonster said) a non-displayed database block item called :database_block.prod_name. PRE-INSERT trigger would look like this:
:database_block.prod_name := :control_block.prod_name;
Re: oracle forms [message #483674 is a reply to message #483661] Wed, 24 November 2010 02:10 Go to previous messageGo to next message
ankit3010
Messages: 17
Registered: November 2010
Location: Indore
Junior Member
Sir, I am writing this code in the pre-insert trigger
It is giving compiler error
Re: oracle forms [message #483675 is a reply to message #483674] Wed, 24 November 2010 02:28 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If you wrote exactly what I wrote, no wonder. I guess your datablocks' names aren't "database_block" and "control_block". You should replace those "desriptive" names with real ones (you used in your form).

Otherwise, it could help if you specified which error it was. It is kind of difficult to guess what might be wrong.
Re: oracle forms [message #483676 is a reply to message #483675] Wed, 24 November 2010 02:47 Go to previous messageGo to next message
ankit3010
Messages: 17
Registered: November 2010
Location: Indore
Junior Member
No no sir I have written my datablocks name...
Thank you very much Sir, it is working..
Re: oracle forms [message #483678 is a reply to message #483676] Wed, 24 November 2010 02:53 Go to previous messageGo to next message
ankit3010
Messages: 17
Registered: November 2010
Location: Indore
Junior Member
Sir, I want one more side from you that
I want to use a nondatabase text item in the database block which is SN i.e. serial number..
I want this that whenever the data retrieved from the database then it will show the number of data retrieved
Like if 5 records are retrieved then it will automatically increase
1
2
3
4
5
sir I know this that either :system.cursor_record or :system.trigger_record will applied but how can I apply I dont know..
Please let me know..
Re: oracle forms [message #483682 is a reply to message #483678] Wed, 24 November 2010 03:14 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
POST-QUERY block-level trigger:
:block_name.sn := :system.trigger_record;

[Updated on: Wed, 24 November 2010 03:14]

Report message to a moderator

Re: oracle forms [message #483691 is a reply to message #483682] Wed, 24 November 2010 03:35 Go to previous messageGo to next message
ankit3010
Messages: 17
Registered: November 2010
Location: Indore
Junior Member
Ohhh.. I should have think about this...
Sir, I am new in this thats why...
Thank you very much sir..

Re: oracle forms [message #483705 is a reply to message #483691] Wed, 24 November 2010 04:05 Go to previous message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
No problem, that's what a forum is for Smile
Previous Topic: Download / upload to excel through forms 6i in oracle apps
Next Topic: Block total (merged)
Goto Forum:
  


Current Time: Thu Sep 19 13:51:06 CDT 2024