First of all, I wish to all of you a happy New Year and a good 2020! I have switched to the SQL Anywhere native driver and finding now some occurance of following errors. In the java.sql.SQLException: line (somewhere a bit below the middle of the code) it says Table '#TMP_8473482885' not found. This is the table it docs an insert (second line of code). As this is done by SQL Anywhere itself (my understanding) what could be the reason it can't find the temporary table?
|
INSERT INTO #tmp requires that the temporary table already exist. To create and populate a temporary table in a single statement, you would use the syntax select a,b,c into #tmp from t Note that the INTO in this form always creates a temporary table. The table name does not need to start with a pound sign. I have only the SELECT part (following the insert into #TMP_) in my code, not the insert part. I am assuming that comes from SQL Anywhere running the SELECT ...
(08 Jan '20, 08:35)
robert
Replies hidden
> in my code Please show us your code... the exact code, copy and paste, no edits, thanks! :)
(08 Jan '20, 08:43)
Breck Carter
It is unlikely that we are doing such a change - it would not be valid. The code appears to be generated. Perhaps this is happening in the software that eventually calls into SQL Anywhere.
(08 Jan '20, 13:35)
Chris Keating
Sorry for being late. Here is my code as it is in the Eclipse IDE using Servoy Developer (an Eclipse plugin). @Chris: If I understand you correctly, it seems Servoy Developer is creating the temp table. Thanks for the hint.
(13 Jan '20, 10:10)
robert
We can see that there is a significant difference between the query supplied and the query that is reported in the exception. I have no experience with Servoy but the documentation suggests that the query must have an ORDER BY on the primary keys (and if I understand correctly, the query must just return the primary keys and I cannot tell if the source query complies and should do so).
(13 Jan '20, 14:06)
Chris Keating
There is an additional insert into #ZMO_ ... part, but the SELECT part is the one of my SELECT code. The ODRDER BY is there (and Collies as you refer to), done with a sorting of the the foundset (where the result of the SELECT is temporary stored). ORDER BY can be done this way (sorting the foundset) as well as an ORDER BY clause in the SELECT statement. I have to speak to the Servoy people to find out about the error and why it does not find the TMP table. Thanks a lot for your answer.
(23 Jan '20, 05:59)
robert
|