Kasper Nielsen wrote:
> I have these commands
> TABLE EXISTS sometable
> DROP TABLE sometable
>
> Now I want do something like
> IF TABLE EXISTS sometable THEN DROP TABLE sometable
>
> Whats the exact syntax?
Which tool do you want to use or which programming language is your
preferred one?
If you ask how it can be done in SQL with one statement : That is not
possible.
If you ask how it can be done in the kernel with one DBProcedure :
by now it cannot be done and there are no plans to make it available.
1) The exists-table-statement is not available in dbprocs.
You have to do something like
SELECT ... FROM DOMAIN.TABLES where tablename = 'SOMETABLE'
2) DROP TABLE is only available for temporary tables if it is done in
dbprocs.
And the tablename has to be given as identifier, not as parameter.
And dynamic SQL is not available in dbprocs.
--> you have to use some tool/programming language to do it.
Elke
SAP Labs Berlin
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general