Merhaba,
Dsql ile update ve insert ile dizi tiplerine düzeltme ve veri eklemeye izin verilmiyor. Aşağıdaki linkte api kullanmayı veya 3. parti bir component kullanmayı tavsiye etmiş. Ya da olmayan ingilizcem ile ben öyle anladım.
Bu gün bir dizi tanımlayıp kullanayım dedim. Anlayacağınız boşa kürek sallamışım.
http://sourceforge.net/mailarchive/foru ... um_id=6330
adresinde şöyle bir mesaj geçmiş.
Kod: Tümünü seç
>Category: Core Engine
>Group: As Designed/Pitfall
>Status: Deleted
>Resolution: Rejected
Priority: 5
Submitted By: -- (pabloj)
Assigned to: Nobody/Anonymous (nobody)
Summary: Array datatype bug in isql Firebird 1.5.2
Initial Comment:
Hi, I"m doing some experiments with array datatypes, to
build a GIS like database, in Firebird 1.5.2 on Windows
2000 server.
I"ve successfully created an array domain and I"m able
to insert data, but I"m not getting back the expected
results.
Here is the workflow:
I created a domain:
CREATE DOMAIN POINT FLOAT [1:2]
and a table
CREATE TABLE ZIP_CODES (STATE_FIPS_CODE CHAR(2),
ZIP_CODE CHAR(5) NOT NULL, STATE_ABBREVIATION CHAR(2),
ZIP_CODE_NAME VARCHAR(50), ZIP_LOC POINT,
POPULATION_1990 INTEGER, ALLOCATION_FACTOR FLOAT,
PRIMARY KEY (ZIP_CODE))
Now I have troubles in using this table, this is what
I"m doing:
SQL> insert into zip_codes values ("wp", "12345", "wp",
"pippo", "12:3", 123456,
23.5);
I"m trying to insert a POINT of coordinates x=12, y=3
The insert seem to work but when I do a select I get
back "8b:0" which is not what I expected:
From the command line with isql (firebird 1_5_2)
SQL> select * from zip_codes;
STATE_FIPS_CODE ZIP_CODE STATE_ABBREVIATION ZIP_CODE_NAME
ZIP_LOC POPULATION_1990
ALLOCATION_FACTOR
=============== ======== ==================
====================================
============== ================= ===============
=================
wp 12345 wp pippo
8b:0 123456
23.500000
----------------------------------------------------------------------
>Comment By: Claudio Valderrama C. (robocop)
Date: 2004-12-30 23:34
Message:
Logged In: YES
user_id=62823
Inserting and updating arrays with literals is not supported
in DSQL. You have to use the API. If you don"t want that,
there are several third party connectivity packages that
will isolate you from the API to work with arrays. Natively,
you can only select individual elements of an array in DSQL:
select zip_loc[1] from zip_codes;
Your insertion caused crap to be injected into the array,
not what you expected. It was a lack of enough validation in
FB1.5 and FB1. In FB2 you get:
SQL> insert into zip_codes values ("wp", "12345", "wp",
CON> "pippo", "12:3", 123456,
CON> 23.5);
Statement failed, SQLCODE = -413
conversion error from string "BLOB"
İyi çalışmalar.