关于oracle导出时的query用法

时间:2023-03-09 16:52:11
关于oracle导出时的query用法
QUERY参数后面跟的是where条件,值得注意的是,整个where子句需要使用""括起来,where子句的写法和SELECT中相同;
 如果是UNIX平台所有"和'都需要使用\u26469屏蔽它们的特殊含义:
exp test/test file=1.dmp log=1.log tables=testtable query="where c1=20 and c2=test"
注意:>,<,单引号等特殊字符需要转译
exp test/test file=1.dmp log=1.log tables=testtable query="where c1\>20 and c2=to_date\(\'20090506\',\'yyyymmdd\'\)"
 如果是windows平台,则使用下面的格式:
exp c/c@ncn file=c.dmp log=c.log tables=t query="""where id=1 and name='gototop'"""(使用unix下格式也是可以的,具体情况测试一下即可)