Home » U++ Library support » U++ SQL » Filling same SqlArray with different tables from database 
	
		
		
			| Filling same SqlArray with different tables from database [message #36205] | 
			Sat, 12 May 2012 09:13   | 
		 
		
			
				
				
				
					
						  
						ayana
						 Messages: 16 Registered: November 2011 
						
					 | 
					Promising Member  | 
					 | 
		 
		 
	 | 
 
	
		Hi , 
 
 
 
For the first time the data has to come from the table DEMANDINSERT with the following attributes n fill the SqlArray sqlIn. 
 
sqlIn.SetTable ( DEMANDINSERT ); 
 
sqlIn.AddColumn ( ITEMID , "ItemId" ); 
sqlIn.AddColumn ( PARTYID, "PartyId" ); 
sqlIn.AddColumn ( PARTYNAME, "PartyName" ); 
sqlIn.AddColumn ( ORDERDATE, "OrderDate" ); 
sqlIn.AddColumn ( ORDERQTY, "OrderQty" ); 
sqlIn.AddColumn ( NOOFDAYS, "NoOfDays" ); 
sqlIn.AddColumn("Shifted Dates"); 
sqlIn.Appending().Removing(); 
sqlIn.SetWhere ( MRPID == " " ); 
 
sqlIn.Query(); 
 
 
Now ,after a button click the data has to come from the DEMANDINFO table and which has to reset the same SqlArray sqlIn. 
the table is as follows, 
 
sqlIn.Reset(); 
 
sqlIn.SetTable ( DEMANDINFO ).AutoInsertId ( true ); 
sqlIn.AddColumn ( ITEM1 , "ItemId" ).Edit ( edtItemid ); 
sqlIn.AddColumn ( PARTY1, "PartyId" ).Edit ( edtPartyID ); 
sqlIn.AddColumn ( DUEDATE, "Date" ).Edit ( edtDate ); 
sqlIn.AddColumn ( QTY, "Qty" ).Edit ( edtQty ); 
sqlIn.Appending().Removing(); 
 
sqlIn.Query(); 
 
 
Eventhough in second query there is no WHERE condition, its considering it and giving the error as follows, 
 
Sql ERROR: 
ORA-00904: "MRPID": invalid identifier 
 
Error Statement: 
 
select ITEM1, PARTY1, DUEDATE, QTY from DEMANDINFO where MRPID = ' '  
 
 
How to set the same SqlArray with different query execution?? 
 
 
Regards, 
 
Nayana 
 
	  
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	| 
		
 |  
	
		
		
			| Re: Filling same SqlArray with different tables from database [message #36231 is a reply to message #36205] | 
			Tue, 15 May 2012 07:07    | 
		 
		
			
				
				
				
					
						  
						Sender Ghost
						 Messages: 301 Registered: November 2008 
						
					 | 
					Senior Member  | 
					 | 
		 
		 
	 | 
 
	
		Hello, Nayana. 
| ayana wrote on Sat, 12 May 2012 09:13 |   Eventhough in second query there is no WHERE condition, its considering it and giving the error as follows, 
 
Sql ERROR: 
ORA-00904: "MRPID": invalid identifier 
 
Error Statement: 
select ITEM1, PARTY1, DUEDATE, QTY from DEMANDINFO where MRPID = ' '  
 
How to set the same SqlArray with different query execution?? 
  |  
  
As error statement said, "there is WHERE condition", which you set for SqlArray before: 
sqlIn.SetWhere(MRPID == " ");
  
To fix this error, you need to clear "WHERE" expression, e.g. with following source code: 
 
The second part of the source code with previous fix: 
sqlIn.Reset();
sqlIn.SetTable(DEMANDINFO).AutoInsertId(true);
sqlIn.AddColumn(ITEM1 , "ItemId").Edit(edtItemid);
sqlIn.AddColumn(PARTY1, "PartyId").Edit (edtPartyID);
sqlIn.AddColumn(DUEDATE, "Date").Edit(edtDate);
sqlIn.AddColumn(QTY, "Qty").Edit(edtQty);
sqlIn.Appending().Removing();
sqlIn.SetWhere(true);
sqlIn.Query();
  
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 06:45:05 CET 2025 
 Total time taken to generate the page: 0.05987 seconds 
 |