Solved

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

Posted on 2002-03-24
5
6,621 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 6

Expert Comment

by:M-Ali
ID: 6893524
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á
ID: 6893536
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 35

Accepted Solution

by:
Mark Geerlings earned 100 total points
ID: 6894499
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
ID: 6908661
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á
ID: 6912119
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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.

734 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