If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Perl and the DBI > INSERT error into table with COLLATE keyword

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-16-11, 04:01
trs319843 trs319843 is offline
Registered User
 
Join Date: Aug 2011
Posts: 1
INSERT error into table with COLLATE keyword

Hello,

I am trying to INSERT into a table as follows -
****************************************
# 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 -
****************************************
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 -
****************************************
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
Reply With Quote
Reply

Tags
collate, dbi, insert, perl

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On