Senad
07-31-2003, 10:18 AM
Hi, a client of mine is having trouble installing their database information and I am attempting to help him out as best as I can. He has given me two files and I am using the MySQL version above which is giving errors on both .sql files:
Createdb.sql goes in first, then createtestdb.sql to put some dummy data in
there.
I have setup a db indigite_phone with user indigote_logger password
test.
I have just dropped and recreated the database so its empty.
The Two MySQL codes I am getting an error with are:
For createtestdb.sql:
use indigote_phone;
-- Create some fake data for testing
insert into users (name, type, channelview) values
("admin", "admin", 255),
("nick", "user", 15),
("stephen", "admin", 15),
("newcars", "user", 1),
("usedcars", "user", 2),
("manager", "user", 15);
insert into calls (filename, start, duration, channelnum, salesrep,
customer, sales, appt, ciw, followup, sold, dead) values
("call1.wav", "2003-07-02 16-01-00", 150, 1, null, null, 1, 0, 0, 0, 0, 0),
("call2.wav", "2003-07-02 16-02-00", 150, 2, null, null, 1, 0, 0, 0, 0, 0),
("call3.wav", "2003-07-02 16-03-00", 150, 2, null, null, 1, 0, 0, 0, 0, 0),
("call4.wav", "2003-07-02 16-03-00", 150, 1, null, null, 1, 0, 0, 0, 0, 0),
("call5.wav", "2003-07-02 16-04-00", 950, 1, "SY", "alison", 1, 0, 0, 0, 0, 0),
("call6.wav", "2003-07-02 16-05-00", 150, 2, "NC", "sarah", 1, 1, 0, 0, 0, 0),
("call7.wav", "2003-07-02 16-06-00", 150, 1, "SY", "beth", 1, 1, 1, 0, 1, 0),
("call8.wav", "2003-07-02 16-07-00", 150, 1, "SY", "kate", 1, 0, 0, 1, 0, 0),
("call9.wav", "2003-07-02 16-08-00", 150, 2, "NC", "kate", 1, 0, 0, 1, 0, 0),
("call10.wav", "2003-07-02 16-09-00", 150, 1, "SY", "kate", 1, 0, 0, 1, 0, 0),
("call11.wav", "2003-07-02 16-10-00", 150, 1, "SY", "kate", 1, 0, 0, 1, 0, 0),
("call12.wav", "2003-07-02 16-11-00", 150, 2, "NC", "kate", 1, 0, 0, 1, 0, 0),
("call13.wav", "2003-07-02 16-12-00", 150, 1, "SY", "kate", 1, 0, 0, 1, 0, 0),
("call14.wav", "2003-07-02 16-13-00", 150, 1, "SY", "sue", 1, 1, 0, 0, 0, 1);
For createdb.sql:
use indigote_phone;
create table calls (
id int unsigned not null auto_increment primary key,
filename varchar(255) not null,
start datetime not null,
duration int unsigned not null, -- Duration in seconds
channelnum int unsigned not null,
salesrep char(3),
customer varchar(255),
sales bool default 1, -- sales enquiry
appt bool, -- appointment made
ciw bool, -- came in, still working
followup bool, -- follow-up
sold bool, -- sold
dead bool -- customer no longer interested, no follow-up
);
create table channels (
num int unsigned not null primary key, -- foreign key of calls.channel
label varchar(255) not null -- descriptive name
);
create table users (
name varchar(255) not null primary key,
type varchar(30) not null, -- "user", "admin"
channelview int unsigned not null -- set of channels viewable by this user
-- implemented as a bitfield
-- the lowest bit corresponds to channel 1
);
-- Local customisations
--
-- Edit these two insert statements as appropriate for the new site.
-- A future release will initialise these tables via a separate script.
insert into channels (num, label) values
(1, "New Cars"),
(2, "Used Cars"),
(3, "Channel 3"),
(4, "Channel 4"),
(5, "Channel 5"),
(6, "Channel 6"),
(7, "Channel 7"),
(8, "Channel 8");
Help would be very much appreciated. Thank you for your time :).
Createdb.sql goes in first, then createtestdb.sql to put some dummy data in
there.
I have setup a db indigite_phone with user indigote_logger password
test.
I have just dropped and recreated the database so its empty.
The Two MySQL codes I am getting an error with are:
For createtestdb.sql:
use indigote_phone;
-- Create some fake data for testing
insert into users (name, type, channelview) values
("admin", "admin", 255),
("nick", "user", 15),
("stephen", "admin", 15),
("newcars", "user", 1),
("usedcars", "user", 2),
("manager", "user", 15);
insert into calls (filename, start, duration, channelnum, salesrep,
customer, sales, appt, ciw, followup, sold, dead) values
("call1.wav", "2003-07-02 16-01-00", 150, 1, null, null, 1, 0, 0, 0, 0, 0),
("call2.wav", "2003-07-02 16-02-00", 150, 2, null, null, 1, 0, 0, 0, 0, 0),
("call3.wav", "2003-07-02 16-03-00", 150, 2, null, null, 1, 0, 0, 0, 0, 0),
("call4.wav", "2003-07-02 16-03-00", 150, 1, null, null, 1, 0, 0, 0, 0, 0),
("call5.wav", "2003-07-02 16-04-00", 950, 1, "SY", "alison", 1, 0, 0, 0, 0, 0),
("call6.wav", "2003-07-02 16-05-00", 150, 2, "NC", "sarah", 1, 1, 0, 0, 0, 0),
("call7.wav", "2003-07-02 16-06-00", 150, 1, "SY", "beth", 1, 1, 1, 0, 1, 0),
("call8.wav", "2003-07-02 16-07-00", 150, 1, "SY", "kate", 1, 0, 0, 1, 0, 0),
("call9.wav", "2003-07-02 16-08-00", 150, 2, "NC", "kate", 1, 0, 0, 1, 0, 0),
("call10.wav", "2003-07-02 16-09-00", 150, 1, "SY", "kate", 1, 0, 0, 1, 0, 0),
("call11.wav", "2003-07-02 16-10-00", 150, 1, "SY", "kate", 1, 0, 0, 1, 0, 0),
("call12.wav", "2003-07-02 16-11-00", 150, 2, "NC", "kate", 1, 0, 0, 1, 0, 0),
("call13.wav", "2003-07-02 16-12-00", 150, 1, "SY", "kate", 1, 0, 0, 1, 0, 0),
("call14.wav", "2003-07-02 16-13-00", 150, 1, "SY", "sue", 1, 1, 0, 0, 0, 1);
For createdb.sql:
use indigote_phone;
create table calls (
id int unsigned not null auto_increment primary key,
filename varchar(255) not null,
start datetime not null,
duration int unsigned not null, -- Duration in seconds
channelnum int unsigned not null,
salesrep char(3),
customer varchar(255),
sales bool default 1, -- sales enquiry
appt bool, -- appointment made
ciw bool, -- came in, still working
followup bool, -- follow-up
sold bool, -- sold
dead bool -- customer no longer interested, no follow-up
);
create table channels (
num int unsigned not null primary key, -- foreign key of calls.channel
label varchar(255) not null -- descriptive name
);
create table users (
name varchar(255) not null primary key,
type varchar(30) not null, -- "user", "admin"
channelview int unsigned not null -- set of channels viewable by this user
-- implemented as a bitfield
-- the lowest bit corresponds to channel 1
);
-- Local customisations
--
-- Edit these two insert statements as appropriate for the new site.
-- A future release will initialise these tables via a separate script.
insert into channels (num, label) values
(1, "New Cars"),
(2, "Used Cars"),
(3, "Channel 3"),
(4, "Channel 4"),
(5, "Channel 5"),
(6, "Channel 6"),
(7, "Channel 7"),
(8, "Channel 8");
Help would be very much appreciated. Thank you for your time :).
