当我在“oracleCommand”之间添加双引号时,如何消除USER1错误?我需要使用下面的查询,因为oracleCommand和USER1都有双引号,C#认为我的命令只有USER1,但实际上“选择……"USER1”.......dual“。
using (OracleCommand crtCommand = new OracleCommand("SELECT REGEXP_REPLACE ( REPLACE ( dbms_metadata.get_ddl ('PROCEDURE', 'HELL_'), '"USER1".'),'^\s+', NULL, 1, 0, 'm') FROM dual", conn2))我怎么能像下面那样修改
using (OracleCommand crtCommand = new OracleCommand(@"SELECT REGEXP_REPLACE ( REPLACE ( dbms_metadata.get_ddl ('PROCEDURE', '+ Items +'), '"" + txtSrcUserID.Text.ToUpper() + "".'),'^\s+', NULL, 1, 0, 'm') FROM dual", conn1))发布于 2013-08-12 01:57:44
使用"@“处理逐字字串文字,如下所示:
using (OracleCommand crtCommand = new OracleCommand(@"SELECT REGEXP_REPLACE ( REPLACE ( dbms_metadata.get_ddl ('PROCEDURE', 'HELL_'), '""USER1"".'),'^\s+', NULL, 1, 0, 'm') FROM dual", conn2))https://stackoverflow.com/questions/18178551
复制相似问题