Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
ayana is currently offline  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 #36222 is a reply to message #36205] Sun, 13 May 2012 21:40 Go to previous messageGo to next message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Hi Nayana,


Why not using two different SqlArrays for data from DEMANDINFO table and from DEMANDINSERT table? Smile The 2 arrays could be included in one form. A lot of sales/orders management softwares works like that.

Regards

Biobytes

[Updated on: Sun, 13 May 2012 21:41]

Report message to a moderator

Re: Filling same SqlArray with different tables from database [message #36230 is a reply to message #36205] Tue, 15 May 2012 06:01 Go to previous messageGo to next message
ayana is currently offline  ayana
Messages: 16
Registered: November 2011
Promising Member
Hi,

Thank you for your suggestion Biobytes. But as per my application requirement, it should happen in single SqlArray. Kindly let me know the notion for the same.

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 Go to previous messageGo to next message
Sender Ghost is currently offline  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:
sqlIn.SetWhere(true);

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();
Re: Filling same SqlArray with different tables from database [message #36232 is a reply to message #36205] Tue, 15 May 2012 07:37 Go to previous message
ayana is currently offline  ayana
Messages: 16
Registered: November 2011
Promising Member
Thank you Sender.Its working.
Previous Topic: MSSQL, default DB, datetime
Next Topic: Sql .sch / Date (moved)
Goto Forum:
  


Current Time: Fri Mar 29 12:44:14 CET 2024

Total time taken to generate the page: 0.01361 seconds