如何从命令行运行db2 sql命令? [英] how to run db2 sql command from a command line?

查看:247
本文介绍了如何从命令行运行db2 sql命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何运行


  • sql命令更新联系人
    SET EMAIL_ADDRESS ='mytestaccount @ gmail通过命令行



  • 对于db2数据库

  • 来自shell脚本文件的linux


  • sql command UPDATE CONTACT SET EMAIL_ADDRESS = 'mytestaccount@gmail.com'
  • via command line
  • for db2 database
  • on linux
  • from a shell script file?

推荐答案

>您需要使用其.profile中具有db2profile的ID登录到您的Linux机器。

You need to be logged into your linux machine with an id that has "db2profile" in it's .profile.

如果您不确定我在说什么,查看db2实例所有者的.profile(通常是db2inst1,除非您在安装期间更改它)。最简单的事情可能是以db2实例所有者身份登录。

If you are not sure what I'm talking about, look at the .profile of the db2 instance owner (usually db2inst1 unless you changed it during the install). The simplest thing would probably be to log in as the db2 instance owner.

登录后,在命令行中键入db2。如果未找到db2,请重新检查.profile文件。

Once you are logged in, type "db2" at the command line. If "db2" is not found, then recheck the .profile stuff.

要执行您的sql命令,请在命令行中键入以下命令(以数据库名称替换您要连接到):

To execute your sql command type the following at the command line (substitute with the name of the database you want to connect to):

db2 connect to <database name>
db2 UPDATE CONTACT SET EMAIL_ADDRESS = 'mytestaccount@gmail.com'

这篇关于如何从命令行运行db2 sql命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆