Debt Consolidation - Electronics - TV News - Cheat Codes - Debt Consolidation

PDA

View Full Version : SQL Statement help


obenix
Nov 15th 2005, 9:58 pm
I'm writing a restore function for my application and basically it drops a table and recreates based on an earlier backup. When I run the SQL query, an error occured. Can you please tell me what's wrong with my SQL statement here?

drop table if exists tbl_transaction;
create table tbl_transaction (
trans_num int(11) not null auto_increment,
transtype_id varchar(100) not null,
license_id varchar(100) not null,
trans_qty int(11) default '0' not null,
trans_date date default '0000-00-00' not null,
trans_alloc_date date default '0000-00-00' not null,
trans_po_num varchar(100),
trans_po_date date default '0000-00-00',
trans_do_num varchar(100),
trans_do_date date default '0000-00-00',
trans_inv_num varchar(100),
trans_inv_date date default '0000-00-00',
trans_timestamp timestamp default 'CURRENT_TIMESTAMP',
trans_remarks varchar(100)
);

norfstar
Nov 16th 2005, 12:01 am
I think that it might be the case that auto_increment columns need to be key.

obenix
Nov 16th 2005, 12:58 am
Oops!! Trying it.. :)

--edit--
Yes, it worked!! Thanks for the help. Greened you :D