Tables
Last updated
Last updated
It is best practice to create the data model (tables, primary keys, foreign keys, and fields) before starting to create a solution. Objects in the database can be created with database tools built to administer the database, or within Servoy Developer. This guide will demonstrate how to work with database tables, including creating/deleting as well as additional settings that affect the behavior of applications.
Once the database server connection has been set up, developers now have the possibility to access and manage database tables.
Below are a few examples to begin working with tables.
Servoy applications can access the databases tables that are already created.
To view an existing table, open the Database Servers node in the Solution Explorer, then open the database you need and right-click the Table and select Edit table/view. This can also be done by double clicking the name of the table instead of right clicking on it and selecting an option.
In order to edit a table in Servoy Developer, you should first have connected to your database and opened the table in the Table Editor.
Here you can manage:
Here are the steps of creating a table in Servoy Developer:
Right click on the database name in the Database Servers node and select Create Table OR with the database name selected, click on the create table button in toolbar of the list view in Solution Explorer.
A dialog will ask for the name for a new table, where you should enter a preferred name.
The table editor view will appear allowing new columns to be entered.
When a new table is created, Servoy will add a column in the table editor for the primary key. All tables used in Servoy must have a primary key or a row identifier.
To delete an existing table, open the Database Servers node in the Solution Explorer, then open the database you need and right-click the Table, then select Delete table. You will be asked to confirm the delete.
No Undo When you drop a table from a database server, there is no undo. While you can re-add the table at any time, any data in that table will still be lost.
Unresolved Data Bindings When you drop a table, you may also create errors in your application if you have objects bound to that table, such as a field on a form or a relation. These errors can be resolved in Servoy Developer.