🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.interbase.sql
2 messages
2 total messages Started by Joachim Aicher Wed, 18 Jun 2008 12:46
Problems with creating an array column with Firebird 2.0.3 sql
#242
Author: Joachim Aicher
Date: Wed, 18 Jun 2008 12:46
42 lines
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
Re: Problems with creating an array column with Firebird 2.0.3 sql
#243
Author: Bill Todd [TeamB]
Date: Wed, 18 Jun 2008 14:17
9 lines
1379 bytes
Are you using Firebird or InterBase? If you are using Firebird you
should post your questions in the Firebird support list.

Using array columns is a bad idea. There is very limited support for
them in SQL. The only way to use array columns effectively is to write
API calls.

-- 
Bill Todd (TeamB)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads