How to prevent inserting same data into table from oracle forms - oracleforms

I have a form with four data blocks and have some fields. One of the data blocks values are stored in a table table1 on click of save button.
Now the main issue is, it has to save data to that table1 only if i make change to the fields of the data block (of table1). But the same data is saving to table1 if i make change in fields of other data block on click of save button.
this is table1 datablock
this is other datablock

Related

SSIS package to Insert flat file data to two different tables

I want to insert flat file data to two different sql table.But some additional field coming from flat file should be inserted to other table on the basis of indicator field but the usual field coming should be inserted into the regular table.
The other issue,the additional field to be inserted cannot be inserted directly because of no column mapping.
eg:
1234 056 Y Tushar
5678 065 N
So 1234 056 should be inserted to regular table but indicator Y tells us that Tushar should be inserted to other table.
But the table in which I want to Insert Tushar cannot be done directly as it does not have 1234 column name.
For indicator N also it should get inserted normally in the base table.
So what I did was I used a conditional split and then used ole db command but it it inserting multiple records in the table.
If you put a Multicast task right after your flat file source, you can create extra copies of your data set. Then you can use one copy to insert into Regular Table, and then you can put your Conditional Split on the second copy.
Your data flow would then look like this:
In my Flat File Source I defined four columns:
The Multicast doesn't need any configuration, and I assume the Regular Table destination isn't giving you the trouble. So next, you'd create the Indicator check with a Conditional Split task. Check for a value of Y like this:
Then just map whichever available columns you want to insert into Other Table. I chose the second column (I called mine Seq) and the Name column. You may have these named differently.

How to get combo box selection to fill related fields with data

I have a table [inventory] with inventory items, and a bunch of columns with different information for those. Mainly, part#, description, price. I am trying to create both a purchase order form [POForm] and, and a inventory transactions form [TransactionsForm], but that one thing I've been stuck on is getting a combo box look up I use to select the part# from [inventory], to also fill my fields for description, and price for that item in my form. I need the fields that are filled to be able to have formula's run off of them, and the information to be saved into the table for that form [TransactionsTable], [POTable].
I've tried making my part# combo box include the fields for the description and price, and using =[part#].[column](x) in the other fields as a lookup, and it looks right visually, but that is apparently just a visual of that data, but technically the field is still blank, because those other fields remain empty in the table for that form, and I am not able to run a formula off the price.
As per my understanding and please correct me if I am wrong. you have a form that shows your inventory data Part# Description & price. This form has a combo box that allows you to select a particular part # to view its related record data description and price.
Now you want to click a command button after selecting a particular part # to update your transaction form and POtable.
1.you have to create a query,
2.insert the inventory table in it
3.select append from the query type in the ms access ribbon
4.a window will appear, choose the transaction table as the destination table to append to.
5.double click on the fields that you want to retrieve its data from the inventory table
6.then in the table below in the query itself in the "append to" row you will find drop-down menu including all the fields from the transaction table. choose the corresponding fields. note if the fields have the same name in both tables access will do it automatically.
7.in the criteria row type the following [Forms]![Inventory Form Name]![the name of the field in the form]. do that for each field in the happen query.
8.save the query and name it
9.go-to design view in your inventory form and create a command button, in the click on event creat macro of the following: openquery-->type the append query name
10.save and close macro builder
11.open your form, select part#, click on the button
12.access will ask you to confirm appending process. click ok/yes
13.check your transaction table to confirm that the append process was successfully performed
14.Tip if you do not want the confirmation msg of append to appear, in the click on event go to the macro builder and choose in the ribbon show all actions then in the first line of the macro builder insert setwarnings - NO
the same is to be applied for the POtable.
Anyways, I hope you find this clear and helpful but I have only one concern you do not have to append part description and price in transaction and PO tables as you already have this data in your database in the inventory table. Generally speaking no need to include the same information in multiple tables otherwise you are not benefitting from the idea of a relational database.
I hope I addressed your inquiry.

Creating a responsive table for displaying data from database

I need to create a form containing only a text box and a submit button.
I need to store datas in the database. The data that are stored in the database is employee's address, I need to store the old and new address for the employees. So the database should contain multiple columns for a row, assuming that each column contains the address of the employee. Some employees may have 1 address and some employees may have multiple address.
Now, with the created form. When I typed the Employee ID in the text box and searched. It should display the all the address from the database for the given ID. Important:It should not display the columns that are left blank.
While displaying the data, it should contain a edit button near to the data field so that the data can be manipulated.
I am using mySQL. How I should achieve displaying only the data but not the empty fields.

How to save changes of an HTML table full of text fields to a db

I have an HTML table full of text fields. I have the ability to add new rows in the table (I am just doing this with a JavaScript function call and inserting them directly) on the fly. I need to be able to save the table values right into a (MYSQL through PHP) database. I have got the database all hooked up, but I have a question about saving the changes to my table.
How can I know which fields of the potentially dozens of fields are 'dirty'? I am thinking it would be easiest to just clear out the database when I need to save and insert all of the data from the HTML table into the database. Is that an acceptable approach?
In general it's better to clear out all relevant records and re-add them. It saves a lot of messing around BUT do be sure the table you're saving contains all the relevant data. If you have state data that wouldn't normally be editable (like creationDate you should be sure it's available to resave.
You should also wrap the whole process in a transaction so you can roll back any deletions if saving the new data fails for any reason.

Linking Controls in Access 2003 Form

I created a form in access that populates a table, TABLE1 which pulls information from different tables for example, the database is supposed to capture trouble calls that come in from different sources, there are fields like: location, division, line, date, employee, employee id, comments, etc.
On my form, the location, division, and line come from TABLE2 (I have the location in the form of a combo box with a drop down listing all the locations); the employee and employee id come from TABLE3 and the user inputs the date and comments. All of this information gets saved into TABLE1 except for the division, line, and employee id because I don't need to save them into TABLE1 as I have created a query to pull all the information together.
When the user chooses "location" I would like the division and line fields to automatically populate on the form but not be available for the user to update (because I don't need it to be inputted into TABLE1) I just want the user to be able to see the it.
Is this possible? Thank you.
Set the Row Source (the query) of your combobox to include Location, Division and Line (in that order).
Then, set the Control Source of your textbox where you want to display the Division to be
=[LocationComboBox].[Column](1)
and the Control Source of the textbox where you want to display the Line to be
=[LocationComboBox].[Column](2)
Change the LocationComboBox to match the name of your combo box.
You will probably also want to set the Enabled property of your Textboxes to False so users don't try to edit the Division and Line.