Choosing an export database connection type
To help you choose an export database connection type, read each description in the following list. The code in the first two examples shows stored procedures that insert records into a sample table:
*SQL Server
CREATE PROCEDURE sp_InsertSampleData(
@MeasureName varchar (255),
@LocationName varchar (255),
@ComparativeName varchar (255),
@PeriodName varchar (13),
@UserData decimal(13)
)
AS
insert into Sample(
MeasureName,
LocationName,
ComparativeName,
PeriodName,
UserData
) values (
@MeasureName,
@LocationName,
@ComparativeName,
@PeriodName,
@UserData
)
*Oracle
Create a procedure named SP_INSERTSAMPLEDATA with the following text as the body:
(
pMeasureName varchar2 ,
pLocationName varchar2 ,
pComparativeName varchar2 ,
pPeriodName varchar2 ,
pFact float
) is
begin
insert into Sample(
MeasureName ,
LocationName ,
ComparativeName ,
PeriodName ,
Fact
) values (
pMeasureName ,
pLocationName ,
pComparativeName ,
pPeriodName ,
pFact
);
commit work;
end;
Specific field names, number of fields, parameter names, and number of parameters depend on the target structure. Metrics Management supports exporting data to targets more complex than shown in the preceding examples. For example, Metrics Management supports creating a procedure that exports data to several tables.
*Stored Procedure
Exports the selected data to a stored procedure defined to handle the Metrics Management data column formats. Stored procedures that insert data must use an appropriate format for input parameters. The parameters must be ordered according to the field’s structure defined inside the Metrics Management export object. The examples expose the structure of stored procedures for data insertion to tables of the same structure.
*Table
Exports the selected data to a predefined table formatted for Metrics Management export. This target table must exist and have column definitions that match the target table column formats defined for Metrics Management.
For more information about table and data column formats, and the column formats required to export data, see Export column definitions.