×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Folks,

        Another bit of help needed from experts in this forum.

        Here is the snippet of my code where I'm converting Java String
types to Zoned Decimal As400 Types. Both Date[] and closingprice [] are
of types String.

        The file BLMINTF1 has both these fields defined as Zoned.

                
                                String d1 = date[i].substring(3,4)+
date[i].substring(9,10) + date[i].substring(6,7);

                                BigDecimal d2 = new BigDecimal(d1);
                                
                                byte[] asd2 = new
AS400ZonedDecimal(6,0).toBytes(d2);
                                
                                BigDecimal bd1 = new
BigDecimal(closingprice[i]);
                                
                                byte[] asbd1 = new
AS400ZonedDecimal(15,5).toBytes(bd1);
                                
                                
                                sqlstmt = "Insert into BLMINTF1 (" +
field1 + "," + field2 + ")" +
                                " values (" + asd2 + "," + asbd1 + ")";
                                
                                System.out.println(sqlstmt);
                                
                                stmt.executeUpdate(sqlstmt);
                                
                                con.close();

        When I run this pgm, I get an error during Insert statement.

        java.sql.SQLException: ^SQL0104] Token ^ was not valid. Valid
tokens: ( + - ? : DAY RRN CASE CAST CHAR DAYS HOUR LEFT NULL TRIM U
SER.

      java/lang/Throwable.<init>(Ljava/lang/String;)V+4
(Throwable.java:94)

      java/lang/Exception.<init>(Ljava/lang/String;)V+1
(Exception.java:42)

 
java/sql/SQLException.<init>(Ljava/lang/String;Ljava/lang/String;I)V+1
(SQLException.java:43)                              
 
com/ibm/as400/access/JDError.throwSQLException(Lcom/ibm/as400/access/AS4
00JDBCConnection;III)V+0 (JDError.java:517)        
 
com/ibm/as400/access/AS400JDBCStatement.commonPrepare(Lcom/ibm/as400/acc
ess/JDSQLStatement;)Lcom/ibm/as400/access/JDServerR
ow;+0 (AS400JDBCStatement.java:920)



        Thanks for your help in advance,


Rajesh Anand
Email:Rajesh_anand@xxxxxx
--------------------------------------------------------

If you are not an intended recipient of this e-mail, please notify the sender, 
delete it and do not read, act upon, print, disclose, copy, retain or 
redistribute it. Click here for important additional terms relating to this 
e-mail.     http://www.ml.com/email_terms/
--------------------------------------------------------

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.