dimk
asked on
check exist table in Informix
hi
In informix coding,
while online program ruuning,
How to check whether a temporary table exist in database,
so that it can be drop before create another temporary with the same table name, to avoid duplicate.
end hi
In informix coding,
while online program ruuning,
How to check whether a temporary table exist in database,
so that it can be drop before create another temporary with the same table name, to avoid duplicate.
end hi
ASKER
hi, holz_13;
I understand what u meant. But, what if the transaction in the same database session.
I should drop the table before I create another table with the same table name, before I drop the table, I should known whether the table is exist in the database.
The question is here ...
How to check whether a temporary table exist in database ?
so that it can be drop before create another temporary with the same table name,
to avoid duplicate.
I understand what u meant. But, what if the transaction in the same database session.
I should drop the table before I create another table with the same table name, before I drop the table, I should known whether the table is exist in the database.
The question is here ...
How to check whether a temporary table exist in database ?
so that it can be drop before create another temporary with the same table name,
to avoid duplicate.
hi dimk
If you are doing everything in the same session the the only way is to issue a drop table command before you try to create another temp table with the same name. You are not allowed to use the same temp table name in the same session, so it must be explicitly dropped before you can re-use the name during the same database session.
holz_13
If you are doing everything in the same session the the only way is to issue a drop table command before you try to create another temp table with the same name. You are not allowed to use the same temp table name in the same session, so it must be explicitly dropped before you can re-use the name during the same database session.
holz_13
ASKER
ya, I can issue a drop table command.
but, what if the temporary table is not exist. the drop non-exist table command may cause program crash.
That's the reason I would like to know ...
How to check whether a temporary table exist in database ?
but, what if the temporary table is not exist. the drop non-exist table command may cause program crash.
That's the reason I would like to know ...
How to check whether a temporary table exist in database ?
I can't spend anymore time on this for the small amount of points that you have given it.
So, to be perfectly clear, the is no way to tell from inside a program if a temp table exists or not. If you want more of an explanation you need to increase the points.
So, to be perfectly clear, the is no way to tell from inside a program if a temp table exists or not. If you want more of an explanation you need to increase the points.
ASKER
Did the points enough ?
What information you can give me ?
What information you can give me ?
dimk
i use inforix for a while (1 year aprox) and the only way to do that is with a command that desactivate the crash program
the command is whenever error
you can desactivate the crash
drop your table
and reactivate your errors
if the table dont exists
the functions returns you a parameter indicates that the table dont exists, i use this command to verify existings files to load and it works
waiting for points!!!!
i use inforix for a while (1 year aprox) and the only way to do that is with a command that desactivate the crash program
the command is whenever error
you can desactivate the crash
drop your table
and reactivate your errors
if the table dont exists
the functions returns you a parameter indicates that the table dont exists, i use this command to verify existings files to load and it works
waiting for points!!!!
Did you solve your problem dimk????
ASKER
To lgmm;
sorry for late reply, because I was outstation past three weeks.
I use...
WHENEVER ERROR CONTINUE
DROP TABLE temptable15
#this work. how to reactivate errors ?
To holz_13;
If no comment then
I'll reject your amswer
else
pls comment
end if
TQ;
dimk
sorry for late reply, because I was outstation past three weeks.
I use...
WHENEVER ERROR CONTINUE
DROP TABLE temptable15
#this work. how to reactivate errors ?
To holz_13;
If no comment then
I'll reject your amswer
else
pls comment
end if
TQ;
dimk
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Informix will run house keeping on temporary table after program terminated.
In my case, the same name of temporary table needed to be re-create within program single run. I believe Igmm have hint the right, can you commend further.
In my case, the same name of temporary table needed to be re-create within program single run. I believe Igmm have hint the right, can you commend further.
Once that session is finished then the temporary table is gone. If you start a different session and use the same temporary table name there will not be a problem because one session cannot see the other session's temporary tables.