Click to See Complete Forum and Search --> : ORA-01858 a non-numeric character was found where a numeric was expected


cam_pdx
01-28-2003, 04:36 PM
This is a CF / SQL question. Please let me know if CF is taboo here.

I have 11 sequences (one per category) represented in a form drop-down menu.

I'm having a difficult time getting the selected sequence to work in the insert statement. The values that I've stored in the form are in this format:

gpn_dft_seq.nextval
gpn_ds_seq.nextval

etc, etc till all 11 categories (and thus all 11 sequences) are represented.

Please see below:

<!--- stripping off the "gpn_" and the "_seq.nextval" to have something to insert into the "category" field --->

<cfset striped_category = rereplace("#form.category#", "gpn_", "")>
<cfset striped_category = rereplace("#striped_category#", "_seq.nextval", "")>

<cfoutput>
<cfquery name="add_graphicpartnumbers" datasource="mwdev">
insert into graphicpartnumbers
(
category_seq_no,
category,
currdate,
fullname,
description
)
values
(
to_number(#category#),
'#striped_category#',
'to_date(#currdate#)',
'#fullname#',
'#description#'
)
</cfquery>
</cfoutput>


I keep getting a variety of errors depending on what modifications I try {with this line: to_number(#category#)}, including the one listed in the subject line.

Any suggestions will be much appreciated.

Thanks.
Cam

stecal
01-28-2003, 04:45 PM
What is "#category#" and why do you enclose it with #'s?