Focal Point
Datamigrator newbie questions

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/6967002806

August 10, 2011, 07:50 PM
ferran
Datamigrator newbie questions
Hi,

As I have mentioned on subject, I have just arrived into de iWay Datamigrator world. I need to migrate some SQL Server Stored Procedures into Datamigrator. Theses Stored Procedures are, in some cases, quite large and some of theme have a lot of complexity and, as I told, I'm just a Datamigrator beginner. I would read your recomendations about this situation based upon your experience, considering that not much information available at the business level.

I have more experience in WebFOCUS, as well as batch load processes, so I know what is a MODIFY FILE. In Datamigrator there are "Stored Procedures", focus processes. I thought that I could write the processes to perform all the tasks needed, until a temporaly file (HOLD FILE), and then bulk this into the final table.

But I'm not sure if this is possible, as well as if this is a good solution for this situation.

Thank's in advice,

Ferran.


WF 7.7.03,Win XP Pro.
HTML, PDF, EXCEL, AHTML, FLEX, APDF.
SQL Server, MySQL, DB2, FOCUS.
August 15, 2011, 02:39 PM
Clif
There are several different ways to invoke MS SQL Server stored procedures from DataMigrator. It all depends on what you want to do with them.

If you just want to run them, you could indeed create a DataMigrator stored procedure and then issue the command SQL SQLMSS EX sp_name. Of course then you are not really using DataMigrator.

If a database stored procedure returns an answer set you could create a synonym for it and use it as a data source in a data flow. Alternately you could call the stored procedure in a DBMS SQL Flow.

On the other hand, if a database stored procedure returns a single value as a result, like a scalar function, you can call it in a source or target transformation.


N/A
August 18, 2011, 02:34 AM
ferran
Hi Clif,

The idea is migrate the actual SQL Server procedures into Data Migrator. We do not want to use any of the features of SQL Server, not stored procedures. The idea ultimately is to stop using SQL Server.

I need to translate the code implemented in these stored procedures to new Data Migrator flows. These SQL Server stored procedures are, as I mentioned before, quite extensive and complex. E.G. These stored procedures takes parameters to perform certain tasks or other, works with several datasources, .....

In short, I thought I could write the code as a normal .fex (like I did it so many times in BATCH-ORIENTED load processes), to perform all the tasks I need, until I could get a temporaly file to use as a source for destination table. But I don't know if this is possible....

Thanks!

Ferran.


WF 7.7.03,Win XP Pro.
HTML, PDF, EXCEL, AHTML, FLEX, APDF.
SQL Server, MySQL, DB2, FOCUS.
August 18, 2011, 10:23 AM
Clif
If you just want to RUN the SQL Stored procedures, you can do so by copying them to DataMigrator Stored Procedure (focexec) and prefacing them with SQL SQLMSS and following them with ; END.

I'm sorry, there is no automatic translation from SQL stored procedures, SSIS packages, etc. into DataMigrator flows.


N/A
August 18, 2011, 11:55 AM
AK
quote:
Originally posted by Clif:
On the other hand, if a database stored procedure returns a single value as a result, like a scalar function, you can call it in a source or target transformation.


Clif, can you elaborate on how we can call a database stored procedure in a source or target transformation? Is it using the DBLOOKUP function?

Thanks.


iSM 616
iDM 7705
iDQC 802
WF 77
Windows 2008 Server
August 18, 2011, 03:51 PM
ferran
Thanks for your replies, Clif. I guess I would try to translate the SQL Stored Procedures code into DataMigrator flows.

If finally I can't do it, then I would try to copying them into focexec as you suggested.

Regards.


WF 7.7.03,Win XP Pro.
HTML, PDF, EXCEL, AHTML, FLEX, APDF.
SQL Server, MySQL, DB2, FOCUS.
August 19, 2011, 10:15 AM
Clif
AK: You could use DB_LOOKUP but there is an easier way introduced in 7.7.03 for source transformations. In any event the source must be a table in the database and the stored procedure must returns a SINGLE result like a SCALAR function.

You call it like SQL.functionname(parameters....)

It's not a DataMigrator specific feature, you can find documentation for it here:

SQL.Function Syntax for Direct DBMS Function Calls


N/A
September 26, 2012, 06:34 AM
janaki_senthil
Cliff,
I am trying to execute ms sql server 2008 stored procedure from iway data management console.But it not working.It is giving me a sql prepare error?

I need to execute the sql stored procedures in iway data migrator urgently.
Can you help?
September 27, 2012, 03:22 PM
Clif
What are you trying to accomplish?

There are several ways to run a database stored procedure.

(1) you can create a DataMigrator stored procedure, for example:

ENGINE SQLMSS ex sp_help
END

(2) you can create a synonym for a database stored procedure, providing sample parameters. then use it as a source in a data flow and pass parameters with a WHERE condition or a JOIN.

This is documented in the DMUG, albeit using an ORACLE example.


N/A