1. How can I say if my command is executed succesfully on a shell.
2. How can I read a file using a shell script. How can I distinguish Row and a Column in that script
3. How can I handle errors in PL/SQL blocks
4. How can I extract data into files from scripts
5. Difference between inner and outer joins
6. If I did any Oracle optimization How can I tune a Oracle query
For your question 3,5,6 which are theoritical questions, you could find the information by checking in internet or any book for PLSQL
For your question no 4:
In order to transfer the data in to files in SHell script you can use redirect operator ">" or ">>"
Eg:
ls -l files.txt > a.txt
The above command will transfer the data generated by ls -l command in to file a.txt. The single ">" will over write the file. If the file a.txt does not exist then it creates new one
The operator ">>" is to append the data to the file. This operator also creates new file if the file does not exist!!
For transfer of data using PLSQL check below code:
-
-
SQL> SPOOL c:\a.txt
-
SQL> <yur query goes here>;
-
SQL> SPOOL off
-
-
For your Question no 2:
You can make use of SQL LOADER or EXTERNAL TABLES for transfer of data from flat file to oracle database.
ROWS are identified by end of line ie one line of data in the file will be considered as single row
COLUMNS are identified by some delimiter (space,tab,column etc)