Sql data

Retrive sqldata through shell script

It could be useful get data from DB by a  bash script Linux. Using a shell Bash is possible to create the following query: dir_in=sqlplus -s $PMS_CONN_STRING <<EOF SET PAGESIZE 0 FEEDBACK OFF VERIFY OFF HEADING OFF ECHO OFF select directory_path FROM all_directories WHERE directory_name = ‘GARBAGE_SFTP_AREA’; exit EOF Analyze this script. The query above, very simple, extracts a path from the system table all_directories where directory name is GARBAGE_SFTP_AREA. At the beginning, dir_in = indicate the variable where we’ll put the result (the value of directory_path field). With the symbol s COMMAND  bash execute the command between  and replace Read More

Retrive sqldata through shell script

It could be useful get data from DB by a  bash script Linux. Using a shell Bash is possible to create the following query: dir_in=sqlplus -s $PMS_CONN_STRING <<EOF SET PAGESIZE 0 FEEDBACK OFF VERIFY OFF HEADING OFF ECHO OFF select directory_path FROM all_directories WHERE directory_name = ‘GARBAGE_SFTP_AREA’; exit EOF Analyze this script. The query above, very simple, extracts a path from the system table all_directories where directory name is GARBAGE_SFTP_AREA. At the beginning, dir_in = indicate the variable where we’ll put the result (the value of directory_path field). With the symbol s COMMAND  bash execute the command between  and replace Read More