Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Invalid Identifier Error When Posting An ADO Query That Contains Rownum


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Mar 4, 2015 9:45 AM Last Post By: sean collins
sean collins

Posts: 9
Registered: 5/22/13
Invalid Identifier Error When Posting An ADO Query That Contains Rownum  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 17, 2015 11:52 AM
I have an ADO query that I use to gather data and later use to update that data. (Embarcadaro C++ Xe2 & Oracle 10g). Rownum (aliased to pgnum) is also selected and in this query. When posting data edited via this query, I receive invalid identifier "pgnum". This seems to be an issue specifically with ADO as this same code worked in previous versions of our software. We recently converted all our queries to ADO from Tquery (old BDE Driven). PGNUM is a persistant field on the Ado query. Any advice would be greatly appreciated. (Table1 is an ADO Query)

sql = "SELECT ROWNUM PGNUM, A.* FROM DOCUMENT_IMAGE A WHERE DOCNO = " +       String(Form1->qryDocumentDOCNO->AsInteger) +  " ORDER BY ROWNUM ";
Table1->Close();
Table1->SQL->Clear();
Table1->SQL->Add(sql);
Table1->Open();
 
 
Table1->Edit();
Table1IMAGE->LoadFromFile(filepath);
if (Table1->Modified){
  Table1->Post();
}
sean collins

Posts: 9
Registered: 5/22/13
Re: Invalid Identifier Error When Posting An ADO Query That Contains Rownum  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 4, 2015 9:45 AM   in response to: sean collins in response to: sean collins
sean collins wrote:
I have an ADO query that I use to gather data and later use to update that data. (Embarcadaro C++ Xe2 & Oracle 10g). Rownum (aliased to pgnum) is also selected and in this query. When posting data edited via this query, I receive invalid identifier "pgnum". This seems to be an issue specifically with ADO as this same code worked in previous versions of our software. We recently converted all our queries to ADO from Tquery (old BDE Driven). PGNUM is a persistant field on the Ado query. Any advice would be greatly appreciated. (Table1 is an ADO Query)

sql = "SELECT ROWNUM PGNUM, A.* FROM DOCUMENT_IMAGE A WHERE DOCNO = " +       String(Form1->qryDocumentDOCNO->AsInteger) +  " ORDER BY ROWNUM ";
Table1->Close();
Table1->SQL->Clear();
Table1->SQL->Add(sql);
Table1->Open();
 
 
Table1->Edit();
Table1IMAGE->LoadFromFile(filepath);
if (Table1->Modified){
  Table1->Post();
}

I removed ROWNUM from the query and used another column to order the query by. Problem solved. Not sure why rownum was in the query in the first place, I took this project over from someone.

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02