home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
db_util.dbt
< prev
next >
Wrap
Text File
|
1997-06-26
|
1KB
|
47 lines
# Template @(#)db_util.dbt /main/titanic/2 15 Apr 1996
# Copyright 1995 Cadre Technologies
#
#
# Utility procs
#
#
# Get the full name of the given table
#
~[proc tableName {name} {
return "${name}${tableSuffix}" }]
~[proc table {name} {
return "table [tableName $name]" }]
#
# Get the full name of an index on the given table
#
~[proc indexName {tbl nr} {
return "${tbl}${tableSuffix}_i${nr}" }]
#
# Utility proc to drop a table
#
~[proc dropTable {tbl} {
return "drop [table $tbl]" }]
#
# Utility proc to create an index
#
~[proc createIndex {tbl nr} {
return "create index [indexName $tbl $nr] on [tableName $tbl]" }]
~[proc createUniqueIndex {tbl nr} {
return "create unique index [indexName $tbl $nr] on [tableName $tbl]" }]
~[proc createClusteredIndex {tbl nr} {
return "create index [indexName $tbl $nr] on [tableName $tbl]" }]
#
# Utility proc to drop an index
#
~[proc dropIndex {tbl nr} {
return "drop index [tableName $tbl].[indexName $tbl $nr]" }]