Tuesday, June 4, 2013

Call sql files in Shell Script


Need to check the parameter (if parameter is passing to sql file)

Syntax

 sqlplus ${FCP_LOGIN} @’SQLFILE_NAME’ p1 p2

Check the return code status

sql file must end with exit statement

Example :

sqlplus ${FCP_LOGIN} @/sql/sample.sql

If [ “$?” = 0 ] ; then
   echo –e “sql statement is successfully executed”
fi

No comments:

Post a Comment

Oracle EBS: Query to Link OM Order Source with AR Grouping Rules and Attributes

SELECT      hou.name,     rtsa.name "Order Source/Transaction Source",     rtsa.description "Description",     gr1.name ...