Query regarding Form Designer/runtime [message #81570] |
Mon, 03 March 2003 22:56  |
Vishnu Prajapati
Messages: 2 Registered: March 2003
|
Junior Member |
|
|
Dear Sir/Madam,
How can I execute any DDL command in Form runtime?
for Ex. : I want to create a table in When-Button-Press trigger, is it possible? if Yes How?
Please reply me in detail,
Thanking You,
Vishnu Prajapti
|
|
|
|
Re: Query regarding Form Designer/runtime [message #81604 is a reply to message #81578] |
Wed, 05 March 2003 04:08  |
JAFOD
Messages: 15 Registered: February 2003
|
Junior Member |
|
|
Just keep in mind that the user will need rights to create a table (not something every shop is willing to grant because you cannot limit the right to a specific table name). Assuming you can get this right, then you must also include DDL at the 'end' of your form to drop the table. Since you can never be absolutely sure the user does not exit the form without dropping it (ie: his computer crashes in the middle of the form), you should include logic ahead of the CREATE to test for the presence of this table and DROP it if it exists. Now you run into the problem that you must either make the table name dynamic, say USER || '_TEMP', so that each USER has his/her own private temp table, or risk the possibliity of one user DROPPING the table while another user is using it.
There is uusally less problematic way of accomplishing what you wish to do with this temp table, such as CREATING a single "permanent" temp table with a column for USER name, granting users DELETE rights on this table and using either a PRE-DELETE trigger in your form combined with a Row Level BEFORE DELETE database trigger on the table, or fine grain access control, to limit their delete rights to only those rows with their USER name.
Regards,
Paul
|
|
|