Open Tickets
Not logged in
Key: Active Review Fixed Tested Deferred Closed
# mtime type status subsystem title
comments
 
7db2ab741d 2010-06-30 03:21:57 Feature_Request Open not_specified TDBC install.tcl requires tk, should be optional

The INSTALL.tcl file requires Tk for two messages.

I'd suggest if Tk is not found the messages are displayed to stdout via puts.

Not all tdbc users will be using Tk.


anonymous claiming to be dereckson added on 2010-06-30 03:21:57:
Currently, tk is only required to build tdbc::mysql

 
a4d7f2a64f 2010-04-17 22:32:56 Documentation Open   documentation for statement getSql missing

The statement object has a method "getSql" which is not document:

set statement [$db_name prepare {select PATH_ID from PATHS where PATH=:path and parent_id is null}]

::oo::Obj943372::Stmt::10

(bin) 71 % $statement getSql

select PATH_ID from PATHS where PATH=:path and parent_id is null

(bin) 72 %

 
a2ad232bf6 2010-04-17 22:51:05 Feature_Request Open   feature request: add a getSql method to the resultset object

The statement object currently has an (undocumented) method yielding the underlying sql statement used for the construction of the specific statement object. (using bind variables notation). request: add a similar method for the resultset object, showing the substituted values.

Using the example from the man page:

package require tdbc::sqlite3

tdbc::sqlite3::connection create db phonebook.sqlite3

set statement [db prepare {

select phone_num from directory where first_name = :firstname and last_name = :lastname

}]

set firstname Fred

set lastname Flintstone

$statement getSql gives:

select phone_num from directory where first_name = :firstname and last_name = :lastname

set rs [$statement execute]

Request:

$rs getSql would give:

select phone_num from directory where first_name = 'Fred' and last_name = 'Flintstone'

Motivation: this feature would be very helpfull in debugging..

 
4cf30e29a1 2011-03-17 05:32:37 Code_Defect Open not_specified install.tcl error

Start the install.tcl the following error occurs, but the installation seems to be corret ---------------------------

Error in startup script --------------------------- expected boolean value but got "8.6b1.2" while executing "if {package present Tk} { tk_messageBox -type ok -detail "Files installed in $instdir" -message "TDBC drivers installed." -icon info } else ..." (file "C:\xxxxxxxx.\Downloads\tdbc1.0b16-win32\INSTALL.tcl" line 38) ---------------------------

 
bf0603a6a2 2012-07-13 01:57:15 Feature_Request Open not_specified postgres does not support semicolons

Hi,

It appears that the tdbc::postgres adapter does not support semicolons in statements making it a bit difficult to create functions

Looks like it was introduced here:

http://mirror1.tcl.tk/tdbc/info/a922f6900b


kbk added on 2012-07-13 01:57:15 UTC:
tdbc is supposed to handle plain, "bread and butter" data manipulation requests (INSERT, SELECT, UPDATE, DELETE, and SP calls) from Tcl. Sophisticated data definition tasks may remain beyond it. I'm leaving this incident open as a feature request, but SP creation will need a fair amount of work to get right, and will ordinarily be done through other tools in any event.

 
14dee3be9a 2012-06-08 01:05:39 Code_Defect Open   postgresql [column] doesn't like bool or boolean

the postgresql driver, given a table with a column declared as 'fieldname boolean', '$db columns $t $f' returns {fieldname {name fieldname nullable 1}} where I would expect at least a type boolean element in the dict.

 
dd068d5942 2012-06-21 02:03:52 Code_Defect Open   tdbc::sqlite3 does not show the data for attached files

After tdbc::sqlite3::connection create db mainfilename , the db command can execute the SQL command to ATTACH an additional database file, and the tables in the attached file can be used, but the db tables and other introspection object commands do not show the additional tables.

The workaround is to get the data from the attachName.sqlite_master table.

 
751477d142 2012-09-03 08:21:34 Code_Defect Open   Problem with MS SQL SERVER (via tdbcodbc) stored procedures

(Submitted on behalf of a colleague - also mailed to the 'tcl-tdbc' list but that mail doesn't seem to have come through?)

I am using tdbc's odbc driver to work with an MS SQL Server (2008) database. I have run into a problem when writing code to create a stored procedure, specifically w.r.t. the syntax for a procedure's parameters. SQL Server's "CREATE PROCEDURE" syntax (http://msdn.microsoft.com/en-us/library/ms187926%28v=sql.100%29.aspx) requires that a procedure's parameters be declared using the @ symbol preceding the name, e.g. @myvar Just doing this results in the connection's prepare method returning a statement whose params method returns a dict that has all of the stored procedure's parameters as bound variables. If I precede the parameter specifications with an underscore then the params dict does not contain the parameters, they are not seen as bound variables (b.t.w. this is undocumented) but when executing the statement fails due to the sql command still having the underscore. See examples below.

Thanks Douglas

(tools) 5 %   set con_str {Driver=SQL Server Native Client 10.0;Server=127.0.0.1\SQLEXPRESS;DATABASE=TDBC;UID=builder;PWD=bob;}
Driver=SQL Server Native Client 10.0;Server=127.0.0.1\SQLEXPRESS;DATABASE=TDBC;UID=builder;PWD=bob;
(tools) 6 % tdbc::odbc::connection create my_mssql_con $con_str
::my_mssql_con
(tools) 7 % set sql_stmt {
>   CREATE PROCEDURE [ESS].[sp_commitsinsert]
>     @commitRef nchar(64),
>     @streamId int,
>     @lastCommitId int,
>     @events nchar(64),
>     @metadata nchar(64) = NULL,
>     @snapshot nchar(64) = NULL
>   AS
>     IF EXISTS (SELECT 1 FROM [ESS].[t_streams_myStore] s WHERE s.streamId = @streamId AND s.lastCommitId != @lastCommitId)
>       RAISERROR('Concurrency exception', 0, 0)
>     ELSE
>       INSERT INTO [ESS].[t_commits_myStore] (commitRef, streamId, lastCommitId, events, metadata, snapshot)
>       VALUES (@commitRef, @streamId, @lastCommitId, @events, @metadata, @snapshot)
> }

  CREATE PROCEDURE [ESS].[sp_commitsinsert]
    @commitRef nchar(64),
    @streamId int,
    @lastCommitId int,
    @events nchar(64),
    @metadata nchar(64) = NULL,
    @snapshot nchar(64) = NULL
  AS
    IF EXISTS (SELECT 1 FROM [ESS].[t_streams_myStore] s WHERE s.streamId = @streamId AND s.lastCommitId != @lastCommitId)
      RAISERROR('Concurrency exception', 0, 0)
    ELSE
      INSERT INTO [ESS].[t_commits_myStore] (commitRef, streamId, lastCommitId, events, metadata, snapshot)
      VALUES (@commitRef, @streamId, @lastCommitId, @events, @metadata, @snapshot)

(tools) 8 % set stmt [my_mssql_con prepare $sql_stmt]
::oo::Obj22::Stmt::1
(tools) 9 % set param_dict {}
(tools) 10 % set param_dict [$stmt params]
commitRef {name commitRef direction in type wvarchar precision 255 scale 0}
  streamId {name streamId direction in type wvarchar precision 255 scale 0} 
  lastCommitId {name lastCommitId direction in type wvarchar precision 255 scale 0} 
  events {name events direction in type wvarchar precision 255 scale 0} 
  metadata {name metadata direction in type wvarchar precision 255 scale 0} 
  snapshot {name snapshot direction in type wvarchar precision 255 scale 0}
(tools) 11 % set args {}
(tools) 12 % foreach v_name [dict keys $param_dict] arg $args {
>   if { ($v_name ne {}) && ([dict get $param_dict $v_name direction] ne "out") } {
>     dict set param_dict $v_name $arg
>   }
> }
(tools) 13 % puts $param_dict
commitRef {} streamId {} lastCommitId {} events {} metadata {} snapshot {}
(tools) 14 % set resultset [$stmt execute $param_dict]
[Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near the keyword 'PROCEDURE'.
[Microsoft][SQL Server Native Client 10.0][SQL Server]Statement(s) could not be prepared.
(executing the statement)
(tools) 15 %
(tools) 15 %
(tools) 15 % set sql_stmt {
>   CREATE PROCEDURE [ESS].[sp_commitsinsert]
>     _@commitRef nchar(64),
>     _@streamId int,
>     _@lastCommitId int,
>     _@events nchar(64),
>     _@metadata nchar(64) = NULL,
>     _@snapshot nchar(64) = NULL
>   AS
>     IF EXISTS (SELECT 1 FROM [ESS].[t_streams_myStore] s WHERE s.streamId = _@streamId AND s.lastCommitId != _@lastCommitId)
>       RAISERROR('Concurrency exception', 0, 0)
>     ELSE
>       INSERT INTO [ESS].[t_commits_myStore] (commitRef, streamId, lastCommitId, events, metadata, snapshot)
>       VALUES (_@commitRef, _@streamId, _@lastCommitId, _@events, _@metadata, _@snapshot)
> }

  CREATE PROCEDURE [ESS].[sp_commitsinsert]
    _@commitRef nchar(64),
    _@streamId int,
    _@lastCommitId int,
    _@events nchar(64),
    _@metadata nchar(64) = NULL,
    _@snapshot nchar(64) = NULL
  AS
    IF EXISTS (SELECT 1 FROM [ESS].[t_streams_myStore] s WHERE s.streamId = _@streamId AND s.lastCommitId != _@lastCommitId)
      RAISERROR('Concurrency exception', 0, 0)
    ELSE
      INSERT INTO [ESS].[t_commits_myStore] (commitRef, streamId, lastCommitId, events, metadata, snapshot)
      VALUES (_@commitRef, _@streamId, _@lastCommitId, _@events, _@metadata, _@snapshot)

(tools) 16 % set stmt [my_mssql_con prepare $sql_stmt]
::oo::Obj22::Stmt::2
(tools) 17 % set param_dict {}
(tools) 18 % set param_dict [$stmt params]
(tools) 19 % set args {}
(tools) 20 % foreach v_name [dict keys $param_dict] arg $args {
>   if { ($v_name ne {}) && ([dict get $param_dict $v_name direction] ne "out") } {
>     dict set param_dict $v_name $arg
>   }
> }
(tools) 21 % puts $param_dict

(tools) 22 % set resultset [$stmt execute $param_dict]
[Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near '_@commitRef'.
[Microsoft][SQL Server Native Client 10.0][SQL Server]Statement(s) could not be prepared.
(executing the statement)
(tools) 23 %