2001-11-26 02:52:23 +01:00
|
|
|
drop table if exists t1;
|
|
|
|
CREATE TABLE t1 (
|
2003-03-22 19:34:20 +01:00
|
|
|
ChargeID int(10) unsigned NOT NULL auto_increment,
|
2001-09-28 07:05:54 +02:00
|
|
|
ServiceID int(10) unsigned DEFAULT '0' NOT NULL,
|
|
|
|
ChargeDate date DEFAULT '0000-00-00' NOT NULL,
|
|
|
|
ChargeAmount decimal(20,2) DEFAULT '0.00' NOT NULL,
|
|
|
|
FedTaxes decimal(20,2) DEFAULT '0.00' NOT NULL,
|
|
|
|
ProvTaxes decimal(20,2) DEFAULT '0.00' NOT NULL,
|
|
|
|
ChargeStatus enum('New','Auth','Unauth','Sale','Denied','Refund')
|
|
|
|
DEFAULT 'New' NOT NULL,
|
|
|
|
ChargeAuthorizationMessage text,
|
|
|
|
ChargeComment text,
|
|
|
|
ChargeTimeStamp varchar(20),
|
|
|
|
PRIMARY KEY (ChargeID),
|
|
|
|
KEY ServiceID (ServiceID),
|
|
|
|
KEY ChargeDate (ChargeDate)
|
2003-12-10 05:31:42 +01:00
|
|
|
) engine=BDB;
|
2001-09-28 07:05:54 +02:00
|
|
|
BEGIN;
|
2001-11-26 02:52:23 +01:00
|
|
|
INSERT INTO t1
|
2001-09-28 07:05:54 +02:00
|
|
|
VALUES(NULL,1,'2001-03-01',1,1,1,'New',NULL,NULL,'now');
|
|
|
|
COMMIT;
|
|
|
|
BEGIN;
|
2001-11-26 02:52:23 +01:00
|
|
|
UPDATE t1 SET ChargeAuthorizationMessage = 'blablabla' WHERE
|
2001-09-28 07:05:54 +02:00
|
|
|
ChargeID = 1;
|
|
|
|
COMMIT;
|
2001-11-26 02:52:23 +01:00
|
|
|
INSERT INTO t1
|
2001-09-28 07:05:54 +02:00
|
|
|
VALUES(NULL,1,'2001-03-01',1,1,1,'New',NULL,NULL,'now');
|
2001-11-26 02:52:23 +01:00
|
|
|
select * from t1;
|
2001-03-01 20:01:00 +01:00
|
|
|
ChargeID ServiceID ChargeDate ChargeAmount FedTaxes ProvTaxes ChargeStatus ChargeAuthorizationMessage ChargeComment ChargeTimeStamp
|
|
|
|
1 1 2001-03-01 1.00 1.00 1.00 New blablabla NULL now
|
|
|
|
2 1 2001-03-01 1.00 1.00 1.00 New NULL NULL now
|
2001-11-26 02:52:23 +01:00
|
|
|
drop table t1;
|