就是在一个shell文件中调用一个sql文件,并传递一个参数到这个sql文件中,不能用存储过程

解决方案 »

  1.   

    aa.sql的内容select * from &tablename;E:\>sqlplus system/genome @e:\aa.sqlSQL*Plus: Release 10.2.0.1.0 - Production on 星期一 8月 6 12:18:56 2007Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    连接到:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options输入 tablename 的值:  dual
    原值    1: select * from &tablename
    新值    1: select * from dualD
    -
    XSQL>
      

  2.   

    C:\tmp>type test.sql
    set verify off
    select '&1' from dual;
    exitC:\tmp>sqlplus username/password@server @test.sql "any string"SQL*Plus: Release 9.2.0.1.0 - Production on 星期一 8月 6 13:37:12 2007Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    连接到:
    Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.4.0 - Production
    'ANYSTRING'
    --------------------
    any string从Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.4.0 - Production中断开C:\tmp>