Solved

ora-01722 when using the ODP OracleDataAdapter to update a DataTable

Posted on 2004-04-02
3
475 Views
Last Modified: 2007-12-19
I'm trying to lookup the referential keys in the insert sql (OracleDataAdapter.InsertCommand.CommandText) =

"INSERT INTO CARDS (CARDS.RTU_ID, CARDS.CARD_TYP_ID, CARDS.RACK_NO, CARDS.SLOT_NO) VALUES ((SELECT RTUS.RTU_ID FROM RTUS WHERE RTUS.RTU_CD = :col0), (SELECT CARD_TYPES.CARD_TYP_ID FROM CARD_TYPES WHERE CARD_TYPES.CARD_TYP_CD = :col3), :col1, :col2)"

and keep getting "ora-01722 invalid number".

The bizarre thing is that this works:

"INSERT INTO CARDS (CARDS.RTU_ID, CARDS.CARD_TYP_ID, CARDS.RACK_NO, CARDS.SLOT_NO) VALUES ('1', '1', :col1, :col2)"

and so does this:

"INSERT INTO CARDS (CARDS.RTU_ID, CARDS.CARD_TYP_ID, CARDS.RACK_NO, CARDS.SLOT_NO) VALUES ((SELECT RTUS.RTU_ID FROM RTUS WHERE RTUS.RTU_CD = :col0), (SELECT CARD_TYPES.CARD_TYP_ID FROM CARD_TYPES WHERE CARD_TYPES.CARD_TYP_CD = :col3), '1', '1')"


Any help is appreciated!
0
Comment
Question by:Troy_Lyne
[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
3 Comments
 
LVL 9

Accepted Solution

by:
glsac earned 200 total points
ID: 10752128
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

632 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