If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Update Quoted Field in ORACLE Using ADO

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-19-02, 16:24
BrianG BrianG is offline
Registered User
 
Join Date: Nov 2002
Posts: 4
Question Update Quoted Field in ORACLE Using ADO

Hello all,

I have a database table that has a field named "Source". I created the field with quoted identifiers since Source is a reserved word. I have a VB app that selects rows from this table and performs an update on the "Source" field using an ordinal position in the recordset.

sql = "SELECT ""Source"" FROM ""DSRACTVYGUIControls"" WHERE ""ControlName"" = 'MyNewComponent_Src1Agg'"
rs.Open sql, conn, , , adCmdText
While Not rs.EOF
rs(0) = Replace(rs(0),"SEARCH", "REPLACE")
rs.Update
rs.MoveNext
Wend

The problem comes when I call the update. I receive the error:
[Oracle][ODBC][Ora]ORA-00904: invalid column name

It would seem that ADO is not using the quoted identifiers when it trys to perform the update. Does anyone have any thoughts on this? Is there an option in the connection or recordset object that I need to set?

I know that I could just use an update query, but I would really like for the update to be performed through the ado recordset since this works with other databases and I have this trype of scenario many places in my code.

Thanks for your help,

brian
Reply With Quote
  #2 (permalink)  
Old 11-19-02, 18:02
vududoc vududoc is offline
Registered User
 
Join Date: Jul 2001
Location: NC
Posts: 102
BrianG

The simplist way to resolve your problem would be to change the table name to TBL_SOURCE and column name to COL_SOURCE.
Reply With Quote
  #3 (permalink)  
Old 11-19-02, 19:50
BrianG BrianG is offline
Registered User
 
Join Date: Nov 2002
Posts: 4
Changing the actual name of the table and column in the database is not an option.

Any other thoughts?

Thanks,
Brian


Quote:
Originally posted by vududoc
BrianG

The simplist way to resolve your problem would be to change the table name to TBL_SOURCE and column name to COL_SOURCE.
Reply With Quote
  #4 (permalink)  
Old 11-19-02, 22:48
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
I would really recommend doing an update statement - it is faster and you can reuse it. If you still want to persue the other option, how do you set a quoted identifier to true in oracle ? In Sql Server you can use a transact sql statement "SET QUOTED_IDENTIFIER ON" - is this possible in oracle ?
Reply With Quote
  #5 (permalink)  
Old 01-19-03, 11:41
Ad Dieleman Ad Dieleman is offline
Registered User
 
Join Date: Jan 2003
Location: Dordrecht, The Netherlands
Posts: 95
Re: Update Quoted Field in ORACLE Using ADO

Have you checked that the column name in Oracle is "Source" and not "SOURCE"?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On