如何在批处理文件中的字符串周围传递单引号 [英] how to pass single quote around string in batch file
本文介绍了如何在批处理文件中的字符串周围传递单引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
按如下所示从批处理文件调用sql脚本
Calling a sql script from batch file as follows
@script.sql "pass" "primary_key_1"
呼叫脚本显示为
insert into values(pass,primary_key_1)
我想显示为
insert into values('pass','primary_key_1')
推荐答案
如果使用script.sql,其中:
If script.sql where:
INSERT INTO <some_table> VALUES ('&1', '&2');
然后
像这样从SQL * Plus调用script.sql:
calling script.sql from SQL*Plus like so:
@script.sql 'pass' 'primary_key_1'
应该会产生预期的结果.
should yield the desired results.
从OS命令提示符处调用它:
Calling it from an OS Command prompt:
sqlplus user/password@db @script.sql "pass" "primary_key_1"
也应具有预期的结果.
这篇关于如何在批处理文件中的字符串周围传递单引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文