Home  >  Article  >  Database  >  shell 调用Oracle数据库方法

shell 调用Oracle数据库方法

WBOY
WBOYOriginal
2016-06-07 17:27:52930browse

shell 调用Oracle数据库方法 addStudent(){ LOGPATHFILE=/home/test/user/xxxx/log/bdfWarn.log UID=$1 UNAME=$2 UAGE=$3 USE

shell 调用Oracle数据库方法

addStudent(){
  LOGPATHFILE=/home/test/user/xxxx/log/bdfWarn.log
  UID=$1
  UNAME=$2
 
UAGE=$3
 
USEX=$4
 
 db_user= 这里填写用户名
 
 db_password= 密码
 
 db_server= 服务名 or SID
 
 table=user_info
 
 
  sql="insert into "$table"(UID,UNAME,UAGE,USEX) values('"$UID"','"$UNAME"',$UAGE,'"$USEX"');"
  echo $sql | sqlplus -S $db_user/$db_password@$db_server >>$LOGPATHFILE
 }
 
调用:addStudent  1001  黄小敏 22 女

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn