[GRASS-dev] table only creation in v.in.ascii
Moritz Lennert
mlennert at club.worldonline.be
Thu Jan 10 08:41:17 EST 2008
On 10/01/08 13:52, Benjamin Ducke wrote:
> OK, I have it almost working except for one annoyance:
>
> If the table already exists, then --o should allow the user to
> overwrite it. Thus, I check for that flag and delete the old
> table, if it exists, using:
>
> db_delete_table ( connection.driverName, connection.databaseName,
> new->answer );
>
> But even so, the next call to
>
> db_execute_immediate()
>
> complains about the table still being there and creation of the
> new table fails.
> I suppose that db_delete_table() does not delete the table immediately?
db_delete_table() sends a "drop table XYZ" sql query to the database
backend, so it should delete the table.
Launching
echo "drop table ggg" | db.execute
followed by
echo "create table ggg (cat int, value double)" | db.execute
works without a problem.
What does db_delete_table return ?
Moritz
More information about the grass-dev
mailing list