Create stored procedure in SSAS Tabular model - stored-procedures

Is it possible to create a stored procedure in SSAS Tabular Model? I need to invoke a stored procedure from a Fact table in SSAS Tabular model. The results are stored in a temporary table. My client does not want the stored procedure to be stored as an object on the database.

Importing to Tabular via a Stored Proc
This link here should be the answer to your question.
I think something to be mindful of is whether or not your temp tables' results will produce a predictable column output.

Related

The dataset does not bring the fields of the stored procedure

I am using a wizard to generate a table from a dataset that calls a stored procedure. The problem is that this dataset does not have any fields because they are generated dynamically in the sp, varying the amount and the names. How I should proceed?

DB2 stored procedure - changing the table structure

I have to add a new column to one of the existing DB2 tables. If I do so, do I need to recompile all the stored procedures accessing that table? What happens if I don't do that?
Documentation is pretty clear on that:
Adding a column to a table will result in invalidation of all packages with INSERT usage on the altered table. If the added column is the first user-defined structured type column in the table, packages with DELETE usage on the altered table will also be invalidated.
If the new column has a constraint on it, packages with other uses of the table may be invalidated as well.
Invalid packages will be automatically revalidated on their next use. In other words, you don't need to do anything.

In Firebird can you use a cursor with EXECUTE STATEMENT?

I would like to pass, to a stored procedure, a table and field name, and then do a FOR SELECT on the table and, for some records, change the field value. I just learned about cursors which is a very convenient way to make changes in a FOR SELECT loop. But can I use cursors with EXECUTE STATEMENT?
I want this stored procedure to work for a variety of tables with a similar structure so I want it to be generic hence passing in the table name and field name.
I'm pretty sure the answer is "No." so how could I do this?

How to use schema-mapping in a stored procedure when you have more than one schema?

I have a stored procedure on my HANA database where I need to join two tables from different schemas. These schemas are named differently in the development, staging and production system.
The obvious solution in this situation would be to use Schema-Mapping. But unfortunately schema-mapping only seems to work for the default schema of a stored procedure. When trying to reference an authoring schema in a stored procedure (ex. JOIN "AUTHORING_SCHEMA"."SOME_TABLE" ON ...) you get the error message "invalid schema name". So it seems like I can only use schema-mapping for one of the tables but not for both.
I know I can read the schema mappings in my stored procedure by querying the table "_SYS_BI"."M_SCHEMA_MAPPING", but I can't find out how to query from a schema when I have the schema name in a variable.
I would give it a try to work around this limitation by defining two synonyms using .hdbsynonym
For details on how to create design time synonyms using .hdbsynonym check https://help.sap.com/saphelp_hanaplatform/helpdata/en/52/78b5979128444cb6fffe0f8c2bf1e3/content.htm and https://help.sap.com/saphelp_hanaplatform/helpdata/en/4c/94a9b68b434d26af6d878e5f51b2aa/content.htm
There you can also find a description on how schema mapping works with hdbsynonym.
For details on synonyms in general see https://blogs.sap.com/2016/12/05/using-synonyms-in-sap-hana/
I solved this with a workaround which I am not entirely happy about, but which works for now.
I created a second stored procedure with the second schema as default schema. This procedure does nothing but SELECTing the contents of the second database table.
The first stored procedure calls the second one to load the data into a local table variable and then performs a JOIN between the first database table and the table variable.
This works reasonably well because the second table is rather small (16 rows at the moment, unlikely to grow beyond 100). But I wouldn't want to do it with a larger table.

Mapping entity type configuration with select stored procedures

Talking about mapping stored procedures on EF6 I noted that ModificationStoredProceduresConfiguration class only has three options to map stored procedures (Insert, Update and Delete)... (Code First workflow)
Why there is not a 'Select' option?.
Which is the best approach people out there are using to map 'Select' stored procedures to entity types on EF6?.
Thanks.

Resources