Solved

ORA-01722

Posted on 2011-02-11
2
929 Views
Last Modified: 2012-05-11
Please advice why I have ORA-01722 if local variable is double
double[] outY = new double[10];

Open in new window

sql
System.out.println(outY[0] + "  = outY[0]  "  + new java.util.Date());
sql_Y = " INSERT INTO RBF_DATA " + "(OUTY0) " + "VALUES " + "('" + outY[0] + "')";

Open in new window

and output
0.12258723414643523  = outY[0]  Fri Feb 11 19:27:52 EET 2011

11.02.2011 19:27:53 connect.SelectData run
SEVERE: null
java.sql.SQLSyntaxErrorException: ORA-01722:

Open in new window

column
CREATE TABLE "LIONFX"."RBF_DATA"
  (
    "ID" NUMBER NOT NULL ENABLE,
    "OUTY0" FLOAT(126),

Open in new window

when I change column to VARCHAR2 everything ok.
But outY[] declared as a double.
Please advice.
0
Comment
Question by:gbcbr
2 Comments
 
LVL 5

Accepted Solution

by:
aciuica earned 500 total points
ID: 34873341
Maybe you should remove the single quote characters.
Instead of:
sql_Y = " INSERT INTO RBF_DATA " + "(OUTY0) " + "VALUES " + "('" + outY[0] + "')";
you can try:
sql_Y = " INSERT INTO RBF_DATA " + "(OUTY0) " + "VALUES " + "(" + outY[0] + ")";
0
 

Author Comment

by:gbcbr
ID: 34873358
Yes!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now