我看了无数的帖子,但我仍然没有答案。
在此之前,我运行了一个脚本,告诉sql developer充当discoverer(一个已经创建的包),但是当运行查询时,它返回ORA-01722:无效数字。
我从包中选择了对偶,它返回值。
有人能告诉我为什么它会返回此错误消息的正确方向吗?
select gsb.name "Set of Books Name"
, gsb.set_of_books_id "Set of Books Id"
, gjb.name "Batch Name"
, gjh.name "Journal Name"
, trunc(gjh.date_created) "Journal Header Date Created"
, gjh.status "Journal Header Status"
, gcc.segment1 "Company"
, gcc.segment7 "Interco Code"
, APT.term_id "Term ID"
, APT.Name "Type of Term"
, APT.Description "Term Decription"
, ffvt3.description "Intercompany Descr"
, gcc.segment2 "Natural Account Code"
, ffvt.description "Natural Account Descr"
, gcc.segment3 "Cost Centre Code"
, ffvt2.description "Cost Centre Descr"
, gjl.je_line_num "Je Line Num"
, gjh.currency_code "Currency Code"
, gjl.description "Line Description"
, gjh.period_name "Period Name"
, gpd.period_num "Period Num"
, gpd.period_year "Period Year"
, gjc.user_je_category_name "Category Name"
, gjs.user_je_source_name "Source Name"
, gjl.status "Line Status"
, gjh.actual_flag "Actual Flag"
, nvl(gjl.accounted_dr,0) "Acctd Dr"
, nvl(gjl.accounted_cr,0) "Acctd Cr"
, trunc(gjh.posted_date) "GL Date"
, gjl.attribute3 "Recon Status"
, gjl.effective_date "Line GL Date"
, gjl.reference_1 "Reference1"
, gjl.reference_4 "Reference4"
, gjl.reference_2 "Invoice Id"
, pov.vendor_name "Vendor Name"
, pov.segment1 "Vendor Number"
, CASE
WHEN gjl.reference_6 = 'CUSTOMER'
THEN gjl.reference_4
ELSE gjl.reference_5
END "Invoice Num"
, gjh.doc_sequence_value "Doc Num"
, gjh.doc_sequence_value "Journal Voucher Num"
, api.invoice_date "Invoice Date"
, api.voucher_num "Image Num"
, api.discount_amount_taken "discount amount"
, api.attribute1 "PO Number"
, api.attribute2 "GRN Number"
, api.attribute3 "Invoice Approver"
, pvs.vendor_site_code "Vendor Site Code"
, gjl.code_combination_id "Code Combination Id"
, gcc.concatenated_segments "Full Account Code"
, api.amount_paid "Amount Paid"
, api.base_amount "Base Amount"
, api.creation_date "Creation Date"
, api.description "AP Inv Description"
, api.invoice_amount "Invoice Amount"
, api.invoice_type_lookup_code "Invoice Type"
, api.source "Invoice Source"
, gjh.posted_date "Posted Date"
, aca.check_date "Payment Date"
, aca.check_number "Payment Number"
, case when gjl.reference_6 = 'CUSTOMER' then gjl.reference_4
else null
end "Trans Number"
, case when gjl.reference_6 = 'CUSTOMER' then
(select distinct customer_name
from ar_customers_v
where customer_number = gjl.reference_5)
else null
end "Customer Name"
from gl_je_batches gjb
, gl_je_headers gjh
, gl_je_lines gjl
, gl_periods gpd
, gl_code_combinations_kfv gcc
, gl_sets_of_books gsb
, gl_je_categories_tl gjc
, gl_je_sources_tl gjs
, fnd_flex_value_sets ffvs
, fnd_flex_values ffv
, fnd_flex_values_tl ffvt
, fnd_flex_value_sets ffvs2
, fnd_flex_values ffv2
, fnd_flex_values_tl ffvt2
, fnd_flex_value_sets ffvs3
, fnd_flex_values ffv3
, fnd_flex_values_tl ffvt3
, ap_invoices_all api
, po_vendors pov
, po_vendor_sites_all pvs
, ap_invoice_payments_all aip
, ap_checks_all aca
, AP_TERMS_VL apt
where gjb.je_batch_id = gjh.je_batch_id
and gjh.je_header_id = gjl.je_header_id
and gjl.code_combination_id = gcc.code_combination_id
and gjc.je_category_name = gjh.je_category
and gjc.language = 'US'
and gjs.je_source_name = gjh.je_source
and gjs.language = 'US'
and ffvs.flex_value_set_id = ffv.flex_value_set_id
and ffvs.flex_value_set_name = XXASW_DISCO_UTIL_PKG.xxasw_get_gl_segment_fvs_name ('SEGMENT2')
and ffv.flex_value = gcc.segment2
and ffv.flex_value_id = ffvt.flex_value_id
and ffvt.language = 'US'
and ffvs2.flex_value_set_id = ffv2.flex_value_set_id
and ffvs2.flex_value_set_name = XXASW_DISCO_UTIL_PKG.xxasw_get_gl_segment_fvs_name ('SEGMENT3')
and ffv2.flex_value = gcc.segment3
and ffv2.flex_value_id = ffvt2.flex_value_id
and ffvt2.language = 'US'
and ffvs3.flex_value_set_id = ffv3.flex_value_set_id
and ffvs3.flex_value_set_name = XXASW_DISCO_UTIL_PKG.xxasw_get_gl_segment_fvs_name ('SEGMENT7')
and ffv3.flex_value = gcc.segment7
and ffv3.flex_value_id = ffvt3.flex_value_id
and ffvt3.language = 'US'
and gpd.period_name = gjh.period_name
and gpd.period_set_name = gsb.period_set_name
and gjh.set_of_books_id = gsb.set_of_books_id
and ((gjl.reference_9 <> 'TRADE_REC')
or (gjl.reference_9 is null))
and (case when gjl.reference_6 = 'AP Invoices'
then to_number(gjl.reference_2) else 0 end ) = api.invoice_id(+)
and gjl.reference_5 = api.invoice_num (+)
and pvs.vendor_id = pov.vendor_id (+)
and api.vendor_site_id = pvs.vendor_site_id (+)
and api.invoice_id = aip.invoice_id (+)
and aip.check_id = aca.check_id (+)
and api.terms_id = apt.term_id (+)
and ((aca.status_lookup_code = 'NEGOTIABLE')
or (aca.status_lookup_code is null))
and aip.reversal_inv_pmt_id(+) is null
and gcc.segment3 = 5221
and gjh.period_name = 'JAN-16'
and gcc.segment2 between 592712 and 592712
and gcc.segment3 between 0000 and 9999;
ORA-01722:无效号码
当您尝试将字符串转换为数字时发生,但由于某种原因无法转换该字符串。
看起来您查询中的罪魁祸首如下:
and (case when gjl.reference_6 = 'AP Invoices'
then to_number(gjl.reference_2) else 0 end ) = api.invoice_id(+)
这意味着gl_je_lines.reference_2
中存在数据问题,该列中存在您意想不到的字符串值。
我将通过检查列<code>中的数据来解决这个问题,从gl_je_line</code>中选择reference_。
我在包裹抛出错误中有一个查询 ORA-01722:无效号码。 我试了很多方法,但都没有成功。 null 请给我建议解决办法
我正在尝试执行查询,但它不断给出错误 ORA-01722:无效号码01722.00000-"无效号码" 我检查了是否有像01722这样的数字。00000或类似在我的表中,但没有。我还检查了查询,如果我在非数值中使用算术运算符,如果我正在比较一个数字和非数字值,但仍然什么都没有。我所有的表列都是类型,现在已经一整天了,我还没有找到如何解决它。查询如下:
这是我的桌子。 我运行此插入语句 我得到这个错误信息: 从命令中的第1行开始出错-插入计划(SCHEDULE_IDARRV_TIMEDEP_TIMEBUS_TRANSFERSBUS_IDTRAVEL_DIRECTIONWEEK_DAY)值(SEQ_SCHEDULE.NEXTVAL,'10','11','White Oak','2','North','4') 错误报告-SQL错误:ORA-01722
一个非常容易的人,下面的插入是给我
执行SQLDRI后日志的错误正在尝试在字段中插入数值,但我一直收到相同的错误 无效数字ORA-01722。我不知道错误在哪里,因为我插入了声明为NUMBER(18,6)的十进制数作为字段IMP_NPVFRONT并且值被强制转换为此长度,但它不起作用。我正在使用这个代码: 上面生成了一个包含以下内容的控制文件: 提前谢谢你,对不起我的英语:) 创建表: 数据文件:
我有一个问题是随机产生的(千次调用之间的一次)。错误ORA-01722:在准备好的语句Oracle数据库中执行sql更新时,以随机方式生成了无效的数字。个案详情如下: log中的值如下所示: 通过在DB处跟踪查询参数,所有参数都通过JDBC驱动程序正确传输,但参数23410984除外,它被值替换(注意,该值在char'u'之前包含回车)。我不知道为什么