📄 formdemo.sql
字号:
CREATE SEQUENCE "cities_id_seq" start 7 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ;SELECT nextval ('cities_id_seq');CREATE TABLE "pga_queries" ( "queryname" character varying(64), "querytype" character, "querycommand" text, "querytables" text, "querylinks" text, "queryresults" text, "querycomments" text);CREATE TABLE "pga_forms" ( "formname" character varying(64), "formsource" text);CREATE TABLE "pga_scripts" ( "scriptname" character varying(64), "scriptsource" text);CREATE TABLE "pga_reports" ( "reportname" character varying(64), "reportsource" text, "reportbody" text, "reportprocs" text, "reportoptions" text);CREATE TABLE "phonebook" ( "name" character varying(32), "phone_nr" character varying(16), "city" character varying(32), "company" bool, "continent" character varying(16));CREATE TABLE "pga_layout" ( "tablename" character varying(64), "nrcols" int2, "colnames" text, "colwidth" text);CREATE TABLE "pga_schema" ( "schemaname" character varying(64), "schematables" text, "schemalinks" text);REVOKE ALL on "pga_schema" from PUBLIC;GRANT ALL on "pga_schema" to PUBLIC;CREATE TABLE "cities" ( "id" int4 DEFAULT nextval('"cities_id_seq"') NOT NULL, "name" character varying(32) NOT NULL, "prefix" character varying(16) NOT NULL);REVOKE ALL on "cities" from PUBLIC;GRANT UPDATE,DELETE,SELECT,RULE on "cities" to "fane";GRANT ALL on "cities" to "liviu";CREATE FUNCTION "getcityprefix" (int4 ) RETURNS varchar AS 'select prefix from cities where id = $1 ' LANGUAGE 'SQL';COPY "pga_queries" FROM stdin;Query that can be saved as view S select * from phonebook where continent='usa' \N \N \N \N\.COPY "pga_forms" FROM stdin;Phone book pb 28 {FS {}} 444x307+284+246 {label label1 {33 10 68 28} {} Name {} label1 flat #000000 #d9d9d9 1 n} {entry name_entry {87 9 227 27} {} entry2 DataSet(.pb.qs,name) name_entry sunken #000000 #fefefe 1 n} {label label3 {33 37 73 52} {} Phone {} label3 flat #000000 #d9d9d9 1 n} {entry entry4 {87 36 195 54} {} entry4 DataSet(.pb.qs,phone_nr) entry4 sunken #000000 #fefefe 1 n} {label label5 {33 64 78 82} {} City {} label5 flat #000000 #d9d9d9 1 n} {entry entry6 {87 63 195 81} {} entry6 DataSet(.pb.qs,city) entry6 sunken #000000 #fefefe 1 n} {query qs {3 6 33 33} {} query7 {} qs flat {} {} 1 n} {button button8 {174 177 246 203} {namespace eval DataControl(.pb.qs) {\\ setSQL "select oid,* from phonebook where name ~* '$what' order by name"\\ open\\ set nrecs [getRowCount]\\ updateDataSet\\ fill .pb.allnames name\\ bind .pb.allnames <ButtonRelease-1> {\\ set ancr [.pb.allnames curselection]\\ if {$ancr!=""} {\\ \ DataControl(.pb.qs)::moveTo $ancr\\ \ DataControl(.pb.qs)::updateDataSet\\ }\\ }\}} {Start search} {} button8 raised #000000 #d9d9d9 1 n} {button button9 {363 276 433 300} {DataControl(.pb.qs)::close\DataControl(.pb.qs)::clearDataSet\set nrecs {}\set what {}\destroy .pb\} Exit {} button9 raised #000000 #d9d9d9 2 n} {button button10 {291 237 313 257} {namespace eval DataControl(.pb.qs) {\\ moveFirst\\ updateDataSet\}\} |< {} button10 ridge #000092 #d9d9d9 2 n} {button button11 {324 237 346 257} {namespace eval DataControl(.pb.qs) {\\ movePrevious\\ updateDataSet\}\} << {} button11 ridge #000000 #d9d9d9 2 n} {button button12 {348 237 370 257} {namespace eval DataControl(.pb.qs) {\\ moveNext\\ updateDataSet\}} >> {} button12 ridge #000000 #d9d9d9 2 n} {button button13 {381 237 403 257} {namespace eval DataControl(.pb.qs) {\\ moveLast\\ updateDataSet\}\} >| {} button13 ridge #000088 #d9d9d9 2 n} {checkbox checkbox14 {33 87 126 105} {} {Is it a company ?} DataSet(.pb.qs,company) checkbox14 flat #000000 #d9d9d9 1 n} {radio usa {63 108 201 120} {} U.S.A. DataSet(.pb.qs,continent) usa flat #000000 #d9d9d9 1 n} {radio europe {63 126 204 141} {} Europe DataSet(.pb.qs,continent) europe flat #000000 #d9d9d9 1 n} {radio africa {63 144 210 159} {} Africa DataSet(.pb.qs,continent) africa flat #000000 #d9d9d9 1 n} {entry entry18 {129 180 169 198} {} entry18 what entry18 sunken #000000 #fefefe 1 n} {label label19 {108 219 188 234} {} {records found} {} label19 flat #000000 #d9d9d9 1 n} {label label20 {90 219 105 234} {} { } nrecs label20 flat #000000 #d9d9d9 1 n} {label label21 {3 252 33 267} {} OID= {} label21 flat #000000 #d9d9d9 1 n} {label label22 {39 252 87 267} {} { } pbqs(oid) label22 flat #000000 #d9d9d9 1 n} {button button23 {9 276 79 300} {set oid {}\catch {set oid $DataSet(.pb.qs,oid)}\if {[string trim $oid]!=""} {\ sql_exec noquiet "update phonebook set name='$DataSet(.pb.qs,name)', phone_nr='$DataSet(.pb.qs,phone_nr)',city='$DataSet(.pb.qs,city)',company='$DataSet(.pb.qs,company)',continent='$DataSet(.pb.qs,continent)' where oid=$oid"\} else {\ tk_messageBox -title Error -message "No record is displayed!"\}\\} Update {} button23 raised #000000 #d9d9d9 1 n} {button button24 {210 276 280 300} {set thisname $DataSet(.pb.qs,name)\if {[string trim $thisname] != ""} {\\ sql_exec noquiet "insert into phonebook values (\\ \ '$DataSet(.pb.qs,name)',\\ \ '$DataSet(.pb.qs,phone_nr)',\\ \ '$DataSet(.pb.qs,city)',\\ \ '$DataSet(.pb.qs,company)',\\ \ '$DataSet(.pb.qs,continent)'\\ )"\\ tk_messageBox -title Information -message "A new record has been added!"\} else {\\ tk_messageBox -title Error -message "This one doesn't have a name?"\}\\} {Add record} {} button24 raised #000000 #d9d9d9 1 n} {button button25 {141 276 204 300} {DataControl(.pb.qs)::clearDataSet\# clearcontrols stillinitialise\# incorectly booleans controls to {}\# so I force it to 'f' (false)\set DataSet(.pb.qs,company) f\focus .pb.name_entry} {Clear all} {} button25 raised #000000 #d9d9d9 1 n} {listbox allnames {249 6 435 231} {} listbox26 {} allnames sunken #000000 #fefefe 1 n} {label label27 {33 252 90 267} {} {} DataSet(.pb.qs,oid) label27 flat #000000 #d9d9d9 1 n} {label label28 {3 182 128 197} {} {Find name containing} {} {} flat #000000 #d9d9d9 1 n}Full featured form full 21 {FS {set entrydemo {nice}\set color {no color selected}}} 377x418+50+130 {label label1 {3 396 165 411} {} {Status line} {} {} sunken #000000 #d9d9d9 2 n} {label label2 {171 396 369 411} {} {Grooved status line} {} {} groove #000098 #d9d9d9 2 f} {label label3 {108 9 270 31} {} { Full featured form} {} {} ridge #000000 #d9d9d9 4 {Times 16 bold italic}} {button button4 {15 210 144 243} {.full.lb insert end {it's} a nice demo form} {Java style button} {} {} groove #6161b6 #d9d9d9 2 b} {label label5 {15 42 115 58} {} {Java style label} {} {} flat #6161b6 #d9d9d9 1 b} {entry entry6 {123 39 279 60} {} entry6 entrydemo {} groove #000000 #fefefe 2 {Courier 13}} {listbox lb {12 69 147 201} {} listbox8 {} {} ridge #000000 #ffffc8 2 n} {button button9 {18 264 39 282} {} 1 {} {} flat #000000 #d9d9d9 1 n} {button button10 {48 264 68 282} {} 2 {} {} flat #000000 #d9d9d9 1 n} {button button11 {78 264 234 282} {} {and other hidden buttons} {} {} flat #000000 #d9d9d9 1 n} {text txt {153 69 372 201} {} text12 {} {} sunken #000000 #d4ffff 1 n} {button button13 {150 210 369 243} {.full.txt tag configure bold -font {Helvetica 12 bold}\.full.txt tag configure italic -font {Helvetica 12 italic}\.full.txt tag configure large -font {Helvetica -14 bold}\.full.txt tag configure title -font {Helvetica 12 bold italic} -justify center\
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -