Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ORA-01722

Posted on 2011-02-11
2
Medium Priority
?
948 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
aciuica earned 2000 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows how to recover a database from a user managed backup
This video teaches viewers about errors in exception handling.
Suggested Courses

618 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