SapHana.Database

Updated on

SapHana.Database is a Power Query M function that returns a table of multidimensional packages from an SAP HANA database server. The function returns a table of packages with various options available for customization.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

SapHana.Database(
   server as text,
   optional options as nullable record,
) as table
ArgumentAttributeDescription
serverSpecifies the SAP HANA database server.
OptionsOptionalUsed to control a selection of parameters. You can provide Query, Distribution, Implementation, EnableColumnBinding, ConnectionTimeout and CommandTimeout in the form of a record parameter: [ Distribution = 0, Implementation = “2.0” ]

Description

Returns a table of multidimensional packages from the SAP HANA database server. An optional record parameter, options, may be specified to control the following options:

  • Query : A native SQL query used to retrieve data. If the query produces multiple result sets, only the first will be returned.
  • Distribution : SapHanaDistribution.Type is a SapHanaDistribution that sets the value of the “Distribution” property in the connection string. Statement routing is the method of evaluating the correct server node of a distributed system before statement execution. The default value is SapHanaDistribution.All, but you can also use SapHanaDistribution.Off, SapHanaDistribution.Connection and SapHanaDistribution.Statement.
  • Implementation : Specifies the implementation of the SAP HANA connector to use.
  • EnableColumnBinding : Binds variables to the columns of a SAP HANA result set when fetching data. May potentially improve performance at the cost of slightly higher memory utilization. The default value is false.
  • ConnectionTimeout : A duration that controls how long to wait before abandoning an attempt to make a connection to the server. The default value is 15 seconds.
  • CommandTimeout : A duration that controls how long the server-side query is allowed to run before it is canceled. The default value is ten minutes.

Examples

= SapHana.Database( 
    "myhanaserver:30015", 
    [ Distribution = SapHanaDistribution.All, Implementation = "2.0" ]
)

Learn more about SapHana.Database in the following articles:

BI Gorilla Youtube Channel

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/saphana-database