473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

sequence id generation

52
hi, im incrementing my id by using sequence in oracle.........but i dont know what to specify in my insert statement in my jsp page..........

while i tried in oracle it worked........i said :
insert into table values(id.nextval,'aaa');

but, in my jsp page im getting an error saying : invalid number.......
please help me out with this
Mar 15 '07 #1
4 2900
r035198x
13,262 8TB
hi, im incrementing my id by using sequence in oracle.........but i dont know what to specify in my insert statement in my jsp page..........

while i tried in oracle it worked........i said :
insert into table values(id.nextval,'aaa');

but, in my jsp page im getting an error saying : invalid number.......
please help me out with this
Please post the code in the jsp that is giving the error and the full error message that you are getting.
Mar 15 '07 #2
mallz
52
Please post the code in the jsp that is giving the error and the full error message that you are getting.
hi,
this is the error that im getting, the error does not appear in my browser window....but in my tomcat server logs....

java.sql.SQLException: [Microsoft][ODBC driver for Oracle][Oracle]ORA-01722: invalid number

this is my code:

String s1=request.getParameter("m1");
String s2=request.getParameter("m2");
String s3=request.getParameter("m3");

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:aps","s cott","tiger");
st=con.createStatement();

String query1="insert into MOM
values('meetingid.nextval','"+s1+"','"+s2+"','"+s3 +"');


note: i have created a sequence for meetingid in my database........
Mar 15 '07 #3
r035198x
13,262 8TB
hi,
this is the error that im getting, the error does not appear in my browser window....but in my tomcat server logs....

java.sql.SQLException: [Microsoft][ODBC driver for Oracle][Oracle]ORA-01722: invalid number

this is my code:

String s1=request.getParameter("m1");
String s2=request.getParameter("m2");
String s3=request.getParameter("m3");

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:aps","s cott","tiger");
st=con.createStatement();

String query1="insert into MOM
values('meetingid.nextval','"+s1+"','"+s2+"','"+s3 +"');


note: i have created a sequence for meetingid in my database........
Here is what I got when I checked on google.

ORA-01722:invalid numberCause:The attempted conversion of a character string to a number failed because the character string was not a valid numeric literal. Only numeric fields or character fields containing numeric data may be used in arithmetic functions or expressions. Only numeric fields may be added to or subtracted from dates.Action:Check the character strings in the function or expression. Check that they contain only numbers, a sign, a decimal point, and the character "E" or "e" and retry the operation.
Mar 15 '07 #4
hirak1984
316 100+
where is your meetingid?

please post its type and check if the type matches with the type in table in oracle.

hi,
this is the error that im getting, the error does not appear in my browser window....but in my tomcat server logs....

java.sql.SQLException: [Microsoft][ODBC driver for Oracle][Oracle]ORA-01722: invalid number

this is my code:

String s1=request.getParameter("m1");
String s2=request.getParameter("m2");
String s3=request.getParameter("m3");

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:aps","s cott","tiger");
st=con.createStatement();

String query1="insert into MOM
values('meetingid.nextval','"+s1+"','"+s2+"','"+s3 +"');


note: i have created a sequence for meetingid in my database........
Mar 15 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

51
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
8
by: Max M | last post by:
Yesterday there was an article on Slashdot: http://books.slashdot.org/article.pl?sid=03/09/04/1415210&mode=flat&tid=108&tid=126&tid=156 It is about automatic code generation. I got interrested...
0
by: Rasmus Fogh | last post by:
Someone raised the question of automatic code generation a few weeks back. And yes, we (CCPN) are using automatic Python code generation in a major way. Basically we are making data models in...
7
by: Jeff Schwab | last post by:
What's the best way to generate a sequence of characters in Python? I'm looking for something like this Perl code: 'a' .. 'z' .
3
by: Srini | last post by:
Hello, I would like to know Identity OR sequence which is better?. My requirement is simple. I have a parent table with ID (generated or from sequence) and I want that ID after inserting...
2
by: edurne murgiondo via DBMonster.com | last post by:
I have a table with a column as identity. I don't know how can migrate a identity column to a normal column using sequence. Thnaks -- Message posted via http://www.dbmonster.com
3
by: Eddy Ilg | last post by:
Hi, I would like to suppress .pyc generation or have the .pyc generation in a speical seperate root (I found something about PYCROOT). Has this been implemented yet? Is there an environment...
6
by: newtophp2000 | last post by:
Hello, Since SQL Server has no sequence generator, I wrote my own. (I claim no ownership of it as it is closely modeled after earlier discussions on this topic.) I have included the sql...
31
by: eliben | last post by:
Hello, In a Python program I'm writing I need to dynamically generate functions and store them in a dict. eval() can't work for me because a function definition is a statement and not an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.