File: schemas.out

package info (click to toggle)
derby 10.14.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 78,896 kB
  • sloc: java: 691,930; sql: 42,686; xml: 20,511; sh: 3,373; sed: 96; makefile: 60
file content (1002 lines) | stat: -rw-r--r-- 49,183 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
ij> --
--   Licensed to the Apache Software Foundation (ASF) under one or more
--   contributor license agreements.  See the NOTICE file distributed with
--   this work for additional information regarding copyright ownership.
--   The ASF licenses this file to You under the Apache License, Version 2.0
--   (the "License"); you may not use this file except in compliance with
--   the License.  You may obtain a copy of the License at
--
--      http://www.apache.org/licenses/LICENSE-2.0
--
--   Unless required by applicable law or agreed to in writing, software
--   distributed under the License is distributed on an "AS IS" BASIS,
--   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--   See the License for the specific language governing permissions and
--   limitations under the License.
--
--
-- this test shows the current supported schema functionality, which
-- isn't much.  Currently, we have no CREATE SCHEMA statement, though
-- we do understand schema names in table names
--
-- Catalog names are not supported, and result in syntax errors when used.
--

create table myschem.t(c int);
0 rows inserted/updated/deleted
ij> insert into t values (1);
ERROR 42X05: Table/View 'T' does not exist.
ij> insert into blah.t values (2);
ERROR 42Y07: Schema 'BLAH' does not exist
ij> insert into blah.blah.t values (3);
ERROR 42X01: Syntax error: Encountered "." at line 1, column 22.
Issue the 'help' command for general information on IJ command syntax.
Any unrecognized commands are treated as potential SQL commands and executed directly.
Consult your DBMS server reference documentation for details of the SQL syntax supported by your server.
ij> insert into blah.blah.blah.t values (3);
ERROR 42X01: Syntax error: Encountered "." at line 1, column 22.
Issue the 'help' command for general information on IJ command syntax.
Any unrecognized commands are treated as potential SQL commands and executed directly.
Consult your DBMS server reference documentation for details of the SQL syntax supported by your server.
ij> select "goofy name".t.c  from "goofy name".t;
ERROR 42Y07: Schema 'goofy name' does not exist
ij> -- catalog name not supported:
create table mycat.myschem.s(c int);
ERROR 42X01: Syntax error: Encountered "." at line 2, column 27.
Issue the 'help' command for general information on IJ command syntax.
Any unrecognized commands are treated as potential SQL commands and executed directly.
Consult your DBMS server reference documentation for details of the SQL syntax supported by your server.
ij> -- name too long:
create table myworld.mycat.myschem.s(c int);
ERROR 42X01: Syntax error: Encountered "." at line 2, column 27.
Issue the 'help' command for general information on IJ command syntax.
Any unrecognized commands are treated as potential SQL commands and executed directly.
Consult your DBMS server reference documentation for details of the SQL syntax supported by your server.
ij> create table myschem.s(c int);
0 rows inserted/updated/deleted
ij> insert into s values (1);
ERROR 42X05: Table/View 'S' does not exist.
ij> insert into honk.s values (2);
ERROR 42Y07: Schema 'HONK' does not exist
ij> insert into honk.blat.s values (3);
ERROR 42X01: Syntax error: Encountered "." at line 1, column 22.
Issue the 'help' command for general information on IJ command syntax.
Any unrecognized commands are treated as potential SQL commands and executed directly.
Consult your DBMS server reference documentation for details of the SQL syntax supported by your server.
ij> insert into loud.honk.blat.s values (4);
ERROR 42X01: Syntax error: Encountered "." at line 1, column 22.
Issue the 'help' command for general information on IJ command syntax.
Any unrecognized commands are treated as potential SQL commands and executed directly.
Consult your DBMS server reference documentation for details of the SQL syntax supported by your server.
ij> -- Catalog names in column expressions cause syntax errors.  Rather than
-- fix this, I am checking it in this way, considering that no client we
-- know of uses catalogs.
--							-	Jeff
--
-- select honk.blat.s.c from honk.blat.s;

drop table xyzzy.t;
ERROR 42Y07: Schema 'XYZZY' does not exist
ij> -- catalog name not supported:
drop table goodness.gosh.s;
ERROR 42X01: Syntax error: Encountered "." at line 2, column 25.
Issue the 'help' command for general information on IJ command syntax.
Any unrecognized commands are treated as potential SQL commands and executed directly.
Consult your DBMS server reference documentation for details of the SQL syntax supported by your server.
ij> -- finds s, schema name ignored:
drop table gosh.s;
ERROR 42Y07: Schema 'GOSH' does not exist
ij> -- tests for qualified names in select, relative to method invocations
create table mytab (i int);
0 rows inserted/updated/deleted
ij> create table APP.mytab2 (i int);
0 rows inserted/updated/deleted
ij> insert into mytab values 1,2,3;
3 rows inserted/updated/deleted
ij> insert into APP.mytab2 values 1,2,3;
3 rows inserted/updated/deleted
ij> -- plain and just table names match up fine
select i, mytab.i from mytab;
I          |I          
-----------------------
1          |1          
2          |2          
3          |3          
ij> -- schema names on columns
select APP.mytab2.i from APP.mytab2;
I          
-----------
1          
2          
3          
ij> select APP.mytab2.i from mytab2;
I          
-----------
1          
2          
3          
ij> select mytab2.i from APP.mytab2;
I          
-----------
1          
2          
3          
ij> -- schema names correlation names:
select m.i from APP.mytab2 m;
I          
-----------
1          
2          
3          
ij> -- syntax errors on catalog names
select nocatalogs.APP.mytab.i from mytab2;
ERROR 42X04: Column 'NOCATALOGS.APP.MYTAB' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'NOCATALOGS.APP.MYTAB' is not a column in the target table.
ij> drop table mytab;
0 rows inserted/updated/deleted
ij> drop table APP.mytab2;
0 rows inserted/updated/deleted
ij> ------------------------------------------------
--
-- Now, we'll try to create and drop some schemas
--
------------------------------------------------
create schema app;
ERROR X0Y68: Schema 'APP' already exists.
ij> create schema sys;
ERROR 42939: An object cannot be created with the schema name 'SYS'.
ij> -- negative drop test
drop schema does_not_exist RESTRICT;
ERROR 42Y07: Schema 'DOES_NOT_EXIST' does not exist
ij> -- negative create test - should not be able to create existing system schemas;
create schema app;
ERROR X0Y68: Schema 'APP' already exists.
ij> create schema APP;
ERROR X0Y68: Schema 'APP' already exists.
ij> create schema sys;
ERROR 42939: An object cannot be created with the schema name 'SYS'.
ij> create schema SYS;
ERROR 42939: An object cannot be created with the schema name 'SYS'.
ij> create schema sysibm;
ERROR 42939: An object cannot be created with the schema name 'SYSIBM'.
ij> create schema SYSIBM;
ERROR 42939: An object cannot be created with the schema name 'SYSIBM'.
ij> create schema syscat;
ERROR 42939: An object cannot be created with the schema name 'SYSCAT'.
ij> create schema SYSCAT;
ERROR 42939: An object cannot be created with the schema name 'SYSCAT'.
ij> create schema sysfun;
ERROR 42939: An object cannot be created with the schema name 'SYSFUN'.
ij> create schema SYSFUN;
ERROR 42939: An object cannot be created with the schema name 'SYSFUN'.
ij> create schema sysproc;
ERROR 42939: An object cannot be created with the schema name 'SYSPROC'.
ij> create schema SYSPROC;
ERROR 42939: An object cannot be created with the schema name 'SYSPROC'.
ij> create schema sysstat;
ERROR 42939: An object cannot be created with the schema name 'SYSSTAT'.
ij> create schema SYSSTAT;
ERROR 42939: An object cannot be created with the schema name 'SYSSTAT'.
ij> create schema syscs_diag;
ERROR 42939: An object cannot be created with the schema name 'SYSCS_DIAG'.
ij> create schema SYSCS_DIAG;
ERROR 42939: An object cannot be created with the schema name 'SYSCS_DIAG'.
ij> create schema syscs_util;
ERROR 42939: An object cannot be created with the schema name 'SYSCS_UTIL'.
ij> create schema SYSCS_UTIL;
ERROR 42939: An object cannot be created with the schema name 'SYSCS_UTIL'.
ij> create schema nullid;
ERROR X0Y68: Schema 'NULLID' already exists.
ij> create schema NULLID;
ERROR X0Y68: Schema 'NULLID' already exists.
ij> create schema sqlj;
ERROR X0Y68: Schema 'SQLJ' already exists.
ij> create schema SQLJ;
ERROR X0Y68: Schema 'SQLJ' already exists.
ij> -- negative create test - should not be able to objects in system schemas
create table syscat.foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSCAT' schema.
ij> create table sysfun.foo2 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSFUN' schema.
ij> create table sysproc.foo3 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSPROC' schema.
ij> create table sysstat.foo4 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSSTAT' schema.
ij> create table syscs_diag.foo6 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSCS_DIAG' schema.
ij> create table nullid.foo7 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'NULLID' schema.
ij> create table sysibm.foo8 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSIBM' schema.
ij> create table sqlj.foo8 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SQLJ' schema.
ij> create table syscs_util.foo9 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSCS_UTIL' schema.
ij> create table SYSCAT.foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSCAT' schema.
ij> create table SYSFUN.foo2 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSFUN' schema.
ij> create table SYSPROC.foo3 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSPROC' schema.
ij> create table SYSSTAT.foo4 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSSTAT' schema.
ij> create table SYSCS_DIAG.foo6 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSCS_DIAG' schema.
ij> create table SYSIBM.foo8 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSIBM' schema.
ij> create table SQLJ.foo8 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SQLJ' schema.
ij> create table SYSCS_UTIL.foo9 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSCS_UTIL' schema.
ij> -- negative drop test - should not be able to drop system schema's
drop schema app RESTRICT;
0 rows inserted/updated/deleted
ij> drop schema APP RESTRICT;
ERROR 42Y07: Schema 'APP' does not exist
ij> drop schema sys RESTRICT;
ERROR 42Y67: Schema 'SYS' cannot be dropped.
ij> drop schema SYS RESTRICT;
ERROR 42Y67: Schema 'SYS' cannot be dropped.
ij> drop schema sysibm RESTRICT;
ERROR 42Y67: Schema 'SYSIBM' cannot be dropped.
ij> drop schema SYSIBM RESTRICT;
ERROR 42Y67: Schema 'SYSIBM' cannot be dropped.
ij> drop schema syscat RESTRICT;
ERROR 42Y67: Schema 'SYSCAT' cannot be dropped.
ij> drop schema SYSCAT RESTRICT;
ERROR 42Y67: Schema 'SYSCAT' cannot be dropped.
ij> drop schema sysfun RESTRICT;
ERROR 42Y67: Schema 'SYSFUN' cannot be dropped.
ij> drop schema SYSFUN RESTRICT;
ERROR 42Y67: Schema 'SYSFUN' cannot be dropped.
ij> drop schema sysproc RESTRICT;
ERROR 42Y67: Schema 'SYSPROC' cannot be dropped.
ij> drop schema SYSPROC RESTRICT;
ERROR 42Y67: Schema 'SYSPROC' cannot be dropped.
ij> drop schema sysstat RESTRICT;
ERROR 42Y67: Schema 'SYSSTAT' cannot be dropped.
ij> drop schema SYSSTAT RESTRICT;
ERROR 42Y67: Schema 'SYSSTAT' cannot be dropped.
ij> drop schema syscs_diag RESTRICT;
ERROR 42Y67: Schema 'SYSCS_DIAG' cannot be dropped.
ij> drop schema SYSCS_DIAG RESTRICT;
ERROR 42Y67: Schema 'SYSCS_DIAG' cannot be dropped.
ij> drop schema syscs_util RESTRICT;
ERROR 42Y67: Schema 'SYSCS_UTIL' cannot be dropped.
ij> drop schema SYSCS_UTIL RESTRICT;
ERROR 42Y67: Schema 'SYSCS_UTIL' cannot be dropped.
ij> drop schema nullid RESTRICT;
ERROR 42Y67: Schema 'NULLID' cannot be dropped.
ij> drop schema NULLID RESTRICT;
ERROR 42Y67: Schema 'NULLID' cannot be dropped.
ij> drop schema sqlj RESTRICT;
ERROR 42Y67: Schema 'SQLJ' cannot be dropped.
ij> drop schema SQLJ RESTRICT;
ERROR 42Y67: Schema 'SQLJ' cannot be dropped.
ij> create schema app;
0 rows inserted/updated/deleted
ij> set schema app;
0 rows inserted/updated/deleted
ij> create table test (a int);
0 rows inserted/updated/deleted
ij> -- negative create test - should not be able to objects in system schemas
set schema syscat;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSCAT' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SYSCAT' schema.
ij> set schema sysfun;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSFUN' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SYSFUN' schema.
ij> set schema sysproc;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSPROC' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SYSPROC' schema.
ij> set schema sysstat;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSSTAT' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SYSSTAT' schema.
ij> set schema sysstat;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSSTAT' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SYSSTAT' schema.
ij> set schema syscs_diag;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSCS_DIAG' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SYSCS_DIAG' schema.
ij> set schema syscs_util;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSCS_UTIL' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SYSCS_UTIL' schema.
ij> set schema nullid;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'NULLID' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'NULLID' schema.
ij> set schema sysibm;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSIBM' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SYSIBM' schema.
ij> set schema sqlj;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SQLJ' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SQLJ' schema.
ij> set schema SYSCAT;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSCAT' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SYSCAT' schema.
ij> set schema SYSFUN;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSFUN' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SYSFUN' schema.
ij> set schema SYSPROC;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSPROC' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SYSPROC' schema.
ij> set schema SYSSTAT;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSSTAT' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SYSSTAT' schema.
ij> set schema SYSSTAT;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSSTAT' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SYSSTAT' schema.
ij> set schema SYSCS_DIAG;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSCS_DIAG' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SYSCS_DIAG' schema.
ij> set schema SYSCS_UTIL;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSCS_UTIL' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SYSCS_UTIL' schema.
ij> set schema NULLID;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'NULLID' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'NULLID' schema.
ij> set schema SYSIBM;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SYSIBM' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SYSIBM' schema.
ij> set schema SQLJ;
0 rows inserted/updated/deleted
ij> create table foo1 (a int);
ERROR 42X62: 'CREATE TABLE' is not allowed in the 'SQLJ' schema.
ij> create view foo1 as select * from app.test;
ERROR 42X62: 'CREATE VIEW' is not allowed in the 'SQLJ' schema.
ij> -- Negative tests. Disable use of schemas starting with SYS
set schema app;
0 rows inserted/updated/deleted
ij> create table t1 (c1 int);
0 rows inserted/updated/deleted
ij> create trigger sysblah.trig1 after update of c1 on t1 for each row insert into t1 values 1;
ERROR 42X62: 'CREATE TRIGGER' is not allowed in the 'SYSBLAH' schema.
ij> create procedure sysblah.dummy() language java external name 'NotReallyThere.NoMethod' parameter style java;
ERROR 42X62: 'CREATE PROCEDURE' is not allowed in the 'SYSBLAH' schema.
ij> drop table t1;
0 rows inserted/updated/deleted
ij> set schema app;
0 rows inserted/updated/deleted
ij> -- create a schema
create schema test;
0 rows inserted/updated/deleted
ij> -- create it again, should fail
create schema test;
ERROR X0Y68: Schema 'TEST' already exists.
ij> -- verify it
select schemaname, authorizationid 
	from sys.sysschemas 
	where CAST(schemaname AS VARCHAR(128)) = 'TEST';
SCHEMANAME                                                                                                                      |AUTHORIZATIONID                                                                                                                 
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TEST                                                                                                                            |APP                                                                                                                             
ij> -- create a table in test
set schema test;
0 rows inserted/updated/deleted
ij> create table sampletab (c1 int constraint st_c1 check (c1 > 1), c2 char(20));
0 rows inserted/updated/deleted
ij> insert into sampletab values (1,'in schema: TEST');
ERROR 23513: The check constraint 'ST_C1' was violated while performing an INSERT or UPDATE on table '"TEST"."SAMPLETAB"'.
ij> insert into sampletab values (2,'in schema: TEST');
1 row inserted/updated/deleted
ij> -- verify it
select schemaname, tablename, descriptor
	from sys.sysschemas s, sys.sysconglomerates c , sys.systables t
	where CAST(t.tablename AS VARCHAR(128)) = 'SAMPLETAB' 
		and s.schemaid = c.schemaid
		and c.tableid = t.tableid;
SCHEMANAME                                                                                                                      |TABLENAME                                                                                                                       |DESCRIPTOR     
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TEST                                                                                                                            |SAMPLETAB                                                                                                                       |NULL           
ij> -- do some ddl on said table
create index ixsampletab on sampletab(c1);
0 rows inserted/updated/deleted
ij> create index ix2sampletab on test.sampletab(c1);
0 rows inserted/updated/deleted
WARNING 01504: 'IX2SAMPLETAB' index not created because it is a duplicate of an existing index: 'IXSAMPLETAB'.
ij> create view vsampletab as select * from sampletab;
0 rows inserted/updated/deleted
ij> create view v2sampletab as select * from test.sampletab;
0 rows inserted/updated/deleted
ij> alter table sampletab add column c3 int;
0 rows inserted/updated/deleted
ij> -- switch schemas
set schema APP;
0 rows inserted/updated/deleted
ij> -- create table with same name in APP
create table sampletab (c1 int constraint st_c1 check(c1 > 1), c2 char(20));
0 rows inserted/updated/deleted
ij> insert into sampletab values (2,'in schema: APP');
1 row inserted/updated/deleted
ij> -- verify it
--
select schemaname, tablename, isindex as ind, descriptor as descr
from sys.sysschemas s, sys.sysconglomerates c , sys.systables t
where CAST(t.tablename AS VARCHAR(128)) = 'SAMPLETAB' 
	and s.schemaid = c.schemaid
	and c.tableid = t.tableid
order by schemaname, tablename, isindex;
SCHEMANAME                                                                                                                      |TABLENAME                                                                                                                       |IND  |DESCR          
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
APP                                                                                                                             |SAMPLETAB                                                                                                                       |false|NULL           
TEST                                                                                                                            |SAMPLETAB                                                                                                                       |false|NULL           
TEST                                                                                                                            |SAMPLETAB                                                                                                                       |true |BTREE (1)      
ij> -- select from both the tables
select * from sampletab;
C1         |C2                  
--------------------------------
2          |in schema: APP      
ij> select * from test.sampletab;
C1         |C2                  |C3         
--------------------------------------------
2          |in schema: TEST     |NULL       
ij> -- switch to the test schema
set schema test;
0 rows inserted/updated/deleted
ij> select * from sampletab;
C1         |C2                  |C3         
--------------------------------------------
2          |in schema: TEST     |NULL       
ij> select * from app.sampletab;
C1         |C2                  
--------------------------------
2          |in schema: APP      
ij> -- try a drop, should fail since we haven't
-- cleaned out everything in the schema
drop schema test RESTRICT;
ERROR X0Y54: Schema 'TEST' cannot be dropped because it is not empty.
ij> -- make sure use the correct schema for various ddl
drop view vsampletab;
0 rows inserted/updated/deleted
ij> drop view v2sampletab;
0 rows inserted/updated/deleted
ij> drop index ixsampletab;
0 rows inserted/updated/deleted
ij> drop index ix2sampletab;
ERROR 42X65: Index 'IX2SAMPLETAB' does not exist.
ij> alter table sampletab add column c4 int;
0 rows inserted/updated/deleted
ij> select * from sampletab;
C1         |C2                  |C3         |C4         
--------------------------------------------------------
2          |in schema: TEST     |NULL       |NULL       
ij> -- get rid of last object in test
drop table sampletab;
0 rows inserted/updated/deleted
ij> -- try a drop now, should be ok
drop schema test RESTRICT;
0 rows inserted/updated/deleted
ij> -- use quoted id
create schema "heLLo";
0 rows inserted/updated/deleted
ij> create schema "sys";
0 rows inserted/updated/deleted
ij> -- should fail
drop schema "hello" RESTRICT;
ERROR 42Y07: Schema 'hello' does not exist
ij> -- ok
drop schema "heLLo" RESTRICT;
0 rows inserted/updated/deleted
ij> drop schema "sys" RESTRICT;
0 rows inserted/updated/deleted
ij> -- try prepared statements, should fail
prepare createSchema as 'create schema ?';
ERROR 42X01: Syntax error: Encountered "?" at line 1, column 15.
Issue the 'help' command for general information on IJ command syntax.
Any unrecognized commands are treated as potential SQL commands and executed directly.
Consult your DBMS server reference documentation for details of the SQL syntax supported by your server.
ij> prepare dropSchema as 'drop schema ? RESTRICT';
ERROR 42X01: Syntax error: Encountered "?" at line 1, column 13.
Issue the 'help' command for general information on IJ command syntax.
Any unrecognized commands are treated as potential SQL commands and executed directly.
Consult your DBMS server reference documentation for details of the SQL syntax supported by your server.
ij> --
-- specific drop schema tests, all should fail
--
create schema x;
0 rows inserted/updated/deleted
ij> set schema x;
0 rows inserted/updated/deleted
ij> create view vx as select * from sys.sysschemas;
0 rows inserted/updated/deleted
ij> drop schema x RESTRICT;
ERROR X0Y54: Schema 'X' cannot be dropped because it is not empty.
ij> drop view x.vx;
0 rows inserted/updated/deleted
ij> create table x (x int);
0 rows inserted/updated/deleted
ij> drop schema x restrict;
ERROR X0Y54: Schema 'X' cannot be dropped because it is not empty.
ij> drop table x.x;
0 rows inserted/updated/deleted
ij> -- syntax not supported yet (but is in the parser)
drop schema x cascade;
ERROR 42X01: Syntax error: Encountered "cascade" at line 2, column 15.
Issue the 'help' command for general information on IJ command syntax.
Any unrecognized commands are treated as potential SQL commands and executed directly.
Consult your DBMS server reference documentation for details of the SQL syntax supported by your server.
ij> set schema app;
0 rows inserted/updated/deleted
ij> drop schema x restrict;
0 rows inserted/updated/deleted
ij> --
-- test using schema names and correlation names
-- first test simple use of schema names
create schema test;
0 rows inserted/updated/deleted
ij> set schema test;
0 rows inserted/updated/deleted
ij> autocommit off;
ij> -- create the all type tables
create table s (i int, s smallint, c char(30), vc char(30));
0 rows inserted/updated/deleted
ij> create table t (i int, s smallint, c char(30), vc char(30));
0 rows inserted/updated/deleted
ij> create table tt (ii int, ss smallint, cc char(30), vcvc char(30));
0 rows inserted/updated/deleted
ij> create table ttt (iii int, sss smallint, ccc char(30), vcvcvc char(30));
0 rows inserted/updated/deleted
ij> -- populate the tables
insert into s values (null, null, null, null);
1 row inserted/updated/deleted
ij> insert into s values (0, 0, '0', '0');
1 row inserted/updated/deleted
ij> insert into s values (1, 1, '1', '1');
1 row inserted/updated/deleted
ij> insert into t values (null, null, null, null);
1 row inserted/updated/deleted
ij> insert into t values (0, 0, '0', '0');
1 row inserted/updated/deleted
ij> insert into t values (1, 1, '1', '1');
1 row inserted/updated/deleted
ij> insert into t values (1, 1, '1', '1');
1 row inserted/updated/deleted
ij> insert into tt values (null, null, null, null);
1 row inserted/updated/deleted
ij> insert into tt values (0, 0, '0', '0');
1 row inserted/updated/deleted
ij> insert into tt values (1, 1, '1', '1');
1 row inserted/updated/deleted
ij> insert into tt values (1, 1, '1', '1');
1 row inserted/updated/deleted
ij> insert into tt values (2, 2, '2', '2');
1 row inserted/updated/deleted
ij> insert into ttt values (null, null, null, null);
1 row inserted/updated/deleted
ij> insert into ttt values (11, 11, '11', '11');
1 row inserted/updated/deleted
ij> insert into ttt values (11, 11, '11', '11');
1 row inserted/updated/deleted
ij> insert into ttt values (22, 22, '22', '22');
1 row inserted/updated/deleted
ij> commit;
ij> set schema app;
0 rows inserted/updated/deleted
ij> -- test simple statements which use schema names
insert into test.t values (2, 2, '2', '2');
1 row inserted/updated/deleted
ij> update test.t set s = 2 where i = 2;
1 row inserted/updated/deleted
ij> update test.t set s = 2 where test.t.i = 2;
1 row inserted/updated/deleted
ij> delete from test.t where i = 1;
2 rows inserted/updated/deleted
ij> select * from test.t;
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
NULL       |NULL  |NULL                          |NULL                          
0          |0     |0                             |0                             
2          |2     |2                             |2                             
ij> insert into test.t values (1, 1, '1', '1');
1 row inserted/updated/deleted
ij> insert into test.t values (1, 1, '1', '1');
1 row inserted/updated/deleted
ij> -- test correlated names with tables and schema names
select * from test.t t1;
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
NULL       |NULL  |NULL                          |NULL                          
0          |0     |0                             |0                             
2          |2     |2                             |2                             
1          |1     |1                             |1                             
1          |1     |1                             |1                             
ij> -- test subqueries

select * from test.s where exists (select test.s.* from test.t);
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
NULL       |NULL  |NULL                          |NULL                          
0          |0     |0                             |0                             
1          |1     |1                             |1                             
ij> select * from test.s t where exists (select t.* from test.t);
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
NULL       |NULL  |NULL                          |NULL                          
0          |0     |0                             |0                             
1          |1     |1                             |1                             
ij> select * from test.s u where exists (select u.* from test.t);
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
NULL       |NULL  |NULL                          |NULL                          
0          |0     |0                             |0                             
1          |1     |1                             |1                             
ij> -- column reference in select list
select * from test.s where exists (select i from test.t);
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
NULL       |NULL  |NULL                          |NULL                          
0          |0     |0                             |0                             
1          |1     |1                             |1                             
ij> select * from test.s where exists (select test.t.i from test.t);
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
NULL       |NULL  |NULL                          |NULL                          
0          |0     |0                             |0                             
1          |1     |1                             |1                             
ij> -- derived table in the from list
select 1 from test.s where exists (select * from (select * from test.t) x);
1          
-----------
1          
1          
1          
ij> select 1 from test.s where exists (select * from (select * from test.t) x (i, s, c, vc) );
1          
-----------
1          
1          
1          
ij> -- subquery in derived table
select * from 
(select * from test.s where exists (select * from test.t) and i = 0) a;
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
0          |0     |0                             |0                             
ij> -- exists under an OR
select * from test.s where (1=2) or exists (select * from test.t);
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
NULL       |NULL  |NULL                          |NULL                          
0          |0     |0                             |0                             
1          |1     |1                             |1                             
ij> select * from test.s where (1=1) or exists (select * from test.t where (1=2));
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
NULL       |NULL  |NULL                          |NULL                          
0          |0     |0                             |0                             
1          |1     |1                             |1                             
ij> -- expression subqueries
-- non-correlated
select * from test.s where i = (select i from test.t where i = 0);
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
0          |0     |0                             |0                             
ij> -- ? parameter on left hand side of expression subquery
prepare subq1 as 'select * from test.s where ? = (select i from test.t where i = 0)';
ij> execute subq1 using 'values (0)';
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
NULL       |NULL  |NULL                          |NULL                          
0          |0     |0                             |0                             
1          |1     |1                             |1                             
ij> remove subq1;
ij> -- subquery = subquery
select * from test.s where
(select i from test.t where i = 0) = (select s from test.t where s = 0);
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
NULL       |NULL  |NULL                          |NULL                          
0          |0     |0                             |0                             
1          |1     |1                             |1                             
ij> select * from test.s t1 where
(select i from test.t t2 where i = 0) = (select s from test.t t3 where s = 0);
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
NULL       |NULL  |NULL                          |NULL                          
0          |0     |0                             |0                             
1          |1     |1                             |1                             
ij> -- multiple subqueries at the same level
select * from test.s 
where i = (select s from test.t where s = 0) and
	  s = (select i from test.t where i = 2);
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
ij> -- nested subqueries
select * from test.s 
where i = (select i from test.t where s = (select i from test.t where s = 2));
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
ij> select * from test.s  t1
where i = (select i from test.t t2 where s = (select i from test.t t3 where s = 2));
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
ij> -- correlated subqueries

select (exists (select * from test.ttt 
				where iii = (select 11 from test.tt where ii = i and ii <> 1)) )
a
from test.s
order by a;
A    
-----
false
false
true 
ij> -- negative tests

-- multiple matches at parent level
select * from test.s, test.t where exists (select i from test.tt);
ERROR 42X03: Column name 'I' is in more than one table in the FROM list.
ij> -- match is against base table, but not derived column list
select * from test.s ss (c1, c2, c3, c4) where exists (select i from test.tt);
ERROR 42X04: Column 'I' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'I' is not a column in the target table.
ij> select * from test.s ss (c1, c2, c3, c4) where exists (select ss.i from test.tt);
ERROR 42X04: Column 'SS.I' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'SS.I' is not a column in the target table.
ij> -- correlation name exists at both levels, but only column match is at
-- parent level
select * from test.s where exists (select s.i from test.tt s);
ERROR 42X04: Column 'S.I' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'S.I' is not a column in the target table.
ij> -- only match is at peer level
select * from test.s where exists (select * from test.tt) and exists (select ii from test.t);
ERROR 42X04: Column 'II' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'II' is not a column in the target table.
ij> -- correlated column in a derived table
select * from test.s, (select * from test.tt where test.s.i = ii) a;
ERROR 42X04: Column 'TEST.S.I' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'TEST.S.I' is not a column in the target table.
ij> -- positive tests

-- skip levels to find match
select * from test.s where exists (select * from test.ttt where iii = 
								(select 11 from test.tt where ii = i and ii <> 1));
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
0          |0     |0                             |0                             
ij> -- join in subquery
select * from test.s where i in (select i from test.t, test.tt where test.s.i <> i and i = ii);
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
ij> select * from test.s t1 where i in (select i from test.t t2, test.tt t3 where t1.i <> i and i = ii);
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
ij> -- joins in both query blocks
select test.s.i, test.t.i from test.s, test.t 
where test.t.i = (select ii from test.ttt, test.tt where test.s.i = test.t.i and test.t.i = test.tt.ii and iii = 22 and ii <> 1);
I          |I          
-----------------------
0          |0          
ij> select t1.i, t2.i from test.s t1, test.t t2 
where t2.i = (select ii from test.ttt t3, test.tt t4 where t1.i = t2.i and t2.i = t4.ii and iii = 22 and ii <> 1);
I          |I          
-----------------------
0          |0          
ij> ----------------------------------
-- update
create table test.u (i int, s smallint, c char(30), vc char(30));
0 rows inserted/updated/deleted
ij> insert into test.u select * from test.s;
3 rows inserted/updated/deleted
ij> select * from test.u;
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
NULL       |NULL  |NULL                          |NULL                          
0          |0     |0                             |0                             
1          |1     |1                             |1                             
ij> update test.u set i = 2
where vc <> (select vc from test.s where vc = '1');
1 row inserted/updated/deleted
ij> select * from test.u;
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
NULL       |NULL  |NULL                          |NULL                          
2          |0     |0                             |0                             
1          |1     |1                             |1                             
ij> delete from test.u;
3 rows inserted/updated/deleted
ij> insert into test.u select * from test.s;
3 rows inserted/updated/deleted
ij> -- delete
delete from test.u where c < (select c from test.t where c = '2');
2 rows inserted/updated/deleted
ij> select * from test.u;
I          |S     |C                             |VC                            
--------------------------------------------------------------------------------
NULL       |NULL  |NULL                          |NULL                          
ij> -- reset autocommit
autocommit on;
ij> -- bug 5146 - drop schema did not invalidate plan for create table.
-- now schemas are implictly created.
create schema B5146;
0 rows inserted/updated/deleted
ij> create table B5146.DT(i int);
0 rows inserted/updated/deleted
ij> insert into B5146.DT values 5146, 6415;
2 rows inserted/updated/deleted
ij> create schema A5146;
0 rows inserted/updated/deleted
ij> prepare PS5146_TABLE as 'create table A5146.I(i int)';
ij> drop schema A5146 restrict;
0 rows inserted/updated/deleted
ij> execute PS5146_TABLE;
0 rows inserted/updated/deleted
ij> insert into A5146.I values 3;
1 row inserted/updated/deleted
ij> select * from A5146.I;
I          
-----------
3          
ij> drop table A5146.I;
0 rows inserted/updated/deleted
ij> prepare PS5146_VIEW as 'create view A5146.V AS SELECT * FROM B5146.DT';
ij> drop schema A5146 restrict;
0 rows inserted/updated/deleted
ij> execute PS5146_VIEW;
0 rows inserted/updated/deleted
ij> select * from A5146.V;
I          
-----------
5146       
6415       
ij> drop view A5146.V;
0 rows inserted/updated/deleted
ij> prepare PS5146_TRIGGER as 'create trigger A5146.DT_TRIG AFTER INSERT ON B5146.DT FOR EACH STATEMENT UPDATE  B5146.DT SET I = I + 1';
ij> drop schema A5146 restrict;
0 rows inserted/updated/deleted
ij> execute PS5146_TRIGGER;
0 rows inserted/updated/deleted
ij> drop trigger A5146.DT_TRIG;
0 rows inserted/updated/deleted
ij> prepare PS5146_PROCEDURE as 'create procedure A5146.DUMMY() language java external name ''asdf.asdf'' parameter style java';
ij> drop schema A5146 restrict;
0 rows inserted/updated/deleted
ij> execute PS5146_PROCEDURE;
0 rows inserted/updated/deleted
ij> drop procedure A5146.DUMMY;
0 rows inserted/updated/deleted
ij> -- check implicit schema creation for all CREATE statements that create schema objects.
-- TABLE,VIEW,PROCEDURE TRIGGER, STATEMENT
-- Cloudscape requires that the INDEX schema matches the (existing) table schema so
-- there is no implict schema creation for CREATE INDEX.

prepare ISC_TABLE as 'create table ISC.I(i int)';
ij> execute ISC_TABLE;
0 rows inserted/updated/deleted
ij> insert into ISC.I values 3;
1 row inserted/updated/deleted
ij> select * from ISC.I;
I          
-----------
3          
ij> drop table ISC.I;
0 rows inserted/updated/deleted
ij> drop schema ISC restrict;
0 rows inserted/updated/deleted
ij> prepare ISC_VIEW as 'create view ISC.V AS SELECT * FROM B5146.DT';
ij> execute ISC_VIEW;
0 rows inserted/updated/deleted
ij> select * from ISC.V;
I          
-----------
5146       
6415       
ij> drop view ISC.V;
0 rows inserted/updated/deleted
ij> drop schema ISC restrict;
0 rows inserted/updated/deleted
ij> prepare ISC_TRIGGER as 'create trigger ISC.DT_TRIG AFTER INSERT ON B5146.DT FOR EACH STATEMENT UPDATE  B5146.DT SET I = I + 1';
ij> execute ISC_TRIGGER;
0 rows inserted/updated/deleted
ij> insert into B5146.DT values 999;
1 row inserted/updated/deleted
ij> drop trigger ISC.DT_TRIG;
0 rows inserted/updated/deleted
ij> drop schema ISC restrict;
0 rows inserted/updated/deleted
ij> select * from B5146.DT;
I          
-----------
5147       
6416       
1000       
ij> prepare ISC_PROCEDURE as 'create procedure ISC.DUMMY() language java external name ''asdf.asdf'' parameter style java';
ij> execute ISC_PROCEDURE;
0 rows inserted/updated/deleted
ij> CALL ISC.DUMMY();
ERROR 42X51: The class 'asdf' does not exist or is inaccessible. This can happen if the class is not public or the derby.database.classpath property is missing or incorrectly defined.
ERROR XJ001: Java exception: 'asdf: java.lang.ClassNotFoundException'.
ij> drop procedure ISC.DUMMY;
0 rows inserted/updated/deleted
ij> drop schema ISC restrict;
0 rows inserted/updated/deleted
ij> -- check declare of a temp table does not create a SESSION schema.
DECLARE GLOBAL TEMPORARY TABLE SESSION.ISCT(c21 int) on commit delete rows not logged;
0 rows inserted/updated/deleted
ij> select count(*) from SYS.SYSSCHEMAS WHERE CAST(SCHEMANAME AS VARCHAR(128)) = 'SESSION';
1          
-----------
0          
ij> drop table SESSION.ISCT;
0 rows inserted/updated/deleted
ij> drop table B5146.DT;
0 rows inserted/updated/deleted
ij> drop schema B5146 restrict;
0 rows inserted/updated/deleted
ij> create schema SYSDJD;
ERROR 42939: An object cannot be created with the schema name 'SYSDJD'.
ij> drop schema SYSDJD restrict;
ERROR 42Y07: Schema 'SYSDJD' does not exist
ij> create schema "sys";
0 rows inserted/updated/deleted
ij> drop schema "sys" restrict;
0 rows inserted/updated/deleted
ij> set schema test;
0 rows inserted/updated/deleted
ij> -- drop the tables
drop table s;
0 rows inserted/updated/deleted
ij> drop table t;
0 rows inserted/updated/deleted
ij> drop table tt;
0 rows inserted/updated/deleted
ij> drop table ttt;
0 rows inserted/updated/deleted
ij> drop table u;
0 rows inserted/updated/deleted
ij> set schema app;
0 rows inserted/updated/deleted
ij> drop schema test restrict;
0 rows inserted/updated/deleted
ij>