Syntax error in insert into
Hi,
I'm new to coldfusion and was doing a practice survey. I'm
getting the following error:
The INSERT INTO statement contains the following unknown
field name: 'recipes'. Make sure you have typed
the name correctly, and try the operation again.
The error occurred in (coldfusion form): line 405
403 :
(lname,fname,yourID,status,preprog_survey,recipes,activity,tips,stress,other,othertext,we ight_result,lbs_gained,lbs_lost,behaviors,desc_behaviors,most_help,improve_prog)
404 : values
405 :
('#lname#','#fname#','#yourID#','#status#','#preprog_survey#','#recipes#','#activity#','# tips#','#stress#','#other#','#othertext#','#weight_result#','#lbs_gained#','#lbs_lost#','# behaviors#','#desc_behaviors#','#most_help#','#improve_prog#')
406 : </cfquery>
407 :
SQL Insert into maintaint
(lname,fname,yourID,status,preprog_survey,recipes,activity,tips,stress,other,othertext,we ight_result,lbs_gained,lbs_lost,behaviors,desc_behaviors,most_help,improve_prog)
values ('last name','first
name','444444','member,'No','0','0','1','0','1','no work, all
play','gained',' too many','','Yes','Dreaming of eating better, but
not doing it','This survey!','no improvement suggestions'
VENDORERRORCODE -3502
SQLSTATE 42000
Can anyone tell me what this possibly means? I'm sure its
probably hard to understand without seeing the form. These are the
types of fields each are:
lname, fname, yourID = text
status = radio
preprog_survey = radio
recipes, activity,tips, stress, other, = checkboxes
othertext, = text
weight_result, = radio
lbs_gained,lbs_lost, = text
behaviors, = radio
desc_behaviors, most_help, improve_prog = text
Looking at the code you supplied I noticed that for the
checkboxes values where '0' and '1'.
SQL Insert into maintaint
(lname,fname,yourID,status,preprog_survey,recipes,activity,tips,stress,other,othertext,we ight_result,lbs_gained,lbs_lost,behaviors,desc_behaviors,most_help,improve_prog)
values ('last name','first
name','444444','member,'No','0','0','1','0','1','no work, all
play','gained',' too many','','Yes','Dreaming of eating better, but
not doing it','This survey!','no improvement suggestions'
You don't need quotes around numeric values, only text.
Hope that helps you.
Similar Messages
-
Error while inserting into ms access using jsp
i am using the following code to insert values from textboxes into access database
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection(url);
Statement stmt=con.createStatement();
//ResultSet rs = null;
//String sql = ("INSERT INTO co-ords VALUES ('" + nam + "','" + lat + "','" + lon + "','"+ latm +"','"+ lonm +"','"+ latmd +"','"+ lonmd +"','"+ latms +"','"+ lonms +"') ");
String sql = "INSERT INTO co-ords (nam ,lat , lon , latm ,lonm , latmd , lonmd ,latms , lonms) VALUES ('" + nam + "','" + lat + "','" + lon + "','"+ latm +"','"+ lonm +"','"+ latmd +"','"+ lonmd +"','"+ latms +"','"+ lonms +"') ";
out.println(sql);
stmt.executeUpdate(sql);
the output i get is
INSERT INTO co-ords (nam ,lat , lon , latm ,lonm , latmd , lonmd ,latms , lonms) VALUES ('cck','28.656529681148545','77.23440170288086','28','77','39','14','23.508','3.8472') Exception:java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
can somebody help me?Simple,
Some error in your query right. Unable to understand Quotation stuff.
Well understand it properly else error will follow forever :)
Without String, Straight Away Values
stmt1.executeUpdate("insert into Login_Details values('Example','Exmaple')");This is the query with Login_Id Pass_Word String containing the value
stmt1.executeUpdate("insert into Login_Details values('"+Login_Id+"','"+Pass_Word+"')");Then storing sql as string and pass it in executeUpdate(sql)
String sql="insert into Login_Details values ('example','example') "String + Values in String
String sql="insert into Login_Details values ('"+example+"','"+example+"') "Just first it . Hope this reply solve ur SQL EXCEPTIONG
Sachin Kokcha -
I have a flash form that is used to inserts a record into an
Access database table. In the for there are 4 datefields, several
text input fields, and several select fields. When I submit the
form, I get a syntax error that reads:
Executing Database Query. [Macromedia][SequeLink JDBC
Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver]
Syntax error in INSERT INTO statement.
The error occurred on line 184. Complex object types cannot
be converted to simple values.
Line 184 is the last line of the Values in the insert query.
The query looks like this:
<CFQUERY DATASOURCE="#REQUEST.DataSource#">
INSERT INTO EstimateNumber(
BidNumber,
Project,
JobSite,
EstimatedBy,
Region,
Company,
Division,
InquiryNumber,
SafetyChecklist,
SafetyChecklistDate,
QCChecklist,
QCChecklistDate,
EstimatedValue,
UserUsername,
UserPassword,
Updated,
ReviewDate,
ReviewedBy,
Discipline,
BidDate,
JobNumber,
UpdatedBy
VALUES(
#FORM.BidNumber#,
'#FORM.Project#',
'#FORM.JobSite#',
'#FORM.EstimatedBy#',
#FORM.Region#,
#FORM.Company#,
#FORM.Division#,
'#FORM.InquiryNumber#',
#FORM.SafetyChecklist#,
#FORM.SafetyChecklistDate#,
#FORM.QCChecklist#,
'#FORM.QCChecklistDate#',
#FORM.EstimatedValue#,
'#FORM.UserUsername#',
'#FORM.UserPassword#',
#FORM.Updated#,
#FORM.ReviewDate#,
#FORM.ReviewedBy#,
#FORM.Discipline#,
#FORM.BidDate#,
#FORM.JobNumber#,
'#FORM.UpdatedBy#'
</CFQUERY>
Any recomendations?Date/Time in Access provide some pretty strage hurdles. In
many occassions I have simply changed the field to a Text field and
ran with that and never seemed to have problems with the result. I
didn't like doing it but I never received errors. I have been
receiving some parameter errors with <cfqueryparam> like the
database doesn't recognized the preceding declared field in the
update or insert query. Here is an example of a wierd error with
Access. I have 2 tables. One is for estimate numbers and the other
is for sub estimate numbers that can be assigned to specific
estimate numbers. If is actually a complicated explanation about
what is taking place behind the doors on this. The concept is
simple on the surface. Both tables have the same fields except the
subestimate table has 1 extra for a user defined subestimate
number. The only relation between the two will be the estimate
number. This insert works fine.
INSERT INTO EstimateNumber(
BidNumber,
Project,
JobSite,
EstimatedBy,
Region,
Company,
Division,
InquiryNumber,
SafetyChecklist,
SafetyChecklistDate,
QCChecklist,
QCChecklistDate,
EstimatedValue,
UserUsername,
UserPassword,
ReviewDate,
Discipline,
BidDate,
JobNumber,
UpdatedBy
VALUES(
#FORM.BidNumber#,
'#FORM.Project#',
'#FORM.JobSite#',
'#FORM.EstimatedBy#',
#FORM.Region#,
#FORM.Company#,
#FORM.Division#,
'#FORM.InquiryNumber#',
#FORM.SafetyChecklist#,
<cfqueryparam
value="#FORM.SafetyChecklistDate#"
cfsqltype="CF_SQL_DATE "
maxlength="50"
>,
#FORM.QCChecklist#,
<cfqueryparam
value="#FORM.QCChecklistDate#"
cfsqltype="CF_SQL_DATE "
maxlength="50"
>,
#FORM.EstimatedValue#,
'#FORM.UserUsername#',
'#FORM.UserPassword#',
<cfqueryparam
value="#FORM.ReviewDate#"
cfsqltype="CF_SQL_DATE "
maxlength="50"
>,
#FORM.Discipline#,
<cfqueryparam
value="#FORM.BidDate#"
cfsqltype="CF_SQL_DATE "
maxlength="50"
>,
#FORM.JobNumber#,
'#FORM.UpdatedBy#'
This next one is the same exact query with the same table
setup with one added field but kicks back a parmeter error
expecting 4. I can't explain it.
INSERT INTO SubEstimate(SubBidNumber,
BidNumber,
Project,
JobSite,
EstimatedBy,
Region,
Company,
Division,
InquiryNumber,
SafetyChecklist,
SafetyChecklistDate,
QCChecklist,
QCChecklistDate,
EstimatedValue,
UserUsername,
UserPassword,
ReviewDate,
Discipline,
BidDate,
JobNumber,
UpdatedBy
VALUES(#FORM.SubBidNumber#,
#FORM.BidNumber#,
'#FORM.Project#',
'#FORM.JobSite#',
'#FORM.EstimatedBy#',
#FORM.Region#,
#FORM.Company#,
#FORM.Division#,
'#FORM.InquiryNumber#',
#FORM.SafetyChecklist#,
<cfqueryparam
value="#FORM.SafetyChecklistDate#"
cfsqltype="CF_SQL_DATE "
maxlength="50"
>,
#FORM.QCChecklist#,
<cfqueryparam
value="#FORM.QCChecklistDate#"
cfsqltype="CF_SQL_DATE "
maxlength="50"
>,
#FORM.EstimatedValue#,
'#FORM.UserUsername#',
'#FORM.UserPassword#',
<cfqueryparam
value="#FORM.ReviewDate#"
cfsqltype="CF_SQL_DATE "
maxlength="50"
>,
#FORM.Discipline#,
<cfqueryparam
value="#FORM.BidDate#"
cfsqltype="CF_SQL_DATE "
maxlength="50"
>,
#FORM.JobNumber#,
'#FORM.UpdatedBy#'
IF I get rid of the cfqueryparam fields it works. If I simply
remove the param, I get a Syntax error. Needless to say I commented
this query for the sake of sanity for the time being. -
Syntax eror in INSERT INTO satement
I get this when i try to insert information in the database:
[Macromedia][SequeLink JDBC Driver][ODBC
Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in
INSERT INTO statement.
thanks for the help in advancedEpid3mik
> I get this when i try to insert information in the
database:
I suspect some of your column names are reserved keywords,
such as FROM, TIME, etcetera.
http://support.microsoft.com/kb/286335
Whenever possible, avoid using keywords as object names. The
better solution here is to permanently rename the columns that are
keywords. Assuming the rest of your query syntax is correct, that
should fix the syntax error. If for some reason you cannot rename
the columns, you must escape them by using square brackets around
the column names:
INSERT INTO Message ( mem_id, [From], [Time], .... )
As an aside, you should properly scope your variables.
Example use #FORM.mem_id# instead of just #mem_id#. Your should
also consider using cfqueryparam for all query values. These last
two things are not the cause of your error, but they are good
coding practices. -
Syntax error in INSERT STATEMENT
A problem on the date part of the query but why I don´t
know, Thanks for any pointers,
TIA
<cfquery name="update1" datasource="trevor_SecurityDB">
INSERT INTO imagesproducts
(title, info, date)
VALUES ( '#form.title#', '#form.info#', '#DateFormat(Now())#'
</cfquery>
Error Occurred While Processing Request
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC
Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in
INSERT INTO statement.
The error occurred in uploadmember.cfm: line 28
26 : INSERT INTO imagesproducts
27 : (title, info, date)
28 : VALUES ( '#form.title#', '#form.info#',
'#DateFormat(Now())#' )
29 : </cfquery>
30 :
SQL INSERT INTO imagesproducts (title, info, date) VALUES (
'News test', 'Testing news info', '12-Jul-07' )
DATASOURCE trevor_SecurityDB
VENDORERRORCODE -3502
SQLSTATE 42000Perhaps it is a reserved word issue with the date column,
since
date is an ODBC Reserved Keyword. You might try enclosing it
within brackets [ ].
<cfquery name="update1" datasource="trevor_SecurityDB">
INSERT INTO imagesproducts
(title, info, [date])
VALUES ( '#form.title#', '#form.info#', '#DateFormat(Now())#'
</cfquery>
Or, if that doesn't help, you might try using a cfqueryparam
tag for the '#DateFormat(Now())#' value using a cfsqltype =
"CF_SQL_TIMESTAMP" (assuming a date/time datatype on the column).
Also, you might look into using one of the CreateODBCDateTime() or
CreateODBCDate() functions.
Phil -
Please help --Error in insert into Statement
Error in insert into statement while connecting to ms-access.
import java.sql.*;
public class stupid8
public stupid8()
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};"+"DBQ=d:/Servlet/registration.mdb");
PreparedStatement s=con.prepareStatement("insert into Deposit (username,date,amount) values(?,?,?)");
s.setString(1,"username");
s.setString(2,"date");
s.setString(3,"amount");
s.executeUpdate();
System.out.println("Success");
catch(Exception e)
System.out.println("Error: "+e);
public static void main(String args[])
new stupid8();
}My first guess is that the database is objecting to the use of "date" as a column name; "date" is often a reserved word in databases.
It would be less of a guess if you posted the actual error message. -
1 duplicate key error during insert into table
Dear Guru's
While upgrading the SAP_HR patch, I am facing this issue
Current level is SAPKE60455
Trying to apply patch - SAPKE60456
This is seen in the import log
Start import R3TRVDATV_512W_O ...
client 000: 1
client 001: 1
client 070: 1
client 080: 1
client 100: 1
client 320: 1
1 duplicate key error during insert into table T512T occured
End import R3TRVDATV_512W_O (with warnings)
Please help, thank in advance
R3trans is at version 6.19
Regards,
OmkarHello,
Issue was resolved after upgrading the R3trans
Regards,
Omkar -
Error while inserting into MS-SQL Server from Oracle using HS
Hi,
I am using hetrogeneous connection.
I want to insert into MS-SQL Server Table by selecting from Oracle Tables.
insert into tableone@mssql select * from table2;
Table2 is in oracle database.
while executing i'm getting
ORA-02025: all tables in the SQL statement must be at the remote database
Please guide me.
Regards
Salih KMsome guy come up a solution by himself before. go ahead and try it
ORA-02025 error while insert into emp@custard select .... -
ORA-01403: no data found error hile inserting into a table
Hi,
I am populating a PL/SQL table(Array) with the data. From that array inserting into a Actual table. Before inserting am checking array count. Array count is greater than 0. But I am getting "ORA-01403: no data found" exception. I am not getting why this error is displaying.
Please someone help me. Below is the code.
CREATE OR REPLACE PROCEDURE XXDL_TEST_INSERT
IS
BEGIN
IF t_array.count> 0 THEN
FND_FILE.PUT_LINE (FND_FILE.LOG, t_array.count);
FOR i IN t_array.FIRST..t_array.LAST
LOOP
INSERT INTO XXDL_TEST
VALUES(t_array(i).name )
END LOOP;
END IF;
EXCEPTION
WHEN OTHERS THEN
FND_FILE.PUT_LINE (FND_FILE.LOG,SQLERRM);
END;Thanks
AlakaIt looks like your Array is sparsely populated:
SQL> DECLARE
2 TYPE l_tab_type IS TABLE OF VARCHAR2(10)
3 INDEX BY BINARY_INTEGER;
4 l_tab l_tab_type;
5 BEGIN
6 l_tab(1) := 'A';
7 l_tab(2) := 'B';
8 l_tab(3) := 'C';
9 FOR i IN l_tab.FIRST .. l_tab.LAST LOOP
10 dbms_output.put_line(l_tab(i));
11 END LOOP;
12 END;
13 /
A
B
C
PL/SQL procedure successfully completed.
SQL>
SQL> DECLARE
2 TYPE l_tab_type IS TABLE OF VARCHAR2(10)
3 INDEX BY BINARY_INTEGER;
4 l_tab l_tab_type;
5 BEGIN
6 l_tab(1) := 'A';
7 l_tab(3) := 'B';
8 l_tab(4) := 'C';
9 FOR i IN l_tab.FIRST .. l_tab.LAST LOOP
10 dbms_output.put_line(l_tab(i));
11 END LOOP;
12 END;
13 /
A
DECLARE
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at line 10Edited by: JS1 on Apr 11, 2009 8:59 AM
You should also be using the FORALL syntax with INDICES OF. Check out The Docs -
Error while inserting into blob column through PL/SQL
Hi All,
I am trying to insert into column having blob as datatype.
INSERT INTO imagedb(image_name, content,description) VALUES ('logo.png',
?{file 'c:\logo.png'}, 'logo');
it gives me error Unknown JDBC escape sequence:
Is there anything wrong in above insert syntax for inserting into BLOB data type.
Can any body please help me.
Regards,
HirenIt is not valid SQL as far as Oracle SQL is concerned. I assume that the file construct is suppose to replace that with the contents of the file?
What happens when the file size exceeds the max length of the SQL command?
And do you have any idea what will happen to the SQL Shared Pool on Oracle that needs to store the entire SQL command for every single SQL command passed to it? The whole purpose of the Shared Pool is for storing shared SQL. Not non-sharable SQL containing hardcoded values.
Bind variable are to be used.. if you expect Oracle to perform like only Oracle can.
And my bet is that you have not even bothered to read [url http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14249/toc.htm]Oracle® Database Application Developer's Guide - Large Objects guide.... -
Inconsistent datatypes error when inserting into a object
I am trying to insert some test data into the table emp.I have managed to succesfully create the objects and types but when I try to insert into the emp table I get a inconsistent datatypes error however I have checked the datatypes and they all seem fine. Can anyone help me.
thanks
CREATE OR REPLACE TYPE Address_T AS object
(ADDR1 VC2_40,
ADDR2 VC2_40,
CITY_TX VC2_40,
COUNTY_CD VC2_40,
POST_CD VC2_40);
CREATE OR REPLACE TYPE PERSON_T AS OBJECT (
LNAME_TX NAME_T,
FNAME_TX NAME_T,
BIRTH_DATE DATE,
TELEPHONE VC2_20,
EMAIL VC2_40);
CREATE OR REPLACE TYPE EMP_T AS OBJECT (
EMP_ID NUMBER (10),
PERSON PERSON_T,
ADDRESS ADDRESS_T,
HIRE_DATE DATE)
CREATE TABLE EMP OF EMP_T
(EMP_ID NOT NULL PRIMARY KEY);
INSERT INTO EMP VALUES (1,
PERSON_T('PETCH',
'GAVIN',
'23-JAN-80',
'(01964)550700',
'[email protected]'),
ADDRESS_T('67 CANADA',
'WALKINGTON',
'BEVERLEY',
'EAST YORKSHIRE',
'HU17 7RL'),
'11-FEB-02'
ERROR at line 1:
ORA-00932: inconsistent datatypesGavin,
What is your VC2_40 and NAME_T type definition? Your insert used these as varchar2, which is a built-in type not a user-defined type. If you explicitly define these to be varchar2's, the insert statement works fine.
Regards,
Geoff
I am trying to insert some test data into the table emp.I have managed to succesfully create the objects and types but when I try to insert into the emp table I get a inconsistent datatypes error however I have checked the datatypes and they all seem fine. Can anyone help me.
thanks
CREATE OR REPLACE TYPE Address_T AS object
(ADDR1 VC2_40,
ADDR2 VC2_40,
CITY_TX VC2_40,
COUNTY_CD VC2_40,
POST_CD VC2_40);
CREATE OR REPLACE TYPE PERSON_T AS OBJECT (
LNAME_TX NAME_T,
FNAME_TX NAME_T,
BIRTH_DATE DATE,
TELEPHONE VC2_20,
EMAIL VC2_40);
CREATE OR REPLACE TYPE EMP_T AS OBJECT (
EMP_ID NUMBER (10),
PERSON PERSON_T,
ADDRESS ADDRESS_T,
HIRE_DATE DATE)
CREATE TABLE EMP OF EMP_T
(EMP_ID NOT NULL PRIMARY KEY);
INSERT INTO EMP VALUES (1,
PERSON_T('PETCH',
'GAVIN',
'23-JAN-80',
'(01964)550700',
'[email protected]'),
ADDRESS_T('67 CANADA',
'WALKINGTON',
'BEVERLEY',
'EAST YORKSHIRE',
'HU17 7RL'),
'11-FEB-02'
ERROR at line 1:
ORA-00932: inconsistent datatypes -
Error when inserting into dynamically created filename-file
Howry
Am am receiving the following error when i am trying to insert into a file that have a dynamic filename (through declared variable, as date etc.).
I presume it is trying to look for the target file with the same name as the dynamic value passed through by the variable, but cannot find it- can anyone tell me how i can rather create the file as appose to insert into an already created file..?
Your help in this regard is much appreciated.
Here is the error:
ODI-1217: Session SAPO_hlr_suburbs (1577001) fails with return code 7000.
ODI-1226: Step 6_Ins_final fails after 1 attempt(s).
ODI-1240: Flow 6_Ins_final fails while performing a Integration operation. This flow loads target table #l_date.unl.
ODI-1228: Task 6_Ins_final (Integration) fails on the target FILE connection SAPO_HLR_SUBURBS.
Caused By: java.sql.SQLException: File C:\Files\Gero work\ODI In Files\SAPO_HLR_SUBURBS/2012-01-24 12:06:13.463.unl was not found
at com.sunopsis.jdbc.driver.file.FileConnection.prepareForWriting(FileConnection.java:339)
at com.sunopsis.jdbc.driver.file.impl.commands.CommandInsert.execute(CommandInsert.java:50)
at com.sunopsis.jdbc.driver.file.CommandExecutor.executeCommand(CommandExecutor.java:33)
at com.sunopsis.jdbc.driver.file.FilePreparedStatement.executeUpdate(FilePreparedStatement.java:138)
at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java:665)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeUpdate(SnpSessTaskSql.java:3218)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java:1785)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java:2805)
at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java:68)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2515)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:534)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:449)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1954)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:322)
at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:224)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:246)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:237)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:794)
at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:114)
at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
at java.lang.Thread.run(Thread.java:619)What operating system are you using?
The name of your file has the time within it , you cant have a filename with ':' in it on Windows.
Try using ALPHANUMERIC datatype for the variable and pull the current datetime as a char with something like :
select to_char( sysdate ,'YYYY-MM_DD HHMISS') from dual -
Error when inserting into table - Undefined Variable
DB = Oracle 10.2.0.1
WEBSERV = Apache 2.0.55
LANG = PHP5
I have created (or more accurately, copied) a php script to insert data into one of my database tables when I press submit. The code is as follows (my connect string works fine and its included in the dbutils.php file):
<?php
if($submit == "submit"){
include "dbutils.php";
$query = "insert into users values (seq_user_usr_id.NEXTVAL, '$usr_name')";
$cursor = OCIParse ($db_conn, $query);
if ($cursor == false){
echo OCIError($cursor)."<BR>";
exit;
$result = OCIExecute ($cursor);
if ($result == false){
echo OCIError($cursor)."<BR>";
exit;
OCICommit ($db_conn);
OCILogoff ($db_conn);
else{
echo '
<html><body>
<form method="post" action="index.php">
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Please enter a username:</td>
<td><input type="text" name="usr_name"></input><br></td>
</tr>
<tr>
<td><input type="submit" name="button" value="Submit"></input></td>
</tr>
</table>
</form>
</body></html>
?></p>I am getting the following error regarding an undefined variable:
[Fri Jan 20 13:11:22 2006] [error] [client 127.0.0.1] PHP Notice: Undefined variable: submit in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\mywebsite\\test.php on line 3
Where would I declare this variable? It is just a check to see if the submit button is pressed as far as I can see. Any help would be greatfully appreciated.
W8I have changed the code to this:
<?php
if($submit == "submit"){
include "dbutils.php";
$usr_name = $_POST['usr_name'];
$query = "insert into users (column1, column2) values (seq_user_usr_id.NEXTVAL, '$usr_name')";
$cursor = OCIParse ($db_conn, $query);
if ($cursor == false){
echo OCIError($cursor)."
exit;
$result = OCIExecute ($cursor);
if ($result == false){
echo OCIError($cursor)."
exit;
OCICommit ($db_conn);
OCILogoff ($db_conn);
else{
$submit = $_POST['submit'];
echo '
<html><body>
<form method="post" action="index.php">
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Please enter a username:</td>
<td><input type="text" name="usr_name"></input>
</td>
</tr>
<tr>
<td><input type="submit" name="submit" value="submit"></input></td>
</tr>
</table>
</form>
</body></html>
?>And now I am getting the following error:
[Mon Jan 23 13:45:32 2006] [error] [client 127.0.0.1] PHP Notice: Undefined index: submit in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\mywebsite\\test2.php on line 24Does anyone have any ideas?
I am struggling to find an example to work from to get this working. If anyone can point me to any literature that will explain the code so that I can work this out for myself that would also be a great help. -
Error while insert into database using DB adpater for Field BLOB
Hello All
I am trying to tranfer data from Database A to Database B using Oracle DB adapter.
Table of databse A contains field BLOB, which cotains the resume /doc file.After transformation in Database B format ,while invoking the DB adapter to insert, I am getting follwing error
<bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="code"><code>null</code>
</part><part name="summary"><summary>file:/u01/bpelvinc/product/10.1.3.1/OracleAS_1/bpel/domains/viapps/tmp/.bpel_ERecuit_Application_New_1.0_d1c2b2149a9e0c7c745279667ad1fc84.tmp/DB_APPL_111.wsdl [ DB_APPL_111_ptt::insert(RtmApplicantCollection) ] - WSIF JCA Execute of operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.
insert failed. Descriptor name: [DBAPPL111.RtmApplicant]. [Caused by: Error in encoded stream, got 2]
; nested exception is:
ORABPEL-11616
DBWriteInteractionSpec Execute Failed Exception.
insert failed. Descriptor name: [DBAPPL111.RtmApplicant]. [Caused by: Error in encoded stream, got 2]
Caused by Exception [TOPLINK-3001] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070608)): oracle.toplink.exceptions.ConversionException
Exception Description: The object [xs:base64Binary 43524541544520544193B0D0A], of class [class java.lang.String], could not be converted to [class java.sql.Timestamp].
Internal Exception: java.io.IOException: Error in encoded stream, got 2.
</summary>
</part><part name="detail"><detail>
Exception Description: The object [xs:base64Binary 4352E616D65293B0D0A], of class [class java.lang.String], could not be converted to [class java.sql.Timestamp].
Internal Exception: java.io.IOException: Error in encoded stream, got 2</detail>
</part></bindingFault>
Please let me know ,what are the possibilities.
Thanks
SatendraHi...
well... My flow goes like Pl/SQl ---> BPEL,
Now PL/SQL code reads data from the Database A and Send it to BPEL which inserts into the Database B.
with respest to above design, I found the problem in pl/sql block.
Actually I am sending a BLOB field in the soap message. but some how pl/sql now ablt tot handle that or sending some wrong data.
my question is how to send a blob filed data to bpel using pl/sql block. this the reasion I am getting above error.
Thanks -
ORA-06502: error when inserting into table via db link with long datatype
Folks,
I am getting the following error:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small.
This occurs when an insert is done via a database link into a table that has a LONG data type for one of the columns, and the string contains some carriage returns and or line feeds.
I have checked by removing the db link, and inserting into a local table with identical column data types, where there is no error.
So this might be another db link bug?
So I need to remove the carriage returns and/or line feeds
in my pl/sql block in the page process. I have tried
l_text := REPLACE(l_text, CHR(10), ' ');
l_text := REPLACE(l_text, CHR(13), NULL);
but still getting the ORA-06502. Would really appreciate some advice here, please.
Cheers
KIMScott,
Time to 'fess up':
My fault sorry, the error was coming from another page process where I had allowed insufficient string length for one of the variables, and my error message did not identify the page process clearly.
This leads me to make a request for future releases, could the system error messages state which page process caused the problem?
One other thing I notice, and this might be a feature not a fault, the page processes are numbered: "Page Process: 3 of 5". However process 3 is not the 3rd one to be processed, and probably refers to the order in which they are created. Should the number reflect the process order?
Cheers
KIM
Maybe you are looking for
-
Since download of Firefox Hello my home desktop & laptop, both on Windows 7, are very slow to open. I have refreshed firefox, removed download history and turned off the anti virus software in extensions. All the plugins are up to date. Can we revert
-
how do I show a slide projector display from my macbook pro
-
Problem exporting HUGE ship drawings to any graphics format.
I work at a law firm which deals with very large drawings (some of which are 4 feet wide, by about 16 to 20 feet long). Sometimes we receive PDF's of these drawings, but their sheer size makes them unmanageable to print. One option is to export the
-
Bridge Extension for Elements 6.0?
I used to have Elements 5.0 and when I double-clicked a photo in Bridge, it'd open in Camera Raw in Elements. But now I've upgraded (lol) to Elements 6.0 and when I double-click a photo, it asks if I want to open in Windows Viewer/Gallery/whatever. I
-
Captivate 6 crashes when trying to create a 1280x720 project.
A few days ago, Captivate began to crash every time I try to create a new 1280x720 project. A non-specific error message displays saying that Captivate encountered a fatal error and the application must close. I tried uninstalling and reinstalling (t