Dbaccess: Character to numeric coversion error
Posted in 1999
Topics: SQL Development & Query Writing, Server Administration, Migration, Import/Export & Data Conversion, Platform-Specific Issues
I have created an sql command file, which when run from within dbaccess,
executes successfully. However, when the same sql command file is run against
the same database from the command line, I receive the following error:
1213: Character to numeric conversion error
Error in line 50Near character position 32
My question is: Why would the same sql file run successfully from within the
dbaccess program, but not when passed to dbaccess via the command line?
Any help/solution would be appreciated. Thanks.
Some additional info that may help:
-----------------------------------
Using dbaccess on HP-UX B.10.20.
I believe the problem may be related to the line which reads:
( 144.3 / grade_spec.bsw_nominal ) AS conv_fact1
Here is the query:
unload to /usr/local/acc/data/acc_grade.txt
SELECT DISTINCT
grade_spec.grade_spec,
cust_part_xref.grade_spec_sale,
cust_part_xref.product_line,
cust_part_xref.article_id,
max(cust_part_xref.ts_create),
grade_spec.spec_name,
" " AS description2,
" " AS description3,
"LBS" AS uom1,
( 144.3 / grade_spec.bsw_nominal ) AS conv_fact1,
" " AS uom2,
" " AS conv_fact2,
" " AS uom3,
" " AS conv_fact3,
grade_spec.paper_fin_id,
grade_spec.colour_id,
grade_spec.bsw_nominal,
" " AS run_type,
cust_part_xref.clan_family,
" " AS trial_run,
cust_part_xref.type_code,
gs_typecode.type_code,
cust_part_xref.grade_spec_sale AS cost_item
FROM
msddba.grade_spec grade_spec,
msddba.cust_part_xref cust_part_xref,
msddba.gs_typecode gs_typecode
WHERE
grade_spec.grade_spec = cust_part_xref.grade_spec
AND gs_typecode.grade_spec = grade_spec.grade_spec
AND grade_spec.active_flag = 'Y'
AND cust_part_xref.active_flag = 'Y'
GROUP BY
grade_spec.grade_spec,
cust_part_xref.grade_spec_sale,
cust_part_xref.product_line,
cust_part_xref.article_id,
grade_spec.spec_name,
grade_spec.paper_fin_id,
grade_spec.colour_id,
grade_spec.bsw_nominal,
cust_part_xref.clan_family,
cust_part_xref.type_code,
gs_typecode.type_code
This is the command line syntax used:
% dbaccess <database> <sql command file>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
You should verifie the value of DBMONEY variable. that usually happens when the separating decimal are different between DBMONEY and the table. Bye.