Article View: borland.public.interbase.sql
Article #242Problems with creating an array column with Firebird 2.0.3 sql
From: Joachim Aicher
Date: Wed, 18 Jun 2008 12:46
Date: Wed, 18 Jun 2008 12:46
42 lines
2274 bytes
2274 bytes
Hello everybody,
I want to create a table containing an array column.
I created it with the following sql command:
"CREATE TABLE Table1 (Array1 INTEGER[4])"
However, FlameRobin gives me the following table properties:
Table = TABLE1, Field = ARRAY1, Type = Integer
Additionally, writing to this "array" with the IBPP method WriteTo(db,
tr) gives me the exception
***IBPP::SQLException***
Context: Array::Lookup
Message: isc_array_lookup_bounds failed.
SQL Message: -205
column is not defined in table
Engine Code :335544396
Engine Message:
column Array1 is not defined in Table1
Here is a short excerpt of my test code (using IBPP):
Database db = DatabaseFactory("", "JackDb.fdb", "jack", "12345", "",
"UNICODE_FSS", "PAGE_SIZE = 4096 DEFAULT CHARACTER SET UNICODE_FSS");
db->Create(3);
db->Connect();
Transaction tr = TransactionFactory(db);
tr->Start();
Statement st = StatementFactory(db, tr);
st->Execute("CREATE TABLE Table1 (Array1 INTEGER[4])");
tr->Commit();
Array ar = ArrayFactory(db, tr);
ar->Describe("Table1", "Array1");
int buffer[4] = {1, 2, 3, 4};
ar->WriteFrom(adInt32, buffer, sizeof(buffer)/sizeof(int));
What is wrong with the creation of the array column or with other parts
of my code?
Thanks a lot for helping me.
Joachim
Technical Details
Message-ID:
<485903b5@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,5b7a23b735b3e6d2,start X-Google-Attributes: gid114a0e,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Wed, 18 Jun 2008 14:46:42 +0200 From: Joachim Aicher <jaicher@leibinger-group.com> User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 Newsgroups: borland.public.interbase.sql Subject: Problems with creating an array column with Firebird 2.0.3 sql Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 87.179.20.118 Message-ID: <485903b5@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1213793205 87.179.20.118 (18 Jun 2008 05:46:45 -0700) Lines: 42 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail X-Original-Bytes: 2084