Delete in table via Shell Script

Asked

Viewed 175 times

2

I am trying to delete all rows of a table through Shell Script. The database is oracle. The database for some reason does not let me truncate and delete simply does not delete, without presenting any error. I don’t really know why, when trying to do such operations through PL/SQL Developer, I can normally, but through Linux I can’t.

Code I’m using:

    sqlplus -s usuario/senha <<EOF 
    delete from table;
    exit;
    EOF
  • I’m no expert on the oracle but I wouldn’t have to use commit; after the delete and before the exit?

1 answer

1


I discovered that my problem was that the bank was preventing me from carrying out such action. I could see and insert, but deleting was not possible because the table was 'locked'. After a conversation with a DBA we 'released' the table and managed to run delete. Thanks for the help. The code remained the same.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.