On 08/26/2015 05:02 PM, Jiří Činčura wrote:
> Hi *,
>
> I'm looking at DNET-313 and the code get from server "subscript out of 
> bounds". Can somebody tell me what that means? I have never used (and will 
> never use ;)) arrays, so this is new to me.
>

Jiri, rather hard to explain text which is so clear to me. Look at 
employee database:

# isql employee
SQL> show table JOB;
JOB_CODE                        (JOBCODE) VARCHAR(5) Not Null
                                 CHECK (VALUE > '99999')
JOB_GRADE                       (JOBGRADE) SMALLINT Not Null
                                 CHECK (VALUE BETWEEN 0 AND 6)
JOB_COUNTRY                     (COUNTRYNAME) VARCHAR(15) Not Null
JOB_TITLE                       VARCHAR(25) Not Null
MIN_SALARY                      (SALARY) NUMERIC(10, 2) Not Null DEFAULT 0
                                 CHECK (VALUE > 0)
MAX_SALARY                      (SALARY) NUMERIC(10, 2) Not Null DEFAULT 0
                                 CHECK (VALUE > 0)
JOB_REQUIREMENT                 BLOB segment 400, subtype TEXT Nullable
LANGUAGE_REQ                    ARRAY OF [5]
                                 VARCHAR(15) Nullable

SQL> select LANGUAGE_REQ[2] from JOB where LANGUAGE_REQ is not null;

LANGUAGE_REQ
===============
Mandarin

German

German

Spanish

German

French

French

English

German

French


SQL> select LANGUAGE_REQ[0] from JOB where LANGUAGE_REQ is not null;

LANGUAGE_REQ
===============
Statement failed, SQLSTATE = 42000
subscript out of bounds
SQL> select LANGUAGE_REQ[6] from JOB where LANGUAGE_REQ is not null;

LANGUAGE_REQ
===============
Statement failed, SQLSTATE = 42000
subscript out of bounds

---------------------------------------------------

I.e. you get this error when try to use subscript which is out of bounds 
for an array.


------------------------------------------------------------------------------
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to