tdbc_mapSqlState.n 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. '\"
  2. '\" tdbc_mapSqlState.n --
  3. '\"
  4. '\" Copyright (c) 2009 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::mapSqlState" 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::mapSqlState \- Map SQLSTATE to error class
  62. .SH "SYNOPSIS"
  63. .nf
  64. package require \fBtdbc 1.0\fR
  65. \fBtdbc::mapSqlState\fR \fIsqlstate\fR
  66. .fi
  67. .BE
  68. .SH "DESCRIPTION"
  69. .PP
  70. The \fBtdbc::mapSqlState\fR command accepts a string that is expected
  71. to be a five-character 'SQL state' as returned from a SQL database when
  72. an error occurs. It examines the first two characters of the string,
  73. and returns an error class as a human- and machine-readable name (for example,
  74. \fBFEATURE_NOT_SUPPORTED\fR, \fBDATA_EXCEPTION\fR or
  75. \fBINVALID_CURSOR_STATE\fR).
  76. .PP
  77. The TDBC specification requires database drivers to return a description
  78. of an error in the error code when an error occurs. The description is
  79. a string that has at least four elements: "\fBTDBC\fR \fIerrorClass\fR
  80. \fIsqlstate\fR \fIdriverName\fR \fIdetails...\fR". The \fBtdbc::mapSqlState\fR
  81. command gives a convenient way for a TDBC driver to generate the
  82. \fIerrorClass\fR element given the SQL state returned from a database.
  83. .SH "SEE ALSO"
  84. tdbc(n), tdbc::tokenize, tdbc::connection(n), tdbc::statement(n), tdbc::resultset(n)
  85. .SH "KEYWORDS"
  86. TDBC, SQL, database, state
  87. .SH "COPYRIGHT"
  88. Copyright (c) 2009 by Kevin B. Kenny.
  89. '\" Local Variables:
  90. '\" mode: nroff
  91. '\" End:
  92. '\"