Generate REST API from mysql database in less than 5 minutes

Representation State Transfer is the new industry standard of building technology neutral API's. REST API are essentially web services to read or transfer data. REST API's can be build on top of most relational databases. Mysql being the most popular database around. If you have nodejs and mysql already installed, you can build a REST … Continue reading Generate REST API from mysql database in less than 5 minutes

Generate Excel and PDF in Oracle and Send Report by Email

First Install UTL_MAIL ### To install UTL_MAIL: [code language="sql"] sqlplus sys/**** @$ORACLE_HOME/rdbms/admin/utlmail.sql @$ORACLE_HOME/rdbms/admin/prvtmail.plb [/code] ### Create a Reporting User ### [code language="sql"] create user tctreport identified by tctreport; grant connect to tctreport; grant dba to tctreport; sqlplus tctreport/tctreport [/code] ## Grant TCTREPORT User permission to execute UTL_MAIL ## [code language="sql"] sqlplus "/as sysdba" grant execute … Continue reading Generate Excel and PDF in Oracle and Send Report by Email

Generate DDL from a Data Pump Export File

-- Get DDL from impdp -- The below command will not import the dump, but will just create a .sql file with the DDL statements impdp system/**** directory=import_dir dumpfile=IMPORT.DMP sqlfile=getddl.sql

Generate Insert Statements Dynamically

-- Insert statements dynamically -- Select 'insert into abc values('||col1||','||col2||','||col3||','||col4||');' from xyz;    

Generate Excel | CSV Report from SQL*PLUS

Shell Script to generate a column seperator report in SQL*PLUS using a shell script. It can be opened in Excel and or text editor like NOTEPAD++   #!/bin/ksh . $HOME/.bash_profile NOW=$(date +”%a %b %e %T %Y”) HOST=$(hostname) MON2=$(date +”%b%Y”) cd $HOME/scripts rm -rf Report_$MON2.csv sqlplus -s /NOLOG << EOF > /tmp/log.txt CONNECT abc/***** set colsep … Continue reading Generate Excel | CSV Report from SQL*PLUS

Generating HTML Reports from SQL*Plus

This is a script to query a table, generate the result in HTML and send an email using mailx for the report.   #!/bin/ksh . $HOME/.bash_profile NOW=$(date +"%a %b %e %T %Y") MON=$(date +"%b %Y") MON2=$(date +"%b%Y") HOST=$(hostname) cd $HOME/scripts rm -rf  Report*.html sqlplus -s /NOLOG << EOF > /tmp/log.txt CONNECT abc/******** set pagesize 1000 … Continue reading Generating HTML Reports from SQL*Plus