Solved

ORA-01722

Posted on 2011-02-11
2
932 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.

929 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

12 Experts available now in Live!

Get 1:1 Help Now