[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


Unix Korn Shell, dynamic creation of parfile using to_date('$var','dd-mon-yy')

Posted on 2004-10-25
Medium Priority
Last Modified: 2012-05-05

need to dynamically create exp parfile

1.  seed load.par to target parfile:  gl_bal_je_hdr_lin.par

cat load.par > gl_bal_je_hdr_lin.par

2.  populate command line argument, $start_date, into parfile query string
fyi.  export var2=\"

echo query = $var2 'where period_name in
(select period_name
 from gl_periods
start_date >= to_date($start_date,DD-MON-YY)) ' $var2  >> gl_bal_je_hdr_lin.par

3.  problem is the output of above statement is this:

query = " where period_name in
(select period_name
 from gl_periods
start_date >= to_date(01-AUG-03,DD-MON-YY))  "

4.  the solution for the target parfile needs to have single quotes such as this:

start_date >= to_date('01-AUG-03','DD-MON-YY'))

5. TASK:  correct output in step 3, to include single quotes as identified in stop 4.
Question by:ORACLEtune
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
LVL 15

Accepted Solution

ishando earned 400 total points
ID: 12406301
try :

echo "query = \" where period_name in
(select period_name
 from gl_periods
start_date >= to_date('$start_date','DD-MON-YY')) /" "  >> gl_bal_je_hdr_lin.par

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Via a live example, show how to take different types of Oracle backups using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question