在unix上使用SQL查询[重复](using SQL query on unix [duplicate])
可能重复:
使用shell脚本从sql脚本中选择列到本地变量我试图编写一个unix脚本,它将使用sql查询检索一个参数,然后用这个参数运行一个脚本。 暂时,我只是试着让它回应检索到的参数。 在toad(oracle 8)上正常工作的sql查询是:
select billcycle from bc_run where billcycle not in (50,16) and control_group_ind is null and billseqno=6043
上面的查询给出了一个数字。
现在我写的脚本是:
#!/bin/bash echo "this script will print the billcycle date" v_bc=`sqlplus -s /@bscsprod <<EOF select billcycle from bc_run where billcycle not in (50,16) and control_group_ind is null and billseqno=6043` echo "billcycle number is $v_bc"
我运行文件时的结果是
billcycle number is
没有数字跟随。
任何想法有什么不对? 也许连接到SQL Server的语法?
谢谢Assaf。
Possible Duplicate:
Select columns into local variable from sql script using shell scriptim trying to write a unix script that will retrieve a parameter using sql query and run a script afterwards with this parameter. for the time being, im just tryin to make it echo the retrieved parameter. the sql query that works fine on toad (oracle 8) is :
select billcycle from bc_run where billcycle not in (50,16) and control_group_ind is null and billseqno=6043
the above query give a number.
now the script i wrote is:
#!/bin/bash echo "this script will print the billcycle date" v_bc=`sqlplus -s /@bscsprod <<EOF select billcycle from bc_run where billcycle not in (50,16) and control_group_ind is null and billseqno=6043` echo "billcycle number is $v_bc"
the result when i run the file is
billcycle number is
with no number that follows.
any ideas what's wrong ? maybe the syntax for connecting to the sql server ?
thanks Assaf.
原文:https://stackoverflow.com/questions/14559874
最满意答案
如果您使用的是SVN 1.7,则只需删除工作副本根目录下的
.svn
文件夹即可。 对于以前的版本,您可以从所有文件夹中删除所有.svn目录,或使用“导出”命令将项目副本创建到其他位置,而不使用.svn目录。If you're using SVN 1.7, you can simply remove the
.svn
folder at the root of your working copy. For previous versions, you can remove all the .svn directories from all the folders, or use the Export command to create a copy of the project to another location, without the .svn directories.
相关问答
更多-
当前版本的TortoiseSVN默认不安装命令行SVN客户端。 你必须: 在安装程序中明确选择它(请参阅Stefan评论) 从http://subversion.apache.org/packages.html下载并单独安装。 Current versions of TortoiseSVN do not install command-line SVN client by default. You'll have to: Select it explicitly in the installer (see ...
-
你在用什么客户? svn checkout svn://repository/path@123 要么 svn checkout -r 123 url://repository/path 要么 TortoiseProc.exe /command:checkout /rev:1234 What client are you using? svn checkout svn://repository/path@123 or svn checkout -r 123 url://repository/path ...
-
我有同样的问题。 我的解决方案是: execute_process(COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR} svnversion -n OUTPUT_VARIABLE SVN_COMMIT) ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}位作为${CMAKE_CURRENT_SOURCE_DIR}的命令运行。 I had this same problem. My ...
-
如果您使用的是SVN 1.7,则只需删除工作副本根目录下的.svn文件夹即可。 对于以前的版本,您可以从所有文件夹中删除所有.svn目录,或使用“导出”命令将项目副本创建到其他位置,而不使用.svn目录。 If you're using SVN 1.7, you can simply remove the .svn folder at the root of your working copy. For previous versions, you can remove all the .svn direc ...
-
如果你想在OS(vista和Win 7)中使用代码发布源代码的共享,将其映射为其他驱动器 - 如Y - 并在两个操作系统上再次检查项目到同一路径。 IF you want to use the code in both OS (vista and Win 7) publish a share for the source code, map it as other drive - like Y - and check out the project again on both os to the same ...
-
是的,将其添加为包含文件夹上的svn:ignore属性的值。 例如,使用此结构: SomeDirectory SomeDirectory\somefile.txt 你可以跑 svn propset svn:ignore somefile.txt SomeDirectory yes, add it as a value of the svn:ignore property on the containing folder. For example with this structure: SomeDire ...
-
你可以复制整个目录。 文件是文件,对他们来说没有任何魔力。 如果你想做一些更复杂的事情,比如在恢复之前以某种方式编辑存储库内容,那么你需要dump和load。 You can just copy the entire directory in and out. Files is files, there's nothing magic about them. If you want to do something more complicated, like edit the repository cont ...
-
您有多种选择: svnadmin hotcopy: http ://svnbook.red-bean.com/en/1.2/svn.ref.svnadmin.c.hotcopy.html svnadmin转储和svnadmin加载: http : //svnbook.red-bean.com/en/1.2/svn.ref.svnadmin.c.dump.html svnsync为您的存储库创建一个只读镜像: http : //svn.collab.net/repos/svn/trunk/notes/svns ...
-
它不会复制存储,没有。 SVN有效地将其数据存储为版本化文件系统树加上一桶文件数据,而trunk / include / abc.h将指向与tags / myTag / include / abc.h相同的文件数据。 现在将有两个路径来访问相同的代码副本,是的,但标签版本将修复到您进行复制的版本。 当你继续提交trunk / include / abc.h时,tags / myTag / include / abc.h将保持不变。 也就是说,你总是可以通过重新编写修订版号来引用trunk上的代码版本:你可以 ...
-
将SVN设置为忽略是否安全。(Is it safe to set SVN to ignore . in a directory that should be version controlled?)[2022-03-12]
根据您收到的svn diff的输出 ,您实际上是为资源target设置svn:ignore 。 此属性信息保存在父版本资源上(在本例中为项目根目录. ),以便可以独立于本地忽略设置将其提交到存储库。 鉴于此,提交财产变更是否安全? 这取决于你想要产生什么样的影响。 该文档对svn:ignore属性进行了说明: svn:ignore属性是告诉Subversion忽略可能存在于该目录的每个用户的工作副本中的文件的好方法,例如编译器输出...... 因此,通过提交此更改,您可以有效地忽略从存储库中提取项目的任何人 ...