BO's and Stored Procedures


Author
Message
Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 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.

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

Check out this post http://forum.strataframe.net/Topic21580-8-1.aspx it will explain how to do what you want.

Edhy Rijo

Michel Levy
Michel Levy
StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 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 (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K 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

Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (940 reputation)Advanced StrataFrame User (940 reputation)Advanced StrataFrame User (940 reputation)Advanced StrataFrame User (940 reputation)Advanced StrataFrame User (940 reputation)Advanced StrataFrame User (940 reputation)Advanced StrataFrame User (940 reputation)Advanced StrataFrame User (940 reputation)Advanced StrataFrame User (940 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Edhy - if you create a structure like that in DDT (interesting idea) do you let the DDT deploy the structure to a table in the database? Is this for a basically readonly BO? Not sure how the update would work -are you just updating the primary table that fills the BO, as you would with a VFP remote view?
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Charles,



Yes I use this procedure for ReadOnly process where I like to use the SF ListView and also for XML files, this way instead of me maintaining the XML fields manually I simply use a dummy DDT profile and tell the BOM to use that DDT profile to build the BO schema. All this is explained in more detail in the link I provided in this thread before.

Edhy Rijo

Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (940 reputation)Advanced StrataFrame User (940 reputation)Advanced StrataFrame User (940 reputation)Advanced StrataFrame User (940 reputation)Advanced StrataFrame User (940 reputation)Advanced StrataFrame User (940 reputation)Advanced StrataFrame User (940 reputation)Advanced StrataFrame User (940 reputation)Advanced StrataFrame User (940 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Thanks. Maybe I'm doing something wrong but that link just takes me back to this page Unsure
Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
The link did the same to me and I finally had to copy and paste it to make it work.
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