0

Every time I try to get the DDL of a table, I got this error

Cannot create temporary table '#tmp'. Prefix name '#tmp' is already in use by another temporary table '#tmp'.
There is already another cursor with the name 'ccolumn' at the nesting level '0'.
There is already another cursor with the name 'cindex' at the nesting level '0'.
There is already another cursor with the name 'indexes' at the nesting level '0'.
There is already another cursor with the name 'cprotect' at the nesting level '0'.
Attempt to insert duplicate key row in object '#tmp00000450018282794' with unique index '_tmp_19748930791'

How can I solve it ?

Mike Gardner
  • 6,611
  • 5
  • 24
  • 34
Moudiz
  • 7,211
  • 22
  • 78
  • 156
  • 1
    What Sybase Product are you using, and what tool are you using to generate the DDL? – Mike Gardner May 20 '13 at 15:09
  • @MichaelGardner I am using ASE ISQL as a tool and Powerbuilder product. What should I do? – Moudiz May 21 '13 at 06:56
  • I'm not sure about using PB for DDL, but you can get the DDL for the table using the ASE `ddlgen` utility. – Mike Gardner May 21 '13 at 11:47
  • @MichaelGardner it is weird. Its working now, when the error presist i will try your fuction. – Moudiz May 21 '13 at 13:10
  • It could be becuase a previous attempt to generate the ddl was open in the database when this one ran. #tmp tables are session specific, so if you had closed everything out, and restarted, the tables should clear. – Mike Gardner May 21 '13 at 13:12

1 Answers1

0

#tmp tables are session specific temporary working tables used by applications to store data being manipulated. If you recieved an error that the table already exists, it indicates that either a previous attempt to generate the DDL was not yet complete when a new one was started, or the previous attempt has hung, and needs to be killed.

Assuming you are in a development environment, I would first try closing and restarting Powerbuilder to see if that clears the error. If it does not clear, the next thing to try would be to restart the database server that Powerbuilder is using as it's data source.

Alternatively you could manually connect to the database (via isql) and try killing the process that isn't closing out, and droping the #tmp table manually.

Mike Gardner
  • 6,611
  • 5
  • 24
  • 34
  • thanks for your answer, i will check it tomrow and ill see if it worked or not. – Moudiz May 21 '13 at 15:03
  • you said ' indicates that either a previous attempt to generate the DDL was not yet complete when a new one was started, or the previous attempt has hung needs to be killed' how i can i do that by ' killing the process'? how can i do that manually? – Moudiz May 22 '13 at 13:42