BO's and Stored Procedures


Author
Message
Terry Bottorff
Terry Bottorff
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 448, Visits: 12K
I have a Stored Proc that combines 2 Tables into one table (Like a Name Table and a Score Table) related by a NamePK to get a table that contains the names and respective scores. How do I attach this stored proc to a BO?

I have tried searching the forum and I can fill a BO if it is just a single table with a stored proc but with multiple tables I am not sure how to do that so the BO will know the structure of the resulting table?

TIA.

Replies
Michel Levy
Michel Levy
Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)
Group: StrataFrame Users
Posts: 193, Visits: 9K
Hi Terry,

2 solutions, that I use in an app:

  1. create a view as SELECT * from <your SP>, and map your BO on that view
  2. create a table, let it empty (no data), map your BO on that table, and from within the BO, ExecuteNonQuery('your_SP'). Of course your SP need to delete all in the table, and then fill the table. You can now fill the BO from the table.

It woud be great if we could map a BO on a table function...

Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Michael / Terry,

If you are using the DDT, you can create a table schema with all the columns that you want, then map the BO in the BOM to that table schema and then you can use your store procedure to fill that BO, as long as your SP return columns with the same names mapped in the BO you will be OK.



Also if you already have a BO created with some some columns, you can add the needed columns as custom fields properties with the same names as the columns returned by your SP and the BO will also fill up those custom field properties for you.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search