Invalid defaulted table ?

Database
New Member

Invalid defaulted table ?

Hi -

I've a question to which I can't find a satisfying answer and I hope someone may be able to respond with 'chapter and verse' information.

The following SQL works in TD 14.10 as long as there is a 'DB_WRK' database available for the user to create the two tables indicated:

CREATE SET TABLE DB_WRK.TABLE1_TEST (COLUMN_TABLE1_1 CHAR(5)) PRIMARY INDEX (COLUMN_TABLE1_1);

CREATE SET TABLE DB_WRK.TABLE2_TEST (COLUMN_TABLE2_1 CHAR(5)) PRIMARY INDEX (COLUMN_TABLE2_1);

INSERT INTO DB_WRK.TABLE1_TEST (COLUMN_TABLE1_1) VALUES ('TAB1');

INSERT INTO DB_WRK.TABLE2_TEST (COLUMN_TABLE2_1) VALUES ('TAB2');

SELECT TABLE1_TEST.COLUMN_TABLE1_1, TABLE2_TEST.COLUMN_TABLE2_1 FROM DB_WRK.TABLE1_TEST;

NOTE: The select query produces data, even though TABLE2_TEST is not referenced in the FROM clause and there is no session DATABASE default set.

To me, it seems that the SELECT should fail out with some syntax error, but it does not.

The query evaluates exactly as

SELECT COLUMN_TABLE1_1, COLUMN_TABLE2_1 from DB_WRK.TABLE1_TEST, DB_WRK.TABLE2_TEST;

Is this 'feature' documented?

Tags (1)
1 REPLY
Junior Contributor

Re: Invalid defaulted table ?