Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 7th, 2005, 04:49 AM
Authorized User
 
Join Date: Oct 2004
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);







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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.