A records is a set of data that represents one object, person, animal or even an abstract concept. A record is composed by fields, which in turn represent the smallest amount of information that a database such as MaxBase can handle. As an example letīs consider a car: we may choose to represent it indicating the brand name (eg, Ferrari), the model, the price and whatever we are interested in for our purposes (colors availability, max speed, fuel consumption, etc).
In this example, one record could be the following: Ferrari, 328, USD 20.000, Red.
When you work with records, therefore, you must input, revise or browse sets of fields using the line view (where several records are presented, one each line) or form view (where only one record occupies the whole application estate).
In order to input data into MaxBase you need to create a form using VFD , then you must press the toolbar "Add record" icon or the "Modify/Add record" menu item and you will be prompted with your blank form; at this point MaxBase is waiting for your records to be entered.
In a similar fashion, when you need to modify one or more records you must select them with the mouse while in line view and press the "Modify record" icon in the toolbar or selecting the "Modify/Modify record" menu item. If you are in form view, "Modify record" will allow you to modify the record currently presented.
Deleting a record, or a set of records, is done by selecting the record(s) and pressing the "Delete record" icon in the toolbar or selecting the "Modify/Delete record" menu item
Importing or exporting data between two MaxBase tables is a snap, thanks to the Import/Export wizard; first off, you need to be logged into a database and then you must choose the "Modify/Import-Export Records" menu item. The following interface will pop up:
(This is a Linux screenshot)
In this page you must fill in two pieces of information: the first is to indicate that you either want to import into the current database, or export from it a set of records, while the second is the name of the database that will be used to accept/get the records.
Note: when exporting records, you donīt need to provide the name of an existing MaxBase table: if you just specify a valid local file name, a new MaxBase table will be created, using the same fields of the table that youīre exporting records from.
Note2: The name of the external table can be either a local file name or even a remote MaxBase table being server by NetAdmin or RXDBServer -- in this case, you must provide the table location information in the mbase://host:port(password) format.
Pressing the "Next" button, you will then be presented the second page of the wizard:
Here you find two columns: the left one contains the fields of the source table that you want to export, while in the right one you will put, using the ">>" and "<<" buttons, the fields that you do not want to be exported.
Pressing the "Next >" button again you will find this page:
This is the heart of the import/export process: in the choice widget (that here is represented by a small line in the upper left part of the window) you have all of the fields that you just chose in the preceding page, while in the list on the right you have a list of fields from the target table. You must link each field from the source table to a field on the target table or to the <nothing> label (in this latter case, the field will not be exported).
If you donīt want to link a field in the source table to one of the destination table, but you want instead a new field to be created, just select it and press the "Add field" button. If you change your mind, select it again and press the "Do not add" button.
After you have finished linking fields, press the "Next >" button to switch to the next step of the process.
This is where you specify a primary key. What is a primary key? It is a set of fields that define, all together, a unique record. That is, you canīt have two records with the same primary key.
This means that if your primary key is not void (if you put some of the fields into the "primary key" column, all of the records in the target table that share the same values (as a whole) in the source table primary key fields will be replaced. If you let the primary key column void, all of the records will be simply added to the target table.
Now youīre ready to start converting, which will happen in the fifth and last page of the wizard:
Here you can only choose "Cancel" to abort the whole operation, or "Finish" to let MaxBase conclude the import/export process. While converting data, the blue label will keep you informed about whatīs going on.
This is pretty much all you can do with records from within MaxBase. If you want to learn more about printing records, go to the MERGe page; if you want to know how to create forms head over the VFD page. |