Use kettle to read data from MySQL using stored procedures to SQL Server database

Source: Internet
Author: User

1, the MySQL stored procedure, can realize the dynamic table reads, satisfies the more complex business logic

DROP PROCEDURE if existsP_get_car_trace;delimiter//CREATE PROCEDUREp_get_car_trace ()beginDeclareVar_sqlvarchar( -);DeclareVar_tabe_namevarchar( -);SetVar_tabe_name= 'geom1';SetVar_sql=Concat_ws (' ','Select Id,astext (GEO) Geo from', var_tabe_name);Set @sql =Var_sql;PREPARES1 from @sql; EXECUTES1;deallocate PrepareS1;End //delimiter;

2, SQL Server stored procedures, using the steps of the execution of SQL statements, implementation of data line by row calls

Create proc p_ins_test (@idint,@geonvarchar(max))  as begin Insert  into t_test (Id,geo) Values (@id,@geo); End

3, extraction process flow chart:

Table Input:

Executes the SQL statement step, passing the value of the previous step with a parameter

Use kettle to read data from MySQL using stored procedures to SQL Server database

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.