Hi there,
what's going wrong at this point?
The table ist still in the database and as well as a file in the data folder.Code:open database myDatabase if used("myTable") use in myTable endif drop table myDatabase!myTable
Hi there,
what's going wrong at this point?
The table ist still in the database and as well as a file in the data folder.Code:open database myDatabase if used("myTable") use in myTable endif drop table myDatabase!myTable
Thanks
Stefan
Try this:
See: http://www.lianja.com/community/show...previous-tableCode:if used("myTable") close myTable endif drop table myDatabase!myTable
Last edited by josipradnik; 2020-12-01 at 10:49.
Thanks, josipradnik!
Maybe it would be a nice idea to combine "USE" under "See also" with "CLOSE" in the documentation.
Result: The table is out of the database container. It's still on the hard drive.Code:if used("myTable") close myTable endif drop table myDB!myTable
Target was to DELETE it. Like I can do in workarea Data, right click on a table -> Delete... Only I want to do it programmatically.
Therefore I found in the documentation "DROP" (DROP TABLE [<database>!]<table> [NODELETE]). Using it without "NODELETE" should do that.
So, sorry, but my question again: What's going wrong here?
Last edited by zehnernet; 2020-12-02 at 01:47.
Thanks
Stefan
When I do not use "myDB!" in DROP TABLE, the file is gone.
Try
and submit the ticket for bug for not erasing the file without NODELETE.Code:if used("myTable") close myTable endif drop table myTable
Last edited by josipradnik; 2020-12-02 at 10:10.
Hi Stefan,
Looks like you should send in a ticket. a) recreate by creating a database (create an empty database, copy the employees files over from the Southwind database, rebuild the database) b) executing the set of steps If it replicates, c) write up a ticket with all the steps taken for replication.
Hank
Hi Stefan,
DROP commands (TABLE INDEX etc) that operate on database objects e.g a TABLE should not be prefixed with name! as that is a path name.
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
Oh man! Actually, I assume that as a newbie I am making mistakes here and not that there is a bug ...
Anyway, I'll try to create an example with the southwind database.
First of all, an overview of what I'm trying to do here. Maybe an example is superfluous because I am doing something fundamentally wrong, because it is different in Linja compared to VFP.
I have a VFP database that I've simply dragged and dropped into Lianja. I would like to transfer the data from this database to a new, existing Lianja-Database. The whole thing has to run programmatically because the database design is to be changed. Means that fields of one table come into other tables, etc..
Here is a rudimentary code:
With the indication of the "databasename!" I always played around to avoid deleting or writing the wrong table. Most of the names of the target tables are identical to the source tables...Code:CLOSE DATABASES ALL OPEN DATABASE targetdatabase EXCLUSIVE ... USE sourcedatabase!Sourcetable IN 0 SHARED ... further source tables are opened IF USED ('targettable') CLOSE targettable ENDIF DROP targetdatabase!Targettable // removed from the database, but not deleted on harddrive. Or: DROP targettable // Error: Permission denied // I just don't get this error if I close all databases outside of my code in the App Builder on the data workspace. // A CLOSE DATABASES ALL in the program is apparently not enough ... CREATE TABLE targetdatabase!Targettable (...) // probably also without "targetdatabase!" possible... SELECT sourcetable SCAN ... shovel data into the newly created table ENDSCAN RETURN
Last edited by zehnernet; 2020-12-03 at 02:40.
Thanks
Stefan
Hi Stefan
DROP TABLE targettable
not
DROP targettable
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
And by the way... you don'y need any SCAN ENDSCAN for that
and VFP table can be converted just by use COPY TO.
use the_VFP_table
copy to the_LIANJA_table
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
Bookmarks