on ‎2020 Sep 28 11:54 AM
Hi Friends,
I came across CREATE LOCAL TEMPORARY TABLE and found that we can do delete and update operations on it whereas we cannot do any modification to the table created by CREATE LOCAL TEMPORARY COLUMN TABLE.
which one is better for usage in the SQL stored procedure and why? What if I always use CREATE LOCAL TEMPORARY TABLE? Is there any disadvantage?
Thanks,
Gaurav
Request clarification before answering.
Hi Gaurav,
Local temporary tables created using the CREATE LOCAL TEMPORARY TABLE statement remain until they are either explicitly dropped, or until the connection closes. Local temporary tables created in IF statements using CREATE LOCAL TEMPORARY TABLE also persist after the IF statement completes.
Tables created using CREATE LOCAL TEMPORARY TABLE do not appear in the SYSTABLE view of the system catalog.
I would suggest checking KBA 2800007 - FAQ: SAP HANA Temporary Tables for further details on creating the different types of temporary tables on SAP HANA. It also states typical errors and bugs regarding temporary tables.
For "CREATE LOCAL TEMPORARY TABLE", a known bug is identified and it is described by SAP Note 2568196 - CREATE LOCAL TEMPORARY TABLE Statement Gets Rolled Back by ROLLBACK.
Best Regards,
Anna Szalay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anna,
Thanks for your reply. I think you misunderstood my question, may be I didn't put it the right way. Let me rephrase it. I want to know the difference between the temporary tables created by
1. CREATE LOCAL TEMPORARY COLUMN TABLE
AND
2. CREATE LOCAL TEMPORARY TABLE
if you note that 2nd table is not a column table. However, we can do update and delete operation on this 2nd table which we cannot do it in temporary column table. I want to know the usage level information on which one to use when and why SAP has given update and delete operation capability to table created by CREATE LOCAL TEMPORARY TABLE and not created by CREATE LOCAL TEMPORARY COLUMN TABLE statement.
Thanks,
Gaurav
HDB 2.0 SP3
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.