读书人

shell操作oracle的有关问题

发布时间: 2012-03-17 19:06:28 作者: rapoo

shell操作oracle的问题?
ibm unix

需要update oracle里一表

第一种情况
一table.txt文件 内容如下
name no time
hgc 86 20070508
hgc 82 20070508
hgc 81 20070508
idd 42 20070503..............

如何通过shell编程 来实现
update table2 set end_time= '20070508 '
where num= '86 ' and id= 'hgc '

update table2 set end_time= '20070508 '
where num= '82 ' and id= 'hgc '

....................

update table2 set end_time= '20070503 '
where num= '42 ' and id= 'idd '


第二种情况
一table.txt文件 内容如下
update table2 set end_time= '20070508 ' where num= '86 ' and id= 'hgc '

update table2 set end_time= '20070508 ' where num= '82 ' and id= 'hgc '

....................

update table2 set end_time= '20070503 ' where num= '42 ' and id= 'idd '

如何通过shell编程 来实现 执行table.txt 里的sql

由于对shell编程不太熟悉,任务比较急,所以希望大家多多帮忙


[解决办法]

读书人网 >Web开发

热点推荐