Dropping all user tables/sequences in Oracle

If you’re not intending on keeping the stored procedure, I’d use an anonymous PLSQL block: BEGIN –Bye Sequences! FOR i IN (SELECT us.sequence_name FROM USER_SEQUENCES us) LOOP EXECUTE IMMEDIATE ‘drop sequence ‘|| i.sequence_name ||”; END LOOP; –Bye Tables! FOR i IN (SELECT ut.table_name FROM USER_TABLES ut) LOOP EXECUTE IMMEDIATE ‘drop table ‘|| i.table_name ||’ CASCADE … Read more

How to insert a column in a specific position in oracle without dropping and recreating the table?

Amit- I don’t believe you can add a column anywhere but at the end of the table once the table is created. One solution might be to try this: CREATE TABLE MY_TEMP_TABLE AS SELECT * FROM TABLE_TO_CHANGE; Drop the table you want to add columns to: DROP TABLE TABLE_TO_CHANGE; It’s at the point you could … Read more

PLS-00428: an INTO clause is expected in this SELECT statement

In PLSQL block, columns of select statements must be assigned to variables, which is not the case in SQL statements. The second BEGIN’s SQL statement doesn’t have INTO clause and that caused the error. DECLARE PROD_ROW_ID VARCHAR (10) := NULL; VIS_ROW_ID NUMBER; DSC VARCHAR (512); BEGIN SELECT ROW_ID INTO VIS_ROW_ID FROM SIEBEL.S_PROD_INT WHERE PART_NUM = … Read more

copy from one database to another using oracle sql developer – connection failed

The copy command is a SQL*Plus command (not a SQL Developer command). If you have your tnsname entries setup for SID1 and SID2 (e.g. try a tnsping), you should be able to execute your command. Another assumption is that table1 has the same columns as the message_table (and the columns have only the following data … Read more

IO Error: The Network Adapter could not establish the connection

Either: The database isn’t running You got the URL wrong There is a firewall in the way. (This strange error message is produced by Oracle’s JDBC driver when it can’t connect to the database server. ‘Network adapter’ appears to refer to some component of their code, which isn’t very useful. Real network adapters (NICs) don’t … Read more