hi all,
How do I insert a name into a ORACLE table with an autonumber field. My error is cannot insert null into ( " "
, error code 1400 . fn_id is the autonumber field and also the sequence name.
I tried using the sequence name in the query like this
VALUES ( fn_id.nextval, '#Form.NAME#' ) , and putting NotNull also in there, and that didn't work either . Can anyone help me with this, it is probably very simple but I haven't figured it out. The code is below.
Thanks,
olmos
--------------------------------------------
Data entry form code for name to be inserted ---
----------------------------------------------
<form name="data_entryform1.cfm" action="action2.cfm" method="POST">
<INPUT TYPE=hidden NAME="fn_id" VALUE= "fn_id>
<input type=text size=50 maxlength=70 name="name" value = "name " >
<input type=SUBMIT>
---------------------------------------
2nd file code for action-
action2.cfm
-----------------------------------
<CFQUERY NAME="AddFN" DATASOURCE="db" dbtype="Oracle80">
INSERT INTO scott.tablename
(NAME)
VALUES ('#Form.NAME#' )
</CFQUERY>
<cfoutput query = "AddFN">
<html>
<body>
The following has been submitted.
#Form.NAME#
</body>
</html>
</cfoutput>
How do I insert a name into a ORACLE table with an autonumber field. My error is cannot insert null into ( " "
I tried using the sequence name in the query like this
VALUES ( fn_id.nextval, '#Form.NAME#' ) , and putting NotNull also in there, and that didn't work either . Can anyone help me with this, it is probably very simple but I haven't figured it out. The code is below.
Thanks,
olmos
--------------------------------------------
Data entry form code for name to be inserted ---
----------------------------------------------
<form name="data_entryform1.cfm" action="action2.cfm" method="POST">
<INPUT TYPE=hidden NAME="fn_id" VALUE= "fn_id>
<input type=text size=50 maxlength=70 name="name" value = "name " >
<input type=SUBMIT>
---------------------------------------
2nd file code for action-
action2.cfm
-----------------------------------
<CFQUERY NAME="AddFN" DATASOURCE="db" dbtype="Oracle80">
INSERT INTO scott.tablename
(NAME)
VALUES ('#Form.NAME#' )
</CFQUERY>
<cfoutput query = "AddFN">
<html>
<body>
The following has been submitted.
#Form.NAME#
</body>
</html>
</cfoutput>