Dynamic | data
Here's how to build the pipe syntax based on the data in the middle tier:
1. First set up a Data window object: D_vdtcolumns
The SQL syntax is:
SELECT Vdt_columns.utid,
Vdt_columns.uid,
Vdt_columns.upkey,
Vdt_columns.udmid,
Vdt_columns.udmname,
Vdt_columns.unulls,
Vdt_columns.uwidth,
Vdt_columns.uscale,
Vdt_columns.uname,
Vdt_columns.udefault,
Vdt_columns.ucheck,
Vdt_columns.utname,
Vdt_columns.uidentity
From Vdt_columns
WHERE Utname =: as_tname
2. Ready to work, the following is the main battlefield, start building data pipelines.
Considering that a pipe object can transfer multiple tasks, establish an object Nvo_pipetransattrib save the syntax for the transport required:
It contains a instance variable:
String is_objectname//table name
String Is_syntax//pipe syntax
String is_sconnect= ' ZW ', is_dconnect= ' daixf '/source database connection and destination database connection
String is_ptype,is_pcommit,is_errors//pipe several properties
String Is_sname,is_dname//source table name, destination table name
String is_sqlsyntax//pipe SQL syntax
Creates an object that inherits from the data pipeline object.
Start construction Syntax: Write a function.
Nvo_pipetransattrib inv_attrib[]
String Ls_syntax,ls_sourcesyntax,ls_destsyntax
int li,lj,li_ind,li_find,li_rows,li_identity
String Ls_tablename,ls_default,ls_defaultvalue,ls_pbdttype
Boolean Lb_find
Dec Ld_uwidth,ld_prec,ld_uscale
String ls_types,ls_dbtype,ls_prikey,ls_name,ls_nulls,ls_msg,ls_title= ' Of_constrpipesyntax () '
Nvo_string lnv_string
Nvo_datastore Lds_vdtcolumns
Boolean Lb_key
Is the initialization, Inv_attrib function, the initialization of the data is mainly the user needs to enter the conditions, such as the pipe Type,commit,errors,select statement.
You need to explain the functions that deal with a few special cases.
Of_filterimg (lds_vdtcolumns):
Filters out image columns in the table because the pipe does not support image data transfer.
Of_getpipedbtype (is_s_dbtype,ls_types):
The types of data columns in the pipeline are based on the types of columns in the table, because they are not always corresponding.
This can be done through a extend datawindowobject and contains the initial data.
Of_getpbdttype (is_s_dbtype,ls_types):
The types of columns in the pipeline are based on the types of columns in the table, because they are not always corresponding.
This can be done through a extend datawindowobject and contains the initial data.
When the pipe syntax is built, you can perform a pipeline transfer:
If LI_RC <> 1 Then
If not ib_silence then msg (ls_title, "Object Transfer failed:" + string (LI_RC))
Of_addtransmsg (' Object < ' +is_currentobj+ ' > Transmission failed: ' + string (LI_RC))
Return LI_RC
Rollback;
Else
Commit;
End If
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.