I have a workshop registration BO that allows for entry of two workshops (W1, W2) - I created a query using the SQL Form that basically gives me a list of all registrants by workshops. It is
SELECT Workshop.W1, Workshop.DisplayName FROM EDU_WORKSHOP
UNION
SELECT Workshop.W1, Workshop.DisplayName FROM EDU_WORKSHOP
When I run the query through the application it gives me a result set that is
DisplayName, W1, W2
is a Union not allowed? Should I do this another way?
thanks
Probelm with SQL Query using UNION
Probelm with SQL Query using UNION
Thom
Windows-SQL Server Express 2005-Build 1336
Windows-SQL Server Express 2005-Build 1336
ok ... I tracked down the problem as to why I was not getting the right result set but know when I run the query
SELECT Workshop.W1, Workshop.DisplayName FROM EDU_WORKSHOP AS Workshop
UNION
SELECT Workshop.W2, Workshop.DisplayName FROM EDU_WORKSHOP
AS Workshop
I get the message
"Business Object WORKSHOP not found in the business space version"
SELECT Workshop.W1, Workshop.DisplayName FROM EDU_WORKSHOP AS Workshop
UNION
SELECT Workshop.W2, Workshop.DisplayName FROM EDU_WORKSHOP
AS Workshop
I get the message
"Business Object WORKSHOP not found in the business space version"
Thom
Windows-SQL Server Express 2005-Build 1336
Windows-SQL Server Express 2005-Build 1336
-
- Posts: 7536
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
I have attempted to create a union query for a very simple join of one date attribute and one text attribute into one column and I am getting the same error as Thom was previously.
My query is the following:
SELECT Appointments.EndTime FROM MEC_APPOINTMENTS AS Appointments
UNION
SELECT Appointments.Description FROM MEC_APPOINTMENTS AS Appointments
I created a simple query and then checked the SQL Form and the exact translation was:
SELECT Appointments.EndTime FROM MEC_APPOINTMENTS AS Appointment
I'm sure that I am missing something simple so any help would be appreciated.
Thanks
My query is the following:
SELECT Appointments.EndTime FROM MEC_APPOINTMENTS AS Appointments
UNION
SELECT Appointments.Description FROM MEC_APPOINTMENTS AS Appointments
I created a simple query and then checked the SQL Form and the exact translation was:
SELECT Appointments.EndTime FROM MEC_APPOINTMENTS AS Appointment
I'm sure that I am missing something simple so any help would be appreciated.
Thanks
-
- Posts: 7536
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
-
- Posts: 7536
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Maybe that's where I am getting confused...as far as I can tell there is no way to create a UNION query in Aware (using the Simple Form, Rule Form or the SQL Form).
I am also assuming that I would have to create a proc in the database with my union query and then refer to that stored procedure via Aware to run the proc.
I was unsure how the results would then display in Aware?
I am also assuming that I would have to create a proc in the database with my union query and then refer to that stored procedure via Aware to run the proc.
I was unsure how the results would then display in Aware?
You can of course set up an existing external BO that refers to a View as well as a table. I use this quite a lot for tables external to AwareIM but I cant see why it would not work on a view that actually accessed AwareIm tables. You then have all the benefits of a BO for displaying data.
Cheers Rod
Cheers Rod
-
- Posts: 7536
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Answering a question about stored procedures - yes, you would define a stored procedure which can do whatever it likes and use SQL of any complexity including UNION's. As long as the SP returns records of the correct type the Aware IM query will be able to display them using its display settings.
Aware IM Support Team