-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpfcexs10.sql
More file actions
22370 lines (22321 loc) · 270 KB
/
Copy pathpfcexs10.sql
File metadata and controls
22370 lines (22321 loc) · 270 KB
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
/* ============================================================ */
/* This file : pfcdbsy10.sql */
/* DBMS name : SYBASE System 10/11 */
/* Author : Powersoft Corporation */
/* Created On : 10/20/97 2:17 PM */
/* */
/* Purpose : This is a file of SQL statements you */
/* can execute against a Sybase System 10 */
/* database. It creates the PFC Examples */
/* DB tables which are used by the */
/* PowerBuilder PFC Code Examples and then */
/* inserts data into them. The tables are: */
/* * customer */
/* * department */
/* * employee */
/* * fin_code */
/* * fin_data */
/* * product */
/* * sales_order */
/* * sales_order_items */
/* * states */
/* * sales_regions */
/* * examples */
/* * examples_categories_list */
/* * messages */
/* * security_apps */
/* * security_groupings */
/* * security_info */
/* * security_template */
/* * security_users */
/* */
/* After loading data into the tables this */
/* script will create the indexes and */
/* the foreign keys used by the PFC Code */
/* Examples. */
/* */
/* To use it : Follow these steps. */
/* */
/* 1) Make sure the target database doesn't */
/* already contain tables whose names */
/* conflict with those to be added by */
/* this file. */
/* */
/* Important: You'll need to keep the */
/* Powersoft Demo DB tables separate */
/* from the ANBC tables(because they */
/* have some names that conflict). */
/* */
/* 2) Make sure the target database already */
/* contains the PowerBuilder repository */
/* tables (pbcatcol, pbcatedt, pbcatfmt, */
/* pbcattbl, and pbcatvld). */
/* */
/* If it does not, see the PowerBuilder */
/* manual "Connecting to Your Database" */
/* for instructions on creating these */
/* repository tables. */
/* */
/* 3) After the script is finshed, grant */
/* the appropriate privileges. */
/* */
/* 4) Use ISQL to execute this file */
/* (psdbsy10.sql). */
/* */
/* */
/* ============================================================ */
/* ============================================================ */
/* Specify the database to use: */
/* */
/* use <dbname> */
/* go */
/* */
/* ============================================================ */
/* ============================================================ */
/* Drop Tables */
/* ============================================================ */
/* drop table customer */
/* go */
/* drop table department */
/* go */
/* drop table employee */
/* go */
/* drop table fin_code */
/* go */
/* drop table fin_data */
/* go */
/* drop table product */
/* go */
/* drop table sales_order */
/* go */
/* drop table sales_order_items */
/* go */
/* drop table states */
/* go */
/* drop table sales_regions */
/* go */
/* drop table examples */
/* go */
/* drop table examples_categories_list */
/* go */
/* drop table messages */
/* go */
/* drop table security_groupings */
/* go */
/* drop table security_info */
/* go */
/* drop table security_users */
/* go */
/* drop table security_apps */
/* go */
/* drop table security_template */
/* go */
/* ============================================================ */
/* Table : customer */
/* ============================================================ */
create table customer
(
id int not null,
fname char(15) not null,
lname char(20) not null,
address char(35) not null,
city char(20) not null,
state char(3) not null,
zip char(10) not null,
phone char(12) not null,
company_name char(35) null ,
constraint pk_customer primary key (id)
)
go
/* ============================================================ */
/* Table : department */
/* ============================================================ */
create table department
(
dept_id int not null,
dept_name char(40) not null,
dept_head_id int null ,
constraint pk_department primary key (dept_id)
)
go
/* ============================================================ */
/* Table : employee */
/* ============================================================ */
create table employee
(
emp_id int not null,
manager_id int null ,
emp_fname char(20) not null,
emp_lname char(20) not null,
dept_id int not null,
street char(40) not null,
city char(20) not null,
state char(4) not null,
zip_code char(9) not null,
phone char(10) null ,
status char(1) null ,
ss_number char(11) not null,
salary numeric(20,3) not null,
start_date datetime not null,
termination_date datetime null ,
birth_date datetime null ,
bene_health_ins char(1) null ,
bene_life_ins char(1) null ,
bene_day_care char(1) null ,
sex char(1) null ,
constraint pk_employee primary key (emp_id)
)
go
/* ============================================================ */
/* Table : fin_code */
/* ============================================================ */
create table fin_code
(
code char(2) not null,
type char(10) not null,
description char(50) null ,
constraint pk_fin_code primary key (code)
)
go
/* ============================================================ */
/* Table : fin_data */
/* ============================================================ */
create table fin_data
(
year char(4) not null,
quarter char(2) not null,
code char(2) not null,
amount numeric(9) null ,
constraint pk_fin_data primary key (year, quarter, code)
)
go
/* ============================================================ */
/* Table : product */
/* ============================================================ */
create table product
(
id int not null,
name char(15) not null,
description char(30) not null,
prod_size char(18) not null,
color char(6) not null,
quantity int not null,
unit_price numeric(15,2) not null,
picture_name char(12) null ,
catalog_picture image null ,
constraint pk_product primary key (id)
)
go
/* ============================================================ */
/* Table : sales_order */
/* ============================================================ */
create table sales_order
(
id int not null,
cust_id int not null,
order_date datetime not null,
fin_code_id char(2) null ,
region char(7) null ,
sales_rep int not null,
constraint pk_sales_order primary key (id)
)
go
/* ============================================================ */
/* Table : sales_order_items */
/* ============================================================ */
create table sales_order_items
(
id int not null,
line_id smallint not null,
prod_id int not null,
quantity int not null,
ship_date datetime not null,
constraint pk_sales_order_items primary key (id, line_id)
)
go
/* ============================================================ */
/* Table : states */
/* ============================================================ */
create table states
(
state_id char(3) not null,
state_name char(24) not null,
state_capital char(24) not null,
country char(3) not null,
region char(7) not null,
constraint pk_states primary key (state_id, state_capital)
)
go
/* ============================================================ */
/* Table : sales_regions */
/* ============================================================ */
create table sales_regions
(
region char(7) not null,
constraint pk_sales_regions primary key (region)
)
go
/* ============================================================ */
/* Table : examples */
/* ============================================================ */
create table examples
(
example_id int not null,
title char(60) not null,
description text null ,
technique text null ,
ostype char(40) null ,
pbtype char(17) null ,
exhelp int null ,
window char(128) null ,
about text null ,
constraint pk_examples primary key (example_id)
)
go
/* ============================================================ */
/* Table : examples_categories_list */
/* ============================================================ */
create table examples_categories_list
(
category_id int not null,
category_name char(60) null ,
category_parent_id int null ,
example_id int null ,
picture_idx int null ,
selected_picture_idx int null ,
overlay_picture_idx int null ,
state_picture_idx int null ,
constraint pk_examples_categories_list primary key (category_id)
)
go
/* ============================================================ */
/* Table : messages */
/* ============================================================ */
create table messages
(
msgid varchar(40) not null,
msgtitle varchar(255) not null,
msgtext varchar(255) not null,
msgicon varchar(12) not null,
msgbutton varchar(17) not null,
msgdefaultbutton int not null,
msgseverity int not null,
msgprint char(1) not null,
msguserinput char(1) not null,
constraint pk_messages primary key nonclustered (msgid)
)
go
/* ============================================================ */
/* Table : security_groupings */
/* ============================================================ */
create table security_groupings
(
group_name varchar(16) not null,
user_name varchar(16) not null,
constraint pk_sec_groupings primary key nonclustered (group_name, user_name)
)
go
/* ============================================================ */
/* Table : security_info */
/* ============================================================ */
create table security_info
(
application varchar(32) not null,
window varchar(64) not null,
control varchar(128) not null,
user_name varchar(16) not null,
status char(1) not null,
constraint pk_sec_info primary key nonclustered (application, window, control, user_name)
)
go
/* ============================================================ */
/* Table : security_users */
/* ============================================================ */
create table security_users
(
name varchar(16) not null,
description varchar(32) not null,
priority int not null,
user_type int null ,
constraint pk_sec_users primary key nonclustered (name)
)
go
/* ============================================================ */
/* Table : security_apps */
/* ============================================================ */
create table security_apps
(
application varchar(32) not null,
description varchar(64) not null,
constraint pk_sec_apps primary key nonclustered (application)
)
go
/* ============================================================ */
/* Table : security_template */
/* ============================================================ */
create table security_template
(
application varchar(32) not null,
window varchar(64) not null,
control varchar(128) not null,
description varchar(254) not null,
object_type varchar(24) not null,
constraint pk_sec_template primary key nonclustered (application, window, control)
)
go
/* ============================================================ */
/* Grant privileges */
/* ============================================================ */
/* grant select, insert, update, delete on customer to public */
/* go */
/* grant select, insert, update, delete on department to public */
/* go */
/* grant select, insert, update, delete on employee to public */
/* go */
/* grant select, insert, update, delete on fin_code to public */
/* go */
/* grant select, insert, update, delete on fin_data to public */
/* go */
/* grant select, insert, update, delete on product to public */
/* go */
/* grant select, insert, update, delete on sales_order to public */
/* go */
/* grant select, insert, update, delete on sales_order_items to public */
/* go */
/* grant select, insert, update, delete on states to public */
/* go */
/* grant select, insert, update, delete on sales_regions to public */
/* go */
/* grant select, insert, update, delete on examples to public */
/* go */
/* grant select, insert, update, delete on examples_categories_list to public */
/* go */
/* grant select on messages to public */
/* go */
/* grant select on security_groupings to public */
/* go */
/* grant select on security_info to public */
/* go */
/* grant select on security_users to public */
/* go */
/* grant select on security_apps to public */
/* go */
/* grant select on security_template to public */
/* go */
/* ============================================================ */
/* Load PFC Examples DB data */
/* ============================================================ */
/* ============================================================ */
/* Load messages table */
/* ============================================================ */
INSERT INTO messages VALUES (
'pfc_closequery_savechanges',
'Application',
'Do you want to save changes?',
'Exclamation',
'YesNoCancel',
1,
0,
'N',
'N')
go
INSERT INTO messages VALUES (
'pfc_closequery_failsvalidation',
'Application',
'The information entered does not pass validation and must be corrected before changes can be saved.~r~n~r~nClose without saving changes?',
'Exclamation',
'YesNo',
2,
5,
'N',
'N')
go
INSERT INTO messages VALUES (
'pfc_requiredmissing',
'Application',
'Required value missing for %s on row %s. Please enter a value.',
'Information',
'Ok',
1,
5,
'N',
'N')
go
INSERT INTO messages VALUES (
'pfc_dwdberror',
'Application',
'%s',
'StopSign',
'Ok',
1,
20,
'N',
'N')
go
INSERT INTO messages VALUES (
'pfc_systemerror',
'System Error',
'%s',
'StopSign',
'Ok',
1,
20,
'N',
'N')
go
INSERT INTO messages VALUES (
'pfc_dwlinkage_rowchanging',
'Application',
'Updates are pending. ~r~nSave them now?',
'Exclamation',
'YesNoCancel',
1,
0,
'N',
'N')
go
INSERT INTO messages VALUES (
'pfc_dwlinkage_predelete',
'Application',
'Delete row(s)?',
'Exclamation',
'OkCancel',
1,
0,
'N',
'N')
go
INSERT INTO messages VALUES (
'pfc_dwlinkage_requiredmissing',
'Application',
'Required value missing for %s on row %s. Please enter a value.',
'Information',
'Ok',
1,
5,
'N',
'N')
go
INSERT INTO messages VALUES (
'pfc_dsaccepttext',
'Application',
'Failed accepttext validation on datastore. Column %s on row %s.',
'Exclamation',
'Ok',
1,
20,
'N',
'Y')
go
INSERT INTO messages VALUES (
'pfc_requiredmissingondatastore',
'Application',
'Required value missing for %s on row %s.',
'StopSign',
'Ok',
1,
20,
'N',
'Y')
go
/* ============================================================ */
/* Load sales_regions table */
/* ============================================================ */
INSERT INTO sales_regions VALUES (
'Canada')
go
INSERT INTO sales_regions VALUES (
'Central')
go
INSERT INTO sales_regions VALUES (
'Eastern')
go
INSERT INTO sales_regions VALUES (
'South')
go
INSERT INTO sales_regions VALUES (
'Western')
go
/* ============================================================ */
/* Load examples_categories_list table */
/* ============================================================ */
INSERT INTO examples_categories_list VALUES (
0,
'PFC Examples',
0,
0,
1,
1,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
1,
'Application Services',
0,
0,
3,
4,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
3,
'Error Services Example',
1,
3,
5,
6,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
4,
'Split Bar 3 Pane Style',
44,
4,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
5,
'Conversion and Numerical Services',
999,
20,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
6,
'DataWindow Services',
0,
0,
3,
4,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
7,
'Linkage Services',
0,
0,
3,
4,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
8,
'Save Process: All DW Scenarios',
34,
1,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
9,
'Basic Retrieval Arguments',
7,
9,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
10,
'Basic Scrolling',
7,
10,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
11,
'Basic Filters',
7,
11,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
12,
'Filter Service Dialogs',
6,
12,
5,
6,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
13,
'Sort Service Dialogs',
6,
13,
5,
6,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
14,
'Multiple Table Update',
6,
14,
5,
6,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
15,
'Print Preview Service',
6,
15,
5,
6,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
17,
'Row Manager Service',
6,
17,
5,
6,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
18,
'Row Selection Service',
6,
18,
5,
6,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
19,
'Required Column Service',
6,
19,
5,
6,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
21,
'Drop-down Search Services',
999,
0,
3,
4,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
22,
'Type Ahead in the DDLB & DDPLB',
44,
5,
5,
6,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
23,
'Drop-down Search Service',
6,
6,
5,
6,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
25,
'Find and Replace Service',
6,
7,
5,
6,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
26,
'Find and Replace in a RTE',
44,
8,
5,
6,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
34,
'Window Services',
0,
0,
3,
4,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
35,
'Window Resize Service',
34,
26,
5,
6,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
36,
'Status Bar',
34,
27,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
37,
'Across Tab Pages',
7,
28,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
38,
'Split Bar Explorer Style ',
44,
29,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
39,
'Resize Dynamic Tab Pages',
34,
30,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
40,
'Tab Control Object',
999,
0,
3,
4,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
41,
'Filter Service Settings',
6,
31,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
42,
'Refresh Drop-down DataWindows',
6,
32,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
43,
'Dynamic Filter Expressions',
6,
33,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
44,
'Objects',
0,
0,
3,
4,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
46,
'Using Rich Text Edits with Files',
999,
35,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
47,
'Using Rich Text Edits with Your Database',
999,
36,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
48,
'Progress Bar Sampler',
44,
37,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
49,
'Retrieval with Auto-updates',
7,
38,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
50,
'Filter with Cascading Keys',
7,
39,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
52,
'Filter with Cascading Deletes',
7,
41,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
53,
'Split Bar Object',
999,
0,
3,
4,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
55,
'Split Bars within a Window Object',
999,
43,
5,
6,
1,
0)
go
INSERT INTO examples_categories_list VALUES (
56,
'Progress Bar Object',
999,
0,
3,
4,
0,
0)
go
INSERT INTO examples_categories_list VALUES (
57,
'Resize Freeform DataWindow',
6,
44,
5,