Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 7th, 2005, 04:49 AM
Authorized User
 
Join Date: Oct 2004
Location: , , .
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default prob.. in the increasing of sring values..

i have the following query which insert Voucher No. that is string like that BP0101001..

when i insert voucher no it select maximum voucher no. from database and then increase the voucher no by 1..i.e. its incresing the voucher no..automatically by taking voucher no from the database..

It increases like that...

BP0101001
BP0101002
BP0101003
BP0101004


but its coming error of:

Exception:[Oracle][ODBC][Ora]ORA-01401: inserted value too large for column

as i have already checked the insertion of all the vales size..its with in the size of database..

is there an prob.. in my following query..

plz.. make my query working for me...

Statement stmt=conn.createStatement();

stmt.execute("SELECT max(vou_no) as max_id FROM pay_header ");

results = stmt.getResultSet();

if(results.next())
{
Voucher_No=results.getString("max_id") + 1;
}
conn.setAutoCommit(false);

PreparedStatement pstmt = conn.prepareStatement(
("INSERT INTO pay_header VALUES (?)"));

pstmt.setString(1,Voucher_No);

pstmt.executeUpdate();

conn.commit();
conn.setAutoCommit(true);


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hi all I encounter a prob while passing values.. geethan85 BOOK: Beginning Ruby on Rails 0 May 14th, 2007 01:17 AM
Increasing the imageable size when printing nilsnorden BOOK: Beginning Java 2, JDK 5 Edition 0 February 23rd, 2007 11:19 AM
Increasing a price if sqf is over standard limit mjuliao Access 1 September 14th, 2005 11:25 PM
Checking null values in Query(SQL Server) Prob leo_vinay Classic ASP Databases 2 December 28th, 2004 04:31 AM
Excel VB workbook increasing in size bdancis Excel VBA 1 December 7th, 2004 04:23 PM



All times are GMT -4. The time now is 03:05 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.