私の実装で使用される問合せでORA-01722エラーが発生しました。以下はクエリです。ORA-01722次の問合せの実行時にエラーが発生しました
select ao.account_oid,ao.website_oid,ob.oid,ob.status_code,pi.oid,pi.render_status,ao.invoiced_date
from acct_order ao,order_basket ob, order_line_item oli,order_line_item_xml olix,project_info pi
where ao.oid = ob.account_order_oid and
ob.oid = oli.order_basket_oid and
oli.oid = olix.order_line_item_oid and
pi.oid = olix.xml_value and
olix.xml_key_code='PROJECT_INFO_OID' and
pi.oid = 10000450011; // this is not working
注: "olix.xml_value"には文字列値も含まれます。
"="演算子を "in"演算子に置き換えて変更し、試しても失敗しました。 しかし、 "in"演算子の値のうちの何もが1より大きい場合は、その演算を行います。
select ao.account_oid,ao.website_oid,ob.oid,ob.status_code,pi.oid,pi.render_status,ao.invoiced_date
from acct_order ao,order_basket ob, order_line_item oli,order_line_item_xml olix,project_info pi
where ao.oid = ob.account_order_oid and
ob.oid = oli.order_basket_oid and
oli.oid = olix.order_line_item_oid and
pi.oid = olix.xml_value and
olix.xml_key_code='PROJECT_INFO_OID' and
pi.oid in (10000450011,10000460011); // This is working. One argument to "in" operator is not working.
私はSQLDeveloperについて説明しましたが、理解できませんでした。ある人が問題を理解するのに役立つことがありますか?
pi.oidは数字です。私はto_char(pi.oid)= olix.xml_valueのようにto.charでpi.oidを囲んで解決しました。そのようなto_char()変換なしで "in"演算子を使用すると、私はなぜそれが働いているのか、私の質問??? –
pi.oid in(num1、num2)は明らかにp.oidとして機能します。数字です。パラメータが1つだけの場合は等価だけがwhere句を満たし、2つのパラメータがある場合は、その中の任意の数がwhere句を満たします。 –