CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: DBI:
INSERT error into table with COLLATE keyword

 



trs319843
New User

Aug 16, 2011, 2:21 AM

Post #1 of 1 (6444 views)
INSERT error into table with COLLATE keyword Can't Post

Hello,

I am trying to INSERT into a table as follows -

Code
# Open configdb db of that version 
$dbc = DBI->connect("dbiQLite:$confdbfname")
|| die "Cannot connect DBI::errstr";

$stmtc = <<EOS;
INSERT INTO domain_info
(is_anon_bind, domain, type, nc_id)
values
(?,?,?,?)
EOS

$stmthc = $dbc->prepare($stmtc) || die "Cannot prepare DBI::errstr";


The schema of the table is as follows -

Code
CREATE TABLE domain_info ( 
domain_id INTEGER PRIMARY KEY AUTOINCREMENT,
is_anon_bind INTEGER,
domain TEXT COLLATE NOCASE NOT NULL,
type INTEGER,
nc_id INTEGER,
user TEXT COLLATE NOCASE,
userdomain TEXT COLLATE NOCASE,
password TEXT,
dc TEXT,
custom_attr TEXT);
CREATE UNIQUE INDEX domain_name ON domain_info(domain);


But, I am getting error as follows -

Code
DBD:QLite::db prepare failed: malformed database schema - near "COLLATE": syntax error(11) at dbdimp.c line 271 at mxload.pl lin 
at mxload.pl line 914
main::do_users(1, 'C:\DataInsight\sim', 'HASH(0x378930)') called at mxload.pl line 175
main::do_main() called at mxload.pl line 1309
Cannot prepare DBI::errstr at mxload.pl line 914.
at mxload.pl line 914
main::do_users(1, 'C:\DataInsight\sim', 'HASH(0x378930)') called at mxload.pl line 175
main::do_main() called at mxload.pl line 1309


Any help on this would be highly appreciated !

Thanks in advance...

Cheers,
trs319843

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives