Greetings
Some time ago I have developed a web page using PHP and Informix for the database. Now I have the opportunity to continue develop using PHP, but now with MySQL as support database. My questions is about features that I found on Informix and I don't know if they exist on MySQL. I may say I'm a newbie, so be gentle 😉
I want to create a SQL script to import to MySQL and I need to know if it is possible to do things like:
create a log for the created database (ex. ShoppingStore). Using Informix it is like
CREATE DATABASE ShoppingStore WITH LOG IN '/tmp/ShoppingStore/ShoppingStore.log';
check validations on datatypes supported by my tables, to avoid incorrect data. For example, for the table PostalCodes
defined as
CREATE TABLE PostalCodes
(
postalcode INTEGER, NOT NULL
local CHAR(30) NOT NULL,
email char(50),
option CHAR(1) NOT NULL,
PRIMARY KEY(postalcode),
CHECK(email MATCHES '?*@?*.?*' ),
CHECK option IN ('T','M','A')),
CHECK(postalcode BETWEEN 1000000 AND 9999999)
);
Is it possible to use things like CHECK of fields of tables on MySQL?
Another question: On SQL Server is possible to define a string type as follow:
email char(50) NOT NULL DEFAULT "".
It is possible to do this on MySQL?
Thank you very much for your help.
Sérgio