Hi Following is the syntax for creating table in mysql.
I want to create table with same properties in oracle9i.
Can anyone provide me the equivalent syntax for oracle?
CREATE TABLE IF NOT EXISTS "tbl_audit_trail" (
"id" int(11) unsigned NOT NULL,
"old_value" text NOT NULL,
"new_value" text NOT NULL,
"action" varchar(20) CHARACTER SET latin1 NOT NULL,
"model" varchar(255) CHARACTER SET latin1 NOT NULL,
"field" varchar(64) CHARACTER SET latin1 NOT NULL,
"stamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"user_id" int(11) NOT NULL,
"model_id" varchar(65) CHARACTER SET latin1 NOT NULL,
PRIMARY KEY ("id"),
KEY "idx_user_id" ("user_id"),
KEY "idx_model_id" ("model_id"),
KEY "idx_model" ("model"),
KEY "idx_field" ("field"),
KEY "idx_old_value" ("old_value"(16)),
KEY "idx_new_value" ("new_value"(16)),
KEY "idx_action" ("action")
) AUTO_INCREMENT=168 ;
Migrating to Oracle 9i is a bad idea. Assuming that by “9i”, you mean 9.2.0, extended support ended 30-JUL-2010. If you’re talking 9.0.1, extended support ended 30-JUN-2006.
If you’re bound and determined to go down this path, Oracle documentation is freely available at http://docs.oracle.com/. Except, wait, no…..no 9i documentation! It’s considered too old and has been removed.
Your options for 9i documentation are probably to do some Google searching, see if it’s still available from Oracle as a download, or available elsewhere.
But my strong recommendation is to not use Oracle 9i for this project! Go to 11gR2, preferably 11.2.0.3.0. If there’s an existing database, talk to your client, get it upgraded to 11gR2 before you begin.
Just because the client said something, doesn’t mean it’s right. You are the Oracle expert. You need to educate him.
Hope that helps.