在Powershell中的Oracle查询中使用II运算符

在Powershell中的Oracle查询中使用II运算符,oracle,powershell,plsql,Oracle,Powershell,Plsql,我正试图定义一个$queryString来用于Oracle数据库。我还需要能够将一些查询与| |运算符连接起来。我认为问题在于Powershell将其视为管道运营商。我也尝试过以\|和“”|两种形式使用escape,但两种方式都不起作用。作为参考,这里是我使用的查询 $queryString = 'select v.npa || v.calling_number phone_number, v.location, v.customer_name ' $queryString += 'from v

我正试图定义一个$queryString来用于Oracle数据库。我还需要能够将一些查询与| |运算符连接起来。我认为问题在于Powershell将其视为管道运营商。我也尝试过以\|和“”|两种形式使用escape,但两种方式都不起作用。作为参考,这里是我使用的查询

$queryString = 'select v.npa || v.calling_number phone_number, v.location, v.customer_name '
$queryString += 'from voip_validate v '
$queryString += 'left outer join phone_numbers p '
$queryString += 'on v.npa || v.calling_number = p.area_code || p.phone_prefix || p.phone_suffix '
$queryString += 'left outer join mv_dps_buildings b '
$queryString += 'on b.dps_building_number = p.dps_building_number '
$queryString += 'where p.area_code is null '
$queryString += 'and p.phone_prefix is null '
$queryString += 'and p.phone_suffix is null; '

在此处使用
字符串
(http://technet.microsoft.com/en-us/library/ee692792.aspx):


在此处使用
字符串
(http://technet.microsoft.com/en-us/library/ee692792.aspx):


什么不起作用?我在PS3.0和PS2.0中运行它,它返回一个包含
|
部分的字符串。你用的是PS1.0吗?我用的是PS2.0。我一直收到一个错误,说它缺少来自的,我一直把它归因于把| | |误解为管道而不是concat。什么不起作用?我在PS3.0和PS2.0中运行它,它返回一个包含
|
部分的字符串。你用的是PS1.0吗?我用的是PS2.0。我一直收到一个错误,说它缺少来自的,我一直把它归因于把| | |误解为管道而不是concat。
$queryString = @'
select v.npa || v.calling_number phone_number, v.location, v.customer_name 
from voip_validate v 
left outer join phone_numbers p 
on v.npa || v.calling_number = p.area_code || p.phone_prefix || p.phone_suffix 
left outer join mv_dps_buildings b 
on b.dps_building_number = p.dps_building_number 
where p.area_code is null 
and p.phone_prefix is null 
and p.phone_suffix is null; 
'@

PS>$queryString
select v.npa || v.calling_number phone_number, v.location, v.customer_name
from voip_validate v
left outer join phone_numbers p
on v.npa || v.calling_number = p.area_code || p.phone_prefix || p.phone_suffix
left outer join mv_dps_buildings b
on b.dps_building_number = p.dps_building_number
where p.area_code is null
and p.phone_prefix is null
and p.phone_suffix is null;