PDA

View Full Version : Q: Howto Drop or remove table.



Jan Ole Andreasen
9-Nov-2005, 07:49 AM
Hi' there

Within Structure_start .. _End how can you remove a table from e.g. MSSQL

Can it be done or do you have to execute a SQL command.

Perhaps I should ask Peter Tawse, as i can see he just succeeded to remove
an entire table in pSQL. <g>

Kind regards

Jan Ole Andreasen

Anders Öhrt
9-Nov-2005, 09:33 AM
> Within Structure_start .. _End how can you remove a table from e.g. MSSQL

I don't know about MSSQL, but with PSQL this works:

Set_Attribute DF_FILE_LOGICAL_NAME Of hFile To ""
Set_Attribute DF_FILE_ROOT_NAME Of hFile To ""
Set_Attribute DF_FILE_DISPLAY_NAME Of hFile To ""

This will "unlink" the file from the filelist, and you can then delete the
file with EraseFile.

// Anders

Jan Ole Andreasen
9-Nov-2005, 10:14 AM
"Anders Öhrt" <Anders.Ohrt@capslock.se> wrote in
news:AssDZqT5FHA.2708@dacmail.dataaccess.com:

>
>> Within Structure_start .. _End how can you remove a table from e.g.
>> MSSQL
>
> I don't know about MSSQL, but with PSQL this works:
>
> Set_Attribute DF_FILE_LOGICAL_NAME Of hFile To ""
> Set_Attribute DF_FILE_ROOT_NAME Of hFile To ""
> Set_Attribute DF_FILE_DISPLAY_NAME Of hFile To ""
>
> This will "unlink" the file from the filelist, and you can then delete
> the file with EraseFile.
>
> // Anders
>
>
>

Hi' Anders

I know of the filelist operation, but does ie
..
Set_File_Physical_Name of hStruct to ""
..
drop the table in PSql or does you have to delete the table manually?

Jan Ole

Ben Weijers
9-Nov-2005, 02:07 PM
Jan Ole,

You cannot do this inside a structure_start .. _end operation. Such an
operation is intended to be used to create or update table definitions. If
you want to drop a physical table use Delete_DB.

Regards,

Ben Weijers
Data Access Worldwide

Marco
13-Nov-2005, 10:48 PM
Hi Jan,

I would unlink from the filelist, then drop using DDL in embedded SQL.
'Drop table MyTable'

Cheers,
Marco

Jan Ole Andreasen wrote:
> Hi' there
>
> Within Structure_start .. _End how can you remove a table from e.g. MSSQL
>
> Can it be done or do you have to execute a SQL command.
>
> Perhaps I should ask Peter Tawse, as i can see he just succeeded to remove
> an entire table in pSQL. <g>
>
> Kind regards
>
> Jan Ole Andreasen