Help - Search - Members - Calendar
Full Version: help with oracle export with query option
Oracle DBA Forums > Oracle > Oracle Forum
Shannon
I need help with an export with query option. I have a script that includes the following

auddate=`date '+20%y%m%d'`
file="cal_shrlgpa"$auddate".dmp"
exp / file=$file tables=shrlgpa query\=" where shrlgpa_pidm in (Select sztahbr_pidm from purdue.sztahbr where sztahbr_to_extract\=\'Y\' and sztahbr_export_status\=\'N\')\"
echo 'cal export file created:'$file

when I run the script, I get the following error:
cal_export_tables.sh[7]: 0403-057 Syntax error at line 7 : `"' is not matched.


Can someone help me with the query option?
SteveC
What makes you think the query is wrong? What's wrong is the shell script, that is what the error is telling you.
burleson
>> query\=" where shrlgpa_pidm in (Select sztahbr_pidm from purdue.sztahbr where sztahbr_to_extract\=\'Y\' and sztahbr_export_status\=\'N\')\"

I've never tried an export with a subquery, it may not be supported.

Here are some working examples of an export with the query option (where clause):

http://www.dba-oracle.com/t_export_expdp_b...c_variables.htm

The error suggests inbalanced quotes, and I would simplify it, adding more until you discover the issue.

Try this first: removing the subquery (where shrlgpa_pidm in (Select sztahbr_pidm from purdue.sztahbr )

query\="where sztahbr_to_extract\=\'Y\' and sztahbr_export_status\=\'N\')\"
Shannon
I got it to work by putting the query option in a .par file.

Thanks.
Shannon
Arthritic Toe
QUOTE (Shannon @ Jun 25 2008, 05:12 PM) *
I need help with an export with query option. I have a script that includes the following

auddate=`date '+20%y%m%d'`
file="cal_shrlgpa"$auddate".dmp"
exp / file=$file tables=shrlgpa query\=" where shrlgpa_pidm in (Select sztahbr_pidm from purdue.sztahbr where sztahbr_to_extract\=\'Y\' and sztahbr_export_status\=\'N\')\"
echo 'cal export file created:'$file

when I run the script, I get the following error:
cal_export_tables.sh[7]: 0403-057 Syntax error at line 7 : `"' is not matched.
Can someone help me with the query option?

You delimited everthing except...
... the first double quote!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.