tdbc_tokenize.n 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. '\"
  2. '\" tdbc_tokenize.n --
  3. '\"
  4. '\" Copyright (c) 2008 by Kevin B. Kenny.
  5. '\"
  6. '\" See the file "license.terms" for information on usage and redistribution of
  7. '\" this file, and for a DISCLAIMER OF ALL WARRANTIES.
  8. '\"
  9. .TH "tdbc::tokenize" n 8.6 Tcl "Tcl Database Connectivity"
  10. '\" .so man.macros
  11. '\" IGNORE
  12. .if t .wh -1.3i ^B
  13. .nr ^l \n(.l
  14. .ad b
  15. '\" # BS - start boxed text
  16. '\" # ^y = starting y location
  17. '\" # ^b = 1
  18. .de BS
  19. .br
  20. .mk ^y
  21. .nr ^b 1u
  22. .if n .nf
  23. .if n .ti 0
  24. .if n \l'\\n(.lu\(ul'
  25. .if n .fi
  26. ..
  27. '\" # BE - end boxed text (draw box now)
  28. .de BE
  29. .nf
  30. .ti 0
  31. .mk ^t
  32. .ie n \l'\\n(^lu\(ul'
  33. .el \{\
  34. '\" Draw four-sided box normally, but don't draw top of
  35. '\" box if the box started on an earlier page.
  36. .ie !\\n(^b-1 \{\
  37. \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  38. .\}
  39. .el \}\
  40. \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  41. .\}
  42. .\}
  43. .fi
  44. .br
  45. .nr ^b 0
  46. ..
  47. '\" # CS - begin code excerpt
  48. .de CS
  49. .RS
  50. .nf
  51. .ta .25i .5i .75i 1i
  52. ..
  53. '\" # CE - end code excerpt
  54. .de CE
  55. .fi
  56. .RE
  57. ..
  58. '\" END IGNORE
  59. .BS
  60. .SH "NAME"
  61. tdbc::tokenize \- TDBC SQL tokenizer
  62. .SH "SYNOPSIS"
  63. .nf
  64. package require \fBtdbc 1.0\fR
  65. \fBtdbc::tokenize\fR \fIstring\fR
  66. .fi
  67. .BE
  68. .SH "DESCRIPTION"
  69. .PP
  70. As a convenience to database drivers, Tcl Database Connectivity (TDBC)
  71. provides a command to break SQL code apart into tokens so that bound
  72. variables can readily be identified and substituted.
  73. .PP
  74. The \fBtdbc::tokenize\fR command accepts as its parameter a string
  75. that is expected to contain one or more SQL statements. It returns a
  76. list of substrings; concatenating these substrings together will yield
  77. the original string. Each substring is one of the following:
  78. .IP [1]
  79. A bound variable, which begins with one of the
  80. characters '\fB:\fR', '\fB@\fR', or '\fB$\fR'. The
  81. remainder of the string is the variable
  82. name and will consist of alphanumeric characters and underscores. (The
  83. leading character will be be non-numeric.)
  84. .IP [2]
  85. A semicolon that separates two SQL statements.
  86. .IP [3]
  87. Something else in a SQL statement. The tokenizer does not attempt to
  88. parse SQL; it merely identifies bound variables (distinguishing them
  89. from similar strings appearing inside quotes or comments) and
  90. statement delimiters.
  91. .SH "SEE ALSO"
  92. tdbc(n), tdbc::connection(n), tdbc::statement(n), tdbc::resultset(n)
  93. .SH "KEYWORDS"
  94. TDBC, SQL, database, tokenize
  95. .SH "COPYRIGHT"
  96. Copyright (c) 2008 by Kevin B. Kenny.
  97. '\" Local Variables:
  98. '\" mode: nroff
  99. '\" End:
  100. '\"