Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3596
  • Last Modified:

informix

How to create a database in INFORMIX?
I am new to DBA staff, buit I need to know that  ASAP
0
kaput007
Asked:
kaput007
2 Solutions
 
qz8dswCommented:
0
 
Goodangel MatopeSoftware ArchitectCommented:
Here is a Database Creation statement I use in production:

CREATE DATABASE empdblive WITH LOG;

That will create a database with a logging. If you want to create a database with no logging just use

CREATE DATABASE empdblive;

Once you have created the database, you may want to create tables in it. I usually create a single script that creates my entire schema, stored procedures, and triggers, so that if I want to recreate a database, I just use that one script.

the following script will create a database and a single table in it.

-----Creating the database
CREATE DATABASE empdblive WITH LOG;
DATABASE empdblive; -- making the new database the active database

CREATE TABLE tblemployee(
     emp_key       integer,
     last_name      char(30) not null,
     first_name      char(30) not null,
     middle_name char(30) not null,
     emp_type smallint,
     department      integer)
IN dbspace1 (or whatever your db space is called)
EXTENT SIZE 30554
NEXT SIZE 30554
LOCK MODE ROW;

It is possible to even create stored procedures and triggers in the same script to create a fully operational database in one fell swoop! :-)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now