469,292 Members | 1,454 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,292 developers. It's quick & easy.

I can't create a temp table

Hi all!
I have a problem with a temp table.
I start creating my table:

bdsqlado.execute ("CREATE TABLE #MyTable ...")

There is no error. The sql string has been tested and when it's
executed in the sql query analyzer it really creates the table.

After creating the table, I execute an insert statement:

bdsqlado.execute ("INSERT INTO #MyTable VALUES(...) "

It returns an error like this: "Invalid Object Name #MyTable"

I don't understand what's wrong. If I execute both sql sentences in
the SQL Query Analyzer it works perfectly.
I use the same connection to execute both statements and I don't close
it before the INSERT is executed.
I think it may be something related to dynamic properties of the
connection, but I'm not sure. It's just an idea.

Please I need help.

Thanks a lot,
Jul 20 '05 #1
1 3119


Sergio wrote:
Hi all!
I have a problem with a temp table.
I start creating my table:

bdsqlado.execute ("CREATE TABLE #MyTable ...")

There is no error. The sql string has been tested and when it's
executed in the sql query analyzer it really creates the table.

After creating the table, I execute an insert statement:

bdsqlado.execute ("INSERT INTO #MyTable VALUES(...) "

It returns an error like this: "Invalid Object Name #MyTable"
Hi. Let me play Kreskin... I'm guesing you're using JDBC, and MS's
free driver. If this is true, add the property selectMode=cursor to
your connection properties. What is happening is that the driver
*is spawning multiple actual DBMS connections* to support a
single logical connection having multiple concurrent open statements.
This means the spid of one statement will be different than another, and
therefore one statement will not be able to see another's temp table!

Joe Weinstein


I don't understand what's wrong. If I execute both sql sentences in
the SQL Query Analyzer it works perfectly.
I use the same connection to execute both statements and I don't close
it before the INSERT is executed.
I think it may be something related to dynamic properties of the
connection, but I'm not sure. It's just an idea.

Please I need help.

Thanks a lot,


Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Yossi Naggar | last post: by
1 post views Thread by Liya | last post: by
3 posts views Thread by Wiggy | last post: by
17 posts views Thread by Jon Ole Hedne | last post: by
1 post views Thread by Robert McEuen | last post: by
2 posts views Thread by lenygold via DBMonster.com | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.