How to call a SP in SQL Server and display results

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
BLOMASKY
Posts: 1473
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

How to call a SP in SQL Server and display results

Post by BLOMASKY »

I was trying something simple. All of this is in MSSQL Server. (With different databases your results may vary).

For testing, I created a BO with 3 columns of my ITEMS BO (Item, dim1 and dim2) and called a SP that just retrieved these 3 colunms, however, nothing was displayed. Finally, figure out to look at the Aware log, and low and behold, I see the following (a bunch of times.)

ID of the object returned by the result set could not be determined. The object will not be placed in the context
The column name ID is not valid.
The column name BASVERSION is not valid.
The column name BASTIMESTAMP is not valid.

I know that for all persistant BO's that Aware adds these 3 "hidden" columns to the database table. So, I changed my Select statement to look like:

select item as ID, 1 as BASVERSION, getDate() as BASTIMESTAMP, item, dim1, dim2
from BASTESTDOMAINALC_ITEM
where dim1 = 2 and dim2 = 4

and all works fine.

Just wanted to share this with any others who are looking to use a SP to retrieve data

Bruce
Post Reply