Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Missing expression error - when empty number field 1

Status
Not open for further replies.

olmos

Technical User
Oct 25, 2000
135
US
I am using insert query to insert into certain columns of my table from a form. If the fields in the form are number fields and are left blank I get a missing expression error. Some fields are not required in the form but in order to not get an error I have to fill all of the number fields in the form. It works when some of the text fields are left blank. Anyone know what I am doing wrong and how do I fix this problem.


Thanks,
olmos
 
What should determine whether or not you get an error for a particular
textbox on the form is whether or not nulls are allowed in the corresponding
columns in the table. Assuming you don't want to change the table
definition, you can use the 'default value' of the textbox's property sheet
to automatically fill in some value, rather than having to fill it in manually.
The default value will fill in the textbox every time a new record is created;
it can be overriden by the user. Jim

oracle, vb
 
Thanks for your response. How can I allow nulls in number fields? When I
checked the description only the primary key has "NOT NULL" all the other
fields had a blank in it. I am using coldfusion and tried to enter a NULL with an IF statement if that field is blank ..... VALUES <CFIF #Form.VISITOR_EXT# IS NOT &quot;&quot;>#Form.VISITOR_PER_NO# <CFELSE>NULL</CFIF>)

The error I got was ORA-01401: inserted value too large for column. Any suggestions , I really don't want to enter a 0 everytime it is blank. Is there any other way. like entering nulls instead .

VISITOR_PER_NO NUMBER(10)

thanks in advance,
olmos
 
I was thinking 'Oracle forms' when I read your initial post.
What sort of connection mechanism is used between your
form and the database? Jim

oracle, vb
 
I found my error. My if statement was trying to input the nulls into the number field.
except I had another error in a different field that was entering more than the field size allowed, once I fixed that , it worked. Nulls were entered okay.

Thanks for your help anyways.
olmos
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top