Oracle “ORA-01008: not all variables bound” Error w/ Parameters

前端 未结 3 1490
渐次进展
渐次进展 2020-12-14 16:01

This is the first time I\'ve dealt with Oracle, and I\'m having a hard time understanding why I\'m receiving this error.

I\'m using Oracle\'s ODT.NET w/ C# with the

3条回答
  •  醉梦人生
    2020-12-14 16:17

    You might also consider removing the need for duplicated parameter names in your Sql by changing your Sql to

    table.Variable2 LIKE '%' || :VarB || '%'
    

    and then getting your client to provide '%' for any value of VarB instead of null. In some ways I think this is more natural.

    You could also change the Sql to

    table.Variable2 LIKE '%' || IfNull(:VarB, '%') || '%'
    

提交回复
热议问题