Home > Archive > Tcl > June 2007 > tclodbc
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| obienert 2007-06-28, 7:12 pm |
| Hello,
My system: WinXP, SqlServer 2005 ExpressEdition, tclodbc2.3
In my project, I need a temporary table in sql server. In order to
achieve this you have to put a '#' in front of table name. However, I
cannot do this via tclodbc:
(bin) 67 % set cmd {db {create table dbo.#pguids(pguid_ref char(32))}}
db {create table dbo.#pguids(pguid_ref char(32))}
(bin) 68 % eval $cmd
-1
(bin) 69 % set cmd [list db {select * from dbo.#pguids}]
db {select * from dbo.#pguids}
(bin) 70 % eval $cmd
S0002 208 {[Microsoft][SQL Native Client][SQL Server]Ung=FCltiger
Objektname '#pguids'.}
That means, the system cannot find the table specified. The above
statements work successfully within SqlServer Management Console.
Is this a drawback from the '#' sign which is special to tcl? But I
have it declared within brackets and list, which is an usual way
around such problems.
By the way, tclodbc package is now more then 6 years old, without any
improvements? What about a new release?
Regards Oliver
| |
| Jeff Hobbs 2007-06-30, 4:18 am |
| obienert wrote:
> By the way, tclodbc package is now more then 6 years old, without any
> improvements? What about a new release?
To my knowledge ODBC hasn't changed much in that time. Anything in
particular you were searching for?
FWIW, there have been configure updates, just not core code updates.
Jeff
| |
| Oliver Bienert 2007-06-30, 4:18 am |
| Jeff Hobbs schrieb:
> obienert wrote:
>
> To my knowledge ODBC hasn't changed much in that time. Anything in
> particular you were searching for?
>
> FWIW, there have been configure updates, just not core code updates.
>
> Jeff
The strange thing is, that I am able to create global temporary objects
(objects whose name starts with ##), however local temporary tables
don't work.
So I wonder how tclodbc driver acts internally. There is a Microsoft
support article pointing at this problem:
http://support.microsoft.com/kb/155818
that reads:
If an ODBC application attempts to create a local temporary table or
procedure in an SQL command issued using SQLPrepare() and SQLExecute(),
subsequent references to the object might get errors that the object
does not exist. For example, if an application does:
SQLPrepare(hstmt,
"create table #sometable(cola int, colb char(8))",
SQL_NTS);
SQLExecute(hstmt);
Subsequent references to #sometable will fail with object not found errors.
So my question is, which model is used by tclodbc to execute SQL
commands? I can have a look at the source code myself, but I am not a c
expert, ly.
Regards Oliver
|
|
|
|
|