×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Problem with temp table

Problem with temp table

Problem with temp table

(OP)
HI ALL,
I'm using a temp table in a fucntion to store temporary results, but when calling the same function i've a problem saing that the temporary table already exist. What can be the cause and what is the solution?
I use informix Online edition 11. in an AIX serever.

the function begins with
whenevere error continue
  DROP TABLE temp_table1
  DROP TABLE temp_table2
whenevere error stop

the second cause the problem.
Any Help?

RE: Problem with temp table

I don't mean to elaborate on the obvious, but years ago, I saw a similar problem in Informix stored procedures.  The work around was I had to drop the temp tables before exiting the procedure.
 

RE: Problem with temp table

(OP)
Hi olded,
i've tried to drop the two temp tables before exiting the function with the same portion of code, but this works only the first time and i get the same problem after with also the second table, the first do not cause any problem!
Anyway Thank you.
 

RE: Problem with temp table

Hi,

i do this with an exception handler like this:

CODE

create procedure mb_1();

ON EXCEPTION IN (-958)
drop table tmp_t1;
END EXCEPTION WITH RESUME;

create temp table tmp_t1 (field1 integer);
create temp table tmp_t1 (field1 integer);

end procedure;

The second create table fires error 958 which results in dropping the temp table.

RE: Problem with temp table

(OP)
Hi mberni,
i've used prepared statement when creating temp tables and i've no problem now. I did not tested yet your solution, but i will try it as soon as possible.
Thanks mberni.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close