Modifying your Data

From InterBase
Jump to: navigation, search

With InterBase XE7, adding or modifying your data is fast and easy.

Adding Additional Data

We are going to add a table called "Blogs" to our database.

  1. In the IBConsole page, click Image 34.gif to open the SQL Interactive page.
  2. Enter the code shown below and click Image 34.gif. The new table is added.
CREATE TABLE blogs (Country char(10), Operating System varchar(2), User varchar(25));
INSERT INTO blogs VALUES ('USA', 'Android', 'Joe' );
BlogsTable.png

Modifying Data

When we created our "Blogs" table, we forgot to add a column of important information so we need to modify the Blogs table.

  1. In IBConsole, double-click the table Blogs in the right-hand panel.
  2. In the Properties for BLOGS dialog click the Alter Selected Item icon (AlterSelectedItem.png) and the Table Editor dialog opens.
  3. Click Add Field to create a new column in your table with the following information:
Name: Mobile Unit
Field Kind: Specified Datatype
SQL Type: Select VARCHAR from the drop down menu
Character Length: 25
Character Set: UTF8
  1. Click OK to close both dialogs and your new column has been added.
ModifyBlogs.png

Granting User Permissions by Defining Roles

You may want to grant a particular collection of privileges to your sales people and a different collection of privileges to your accounting staff. The privileges for each case may be quite complex. Without roles, you would need to create a lengthy and detailed GRANT statement each time a new sales or accounting person joined the company. By using roles, you avoid this problem.

Implementing roles is a four-step process:

  1. Define the role.
CREATE ROLE role_name
  1. Grant privileges to the role
GRANT {one or more of INSERT, UPDATE, DELETE, SELECT, REFERENCES, EXECUTE} 
ON table_name to role_name
GRANT UPDATE (col_name1, col_name 2) ON table_name TO role_name
When the access is restricted to certain columns, as in the second line, only UPDATE and REFERENCES can be granted. EXECUTE must always be granted in a separate statement.
  1. Grant the role to users
GRANT role_name TO user_name1, user_name2
The users have now have all the privileges that were granted to the role_name role. But there’s an additional step before those privileges are available to them. They must specify the role when the connect to a database.
  1. Specify the role when connecting to a database.


DatabaseConnect.png

For a complete explanation of granting privileges, see Access Privileges in the InterBase Quick Start

Testing Queries

  • Steps on how to test queries

Performing Administrative Tasks

  • Not sure what other "administrative tasks" need to be covered here...
creating a new users?
working with the local server?
??

The installation of Mac OS X requires an Administrator password to install the software. For a step-by-step explanation of installing Mac OS X see: Installing XE for Mac OS X

The installation of InterBase XE for Linux requires an Administrator password to install the software. For a step-by-step explanation of installing Linux see: Installing InterBase XE for Linux

Advance To: