Solved

Oracle Forms 6i insert, update,delete,search,sort

Posted on 2002-03-24
5
5,977 Views
Last Modified: 2007-11-27
I am given a program to insert, update, delete, search, sort records... i am new to oracle so can you give me the code on how to do it? and i am also confused on which triggers will be used in doing this....
0
Comment
Question by:aerokevs
5 Comments
 
LVL 6

Expert Comment

by:M-Ali
Comment Utility
You can start by using the wizards in forms developer. Start with the block wizard, selecting the table you want your block to be based on, select the fields...basically just follow the instructions of the wizard.

Once the block is created, you can start the layout wizard. Here you select the fields you want displayed, layout format, width, height, number of records etc. This is the fastest way to get a "skeleton" layout. Once the wizard finishes, you can then customize the layout as per your requirements.

When you run forms, by default it will start in insert mode ie an empty block will be displayed allowing users to feed in information. Once the information is fed, you can allow the user to save the record by using the default save button. Alternatively you can create your own toolbar, with buttons for inserting/deleting records etc. In this case you would need to write a trigger to process. For instance to save records, your code would be:
commit_form;

For searching you would need to query. This can be done by using shortcuts, for examply F7 key to enter in query-mode, then enter any search criteria, and F8 to execute the query. Alternatively you can have buttons in your toolbar that would carry out these functions: ENTER_QUERY and EXECUTE_QUERY are the two built-ins you need to use.

Once the record is on the screen (ie visible in the form) the user can update/delete it. For updating again you need to use the save button or COMMIT. For deleting you would need to use the delete button or the DELETE_RECORD builtin.

For sorting, you would need to set the ORDER BY property of the DATA BLOCK. Select the data block, press F4 will give you list of all its properties. If you want to do it programmatically, you will need to use: SET_BLOCK_PROPERTY builtin.

I suggest you go through the online help provided in forms.

Ali
0
 
LVL 22

Expert Comment

by:Helena Marková
Comment Utility
If your block is based on a table and you want to insert/update/delete record simply set data block property:

At design time you can use property pallete
INSERT_ALLOWED      Yes
UPDATE_ALLOWED     Yes
DELETE_ALLOWED     Yes

or programmatically:

Set_Block_Property('your_block',INSERT_ALLOWED,PROPERTY_TRUE);
Set_Block_Property('your_block',UPDATE_ALLOWED,PROPERTY_TRUE);
Set_Block_Property('your_block',DELETE_ALLOWED,PROPERTY_TRUE);

Now you can insert/update/delete records.

There are Pre-Insert, Pre-Update and Pre-Delete triggers which you can or can not use. (See "Pre triggers" in the help.)

For sorting,ordering  .... record there are DEFAULT_WHERE and ORDER_BY block properties.

Of yourse it is more complex but if you are a beginner I hope this will be a little help for you.
0
 
LVL 34

Accepted Solution

by:
Mark Geerlings earned 100 total points
Comment Utility
The basic SQL database activities (select, insert, update, delete, lock record, etc.) are all handled automatically in Forms6i if you create a block based on a table or view.  You don't need to write any code to support these features.  You can add triggers like:
1. pre-insert and/or pre-update to provides some values automatically (user ID, timestamp, etc.)
2. when-validate-item to insure that the value entered exists in a database table somewhere, or meets some other criteria you need to enforce.

There are many more triggers initiated by various events that can be used for more complex data entry, validation, screen manipulation, etc. but I recommend starting with no (or only a few simple) triggers, then adding additional functionality and/or complexity after you get used to the basics.
0
 

Author Comment

by:aerokevs
Comment Utility
thanks a lot.. if you have any tips and tricks site about oracle form 6i please tell me thanks...
0
 
LVL 22

Expert Comment

by:Helena Marková
Comment Utility
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now