135864509-JDBC-Adapter-in-SAP-PI.pdf

May 12, 2018 | Author: roberto.faccini64 | Category: Databases, Database Transaction, Sql, Data Management Software, Parameter (Computer Programming)


Comments



Description

Configuring the JDBC AdapterUse The JDBC (Java Database Connectivity) adapter enables you to connect database systems to the Integration Server or the PCK The adapter converts database content to !"# messages and the other $ay around %ou can read database content $ith any S&# statement' even stored procedures %ou de(ine a special !"# (ormat (or content (rom the Integration Server or the PCK This (ormat enables S&# I)S*+T' ,PD-T*' S*#*CT' D*#*T*' or stored procedure statements to be processed - message is al$ays processed in e.actly one database transaction /or /-&s about the JDBC adapter' see S-P )ote 012234 Prerequisites 5 To be able to use the JDBC adapter' you must have installed the JDBC driver (or the database to $hich you $ant to connect The re6uired Java libraries are product7speci(ic and must be obtained (rom the database vendor 5 Deploy the Java libraries in -S Java (ollo$ing installation so that the JDBC adapter can (ind the re6uired Java classes at runtime /or more in(ormation' see the chapter Providing *.ternal Drivers (or the JDBC and J"S -dapters (in the S-P )et8eaver #ibrary /unction79riented :ie$ under Process Integration ; Con(iguring Process Integration (PI) -(ter Installation ; Integration o( Business Systems $ithout Integration *ngine ; Integration ,sing the -dvanced -dapter *ngine) Procedure 2 Create a Communication Channel in the Integration Directory 4 To con(igure the adapter' select the Parameters tab page 1 Select JDBC as the -dapter Type < Speci(y the Direction (Sender=+eceiver) o( the adapter Con(iguring the Sender JDBC -dapter Con(iguring the +eceiver JDBC -dapter Configuring the Sender JDBC Adapter Use %ou con(igure the sender JDBC adapter to be able to send content (rom databases to the Integration Server or to the PCK Prerequisites 5 There must be e.actly one sender agreement (or the de(ined communication channel 5 %ou must add an indicator that speci(ies the processing status o( each data record in the adapter (processed=not processed) to the database table 5 The ,PD-T* statement must alter e.actly those data records that have been selected by the S*#*CT statement %ou must use the same 8>*+* clause in the ,PD-T* and the S*#*CT statements See belo$ under De(ining Processing Parameters' S&# Statement (or &uery' and S&# Statement (or ,pdate The e.ample sho$s the correct speci(ication o( the S*#*CT and ,PD-T* statement? S&# statement (or 6uery? S*#*CT @ /+9" table 8>*+* processed A BC S&# statement (or update? ,PD-T* table S*T processed A 2 8>*+* processed A BC processed is the indicator in the database 5 Processing can only be per(ormed correctly $hen the Transaction Isolation #evel is set to repeatableDread or serialiEable Procedure 2 The Transport Protocol is JBDC 4B 4 The "essage Protocol is JDBC -dditional values may be added (or the message protocol in (uture versions 1 Select the -dapter *ngine on the Integration Server' or select a noncentrally installed -dapter *ngine This selection is not available in the PCK Defining the Database Connection < Select the Connection tab page F ,nder JDBC Driver' enter the Java class o( the JDBC driver The JDBC adapter must load the class to be able to access the driver 3 ,nder Connection' speci(y the address $ith $hich you can open a database connection using the JDBC driver G ,nder ,ser )ame and Pass$ord' enter the logon data (or the database to be read The entries (or JDBC Driver and Connection depend on the JDBC driver %ou $ill (ind this in(ormation in the documentation (rom the provider Defining Processing Parameters 0 Select the Processing tab page H ,nder &uality o( Service' speci(y ho$ a message is to be processed by the Integration *ngine=PCK /or &uality o( Service *.actly 9nce In 9rder' enter the &ueue )ame See? &uality o( Service 2B Speci(y the (ollo$ing (or the poll interval? I Poll Interval (secs)? )umber o( seconds that the adapter must $ait i( no (iles are (ound (or processing I Poll Interval (msecs)? )umber o( milliseconds that the adapter must $ait i( no (iles are (ound (or processing I( you set Poll Interval (secs) to null' processing times are short and close to real time I( you set Poll Interval (secs) and Poll Interval (msecs) to null' the adapter is called once I +etry Interval (secs)? )umber o( seconds that the adapter is to $ait be(ore an S&# statement processed $ith errors is processed again I( you set the value to null' the adapter is canceled i( an error occurs' even i( a value greater than null is speci(ied (or Poll Interval (secs) I( you do not enter a value' the value (rom Poll Interval (secs) is used 22 The speci(ication (or &uery S&# Statement must correspond to the S&# variant supported by the respective JDBC driver It can also contain table J9I)s I *nter a valid S&# statement that is to be applied to the database once the data (determined (rom the &uery S&# Statement) has been success(ully sent to the Integration Server=PCK It must be an I)S*+T' ,PD-T*' or D*#*T* statement I Speci(y an S&# *!*C,T* statement to e.ecute a stored procedure' $hich contains e.actly one S*#*CT statement 24 *nter the Document )ame The document name is inserted in the message as the main !"# tag 21 *nter the Document )amespace The namespace is added to the document name 2< *nter the ,pdate S&# Statement I *nter a valid S&# statement that is to be applied to the database once the data (determined (rom the &uery S&# Statement) has been success(ully sent to the Integration Server=PCK The S&# statement must be an I)S*+T' ,PD-T*' or D*#*T* statement I I( you $ant the data determined (rom the &uery S&# Statement to remain in the database unchanged a(ter being sent success(ully' enter JT*STK This is recommended i( the data has not only been read' but also changed by a stored procedure entered under &uery S&# Statement Defining an Operating System Command 2F Speci(y an operating system Command #ine that is to be e.ecuted (ollo$ing success(ul database operations 23 ,nder Timeout (secs)' speci(y the ma.imum runtime o( the e.ecuting program in seconds 8hen this time interval is e.ceeded' the adapter continues processing The e.ecuting program continues to run in the bacLground 2G I( the adapter is to terminate the e.ecuting program in the event o( a timeout' select Terminate Program -(ter Timeout The adapter $rites the output (STD9,T and STD*++) (or the operating system command in the system trace "essage processing is independent o( any errors that occur during the e.ecution o( a con(igured operating system command Defining the Adapter Status 20 Select the -dvanced tab page 2H Set the adapter to -ctive to enable messages to be e.changed Defining Additional Parameters in Advanced ode 4B To speci(y additional parameters (or the adapter con(iguration' select -dvanced "ode 42 To de(ine ho$ transactions running in parallel are to in(luence each other' select the Transaction Isolation #evel %ou can run database transactions at di((erent levels' Lno$n as isolation levels The options correspond to the JDBC constants? I De(ault (de(ault setting o( the respective database) I )one I readDuncommitted ($eaLest setting) I readDcommitted I repeatableDread I serialiEable (strongest setting) 9nly reduce the security level $hen necessary and as (ar as necessary %ou must (ind another $ay to maLe sure that data inconsistencies cannot be generated in the database' usually by preventing parallel access 44 I( the JDBC driver does not support any transactions' deactivate the logical unit o( $orL To do this' choose Database -uto7Commit7*nabled ()o Transaction >andling) The logical unit o( $orL ensures data consistency I( the JDBC driver does not support any transactions' you must (ind another $ay to ensure the consistency o( the data in the database' usually by preventing parallel access Do not set this indicator i( the JDBC driver supports transactions 41 I( you $ant the database connection to be released and reestablished be(ore each Poll Interval' select Disconnect (rom Database -(ter Processing *ach "essage 4< I( you $ant to remove the empty tags (rom the resultset o( the sender adapter' select +emove *mpty Tags This helps to reduce the siEe o( !"# documents I( this indicator is not set' the resultset looLs as (ollo$s? JresultsetK Jro$K Jcolumn7name2Kcolumn7valueJ= column7name2K Jcolumn7name4KJ=column7name4K Jcolumn7name1Kcolumn7valueJ= column7name1K Jcolumn7name<KJ=column7name<K J=ro$K Jro$K Jcolumn7name2Kcolumn7valueJ= column7name2K Jcolumn7name4KJ= column7name4K J=ro$K J=resultsetK I( this indicator is set' the resultset looLs as (ollo$s? JresultsetK Jro$K Jcolumn7name2Kcolumn7valueJ= column7name2K Jcolumn7name1Kcolumn7valueJ= column7name1K J=ro$K Jro$K Jcolumn7name2Kcolumn7valueJ= column7name2K J=ro$K J=resultsetK 4F Speci(y additional Parameter )ames and Parameter :alues in the table Due to messages o( large siEe' it is possible that there could be out o( memory errors' $hich could lead to J** server node (ailures /ollo$ing are the parameters to be set in the table to limit the message siEe? 5 msg!imit ? This parameter is used to enable the ma. message siEe limit (eature (or JDBC adapter 8hen this parameter is set to true' JDBC adapter does not process the message o( siEe higher than the values speci(ied through ma."sgSiEe and ma.+o$SiEe I( msg#imit is set to true then' ma."sgSiEe and ma.+o$SiEe parameters are mandatory 5 ma"sgSi#e ? This parameter is used to limit the message siEe to an optimal value JDBC adapter does not process the message siEe o( more than the value provided (or ma."sgSiEe' i( encountered at runtime The value o( the parameter should be provided in KB "ore in(ormation on con(iguring the ma.imum message siEe? S-P note 24F1043 5 ma"$o%Si#e ? This parameter is used to provide the ma.imum ro$ siEe This parameter is used to calculate the ma.imum number o( ro$s that could be sent through channel in one interval The value o( the parameter should be provided in KB "ore in(ormation on con(iguring the ma.imum ro$ siEe? S-P note 24F1043 5 ma"!imit&rror'nterval ? This parameter is used to provide a special interval to change the ne.t polling interval incase an error occurs $hen a ma.imum message siEe is reached (or the current interval This reduces the load on the system The parameter value should be provided in seconds -dditional parameters are published in S-P )ote 0B213G &"ample The system converts the table resulting (rom the 6uery S&# statement into a valid !"# document and sends it to the Integration *ngine=PCK The document looLs liLe this? JresultsetK Jro$K Jcolumn7name2Kcolumn7valueJ= column7name2K Jcolumn7name4Kcolumn7valueJ= column7name4K Jcolumn7name1Kcolumn7valueJ= column7name1K J=ro$K Jro$K Jcolumn7name2Kcolumn7valueJ= column7name2K Jcolumn7name4Kcolumn7valueJ= column7name4K Jcolumn7name1Kcolumn7valueJ= column7name1K J=ro$K J=resultsetK (uality of Service The sender o( a message uses the attribute Quality of Service (&oS) to determine ho$ a message is delivered The (ollo$ing types o( 6uality o( service are supported? • B* (Best *((ort) The message is sent synchronously The sender $aits (or a response be(ore it continues processing • *9 (*.actly 9nce) The message is sent asynchronously The sender does not $ait (or a response The -dvanced -dapter *ngine guarantees that the message is sent and processed e.actly once • *9I9 (*.actly 9nce In 9rder) "essages are delivered $ith the same 6ueue names (supplied by the application) in the same se6uence that they $ere sent (rom the sender system "essage processing is asynchronous in this case In the case o( 6uality o( service B* an error occurs i( more than one receiver is determined (or a message In the case o( delivery types *9 and *9I9' the message is copied correspondingly and sent to the individual receivers Configuring the $eceiver JDBC Adapter %ou con(igure the receiver JDBC adapter to convert !"# messages (rom the Integration Server or the PCK into database table content Procedure 2 The Transport Protocol is JBDC 2.0 4 Select the Message Protocol o I( you $ant to insert' change' or delete table values in one or more tables' select XML SQL Format %ou can call stored procedures in the database by using trans(er parameters In the case o( synchronous 6ueries' results (rom database 6ueries or return values o( stored procedures can also be trans(erred o I( you $ant to speci(y a S&# statement o( your choice in the message payload' to be trans(erred unchanged to the database (or processing' select Native SQL String Depending on the message protocol' the adapter e.pects special !"# document (ormats in the payload o( the !I message "ore in(ormation? De(ining !"# Documents (or "essage Protocol !"# S&# /ormat De(ining !"# Documents (or "essage Protocol )ative S&# /ormat 1 Choose the Adapter Engine on the Integration Server' or choose a noncentrally installed -dapter *ngine This selection is not available in the PCK 1. Defining the Database Connection 2 Select the Connection tab page 4 ,nder JDBC Driver' enter the Java class o( the JDBC driver The JDBC adapter must load the class to be able to access the driver 1 ,nder Connection' speci(y the address $ith $hich you can open a database connection using the JDBC driver < ,nder User Nae and Pass!ord' enter the logon data (or the database to be read The entries (or JDBC Driver and Connection depend on the JDBC driver %ou can (ind this in(ormation in the documentation (rom the respective provider 2. Defining Processing Parameters 2 Select the Processing tab page 4 ,nder Ma"iu Concurrency' enter the number o( messages to be processed in parallel by the receiver channel /or e.ample' i( you enter the value #' then t$o messages are processed in parallel De(ault value is $ and this means only one message can be processed at a time by the receiver channel 3. Defining XML Schema Interpreter for Message Protocol XML SQL Format 2 To maLe conditions mandatory in the Ley tag o( the !"# document' select %ey Tags Mandatory 4 Select ho$ empty te.t (ields are to be handled under &nterpretation of Epty String 'alues o NULL Value In the case o( I)S*+T and ,PD-T* statements' empty (ields are handled liLe ),## (ields (do not e.ist) and are not inserted in the database o Empt String In the case o( I)S*+T and ,PD-T* statements' empty te.ts are inserted in the columns . Defining !"actl#$%nce &an'ling 2 Speci(y $here Persistence (or *.actly 9nce is to taLe place o Lo!al "essages o( type E"actly (nce are handled by status in(ormation management (or these messages in -S Java -ll error statuses o( the adapter' even program terminations initialiEed e.ternally' are handled correctly I( an e.ternal program termination occurs during a database commit' the status o( message processing is unclear initially' because the status o( the message is not changed until the database commit is complete This situation is identi(ied $hen the application is restarted Speci(y ho$ terminated message processing is to be handled under Conflict )esolution This entry is only applied $hen handling errors that occur $hen a message is being processed (or a second time a(ter initial processing remained in the unclear status described above  Error I( an error occurs $hen processing again' this is reported as an error to the caller system  "e#o This setting enables editing (or the receiver adapter to be completed success(ully i( the error occurs' because the message $as saved in the database $hen it $as (irst processed and it is still located there The database inter(ace then triggers the error #upli!ate in$ert i( at least one table (ield is de(ined as a primary Ley 8ithout this setting' the adapter continues to resend the message and the error continues to occur o Data%a$e I( no (ield is designated as a primary Ley in the database table' or i( the data has already been processed by another application and then deleted' $hen the (irst attempt at message processing is interrupted by an irregular termination o( -S Java immediately a(ter the database commit' a message can be duplicated This problem can only be solved i( message processing and status in(ormation management taLe place in the same database so that the processing steps have the same commit cycle In the database $here the $rite7to tables are located you must create an additional table $ith t$o columns (or this purpose To de(ine the table' speci(y the (ollo$ing?  Data%a$e &a%le Name *nter the name o( the table  'e Column Name *nter the name o( the column in $hich the Ley is entered  Value Column Name *nter the name o( the column in $hich the Ley value is entered (. Defining SQL S#nta" Parameters 2 *nter the Escape Sy*ol for Apostrop+e The apostrophe character (M) is a reserved character in S&# synta. and is replaced by an escape character i( it occurs $ithin value strings These replacement characters can be database7speci(ic Typical replacement characters are N or MM (de(ault value) I( a character occurs that is invalid (or the database being used' the adapter triggers an error message (an S&# e.ception) (or the S&# synta. that is generated by the database 4 *nter the Colun Nae Deliiter Depending on the database being used' column names can be enclosed by a special delimiter character' (or e.ample' i( names can contain special characters (such as O) I( you use a character that is invalid (or the database being used' the adapter triggers an error message (an S&# e.ception) (or the S&# synta. that is generated by the database ). Defining an %perating S#stem Comman' 2 Speci(y an operating system Coand ,ine that is to be e.ecuted (ollo$ing success(ul database operations 4 ,nder Tieout -secs.' speci(y the ma.imum runtime o( the e.ecuting program in seconds 8hen this time interval is e.ceeded' the adapter continues processing The e.ecuting program continues to run in the bacLground 1 I( the adapter is to terminate the e.ecuting program in the event o( a timeout' select Terinate Progra After Tieout The adapter $rites the output (STD9,T and STD*++) (or the operating system command in the system trace "essage processing is independent o( any errors that occur during the e.ecution o( a con(igured operating system command *. Defining the +'apter Stat,s 2 Select the Advanced tab page 4 Set the adapter to (!tive to enable messages to be e.changed -. Defining Parameters in +'.ance' Mo'e 2 To speci(y additional parameters' select Advanced Mode 4 ,nder Nu*er of )etries of Data*ase Transaction on SQ, Error' speci(y ho$ o(ten the system is to attempt to reestablish the database connection and access the database in the event o( an S&# e.ception I( the number o( retries is e.ceeded' the last status is reported to the sender Integration Server or the sender PCK I( an error occurs' the message is only processed again $hen the Integration Server=PCK sends it again 1 To de(ine ho$ transactions running in parallel are able to in(luence each other' choose Transaction &solation ,evel There are di((erent levels o( database transactions Lno$n as isolation levels The options correspond to the JDBC constants? o De)ault (de(ault setting o( the respective database) o None o rea#*un!ommitte# ($eaLest setting) o rea#*!ommitte# o repeata%le*rea# o $eriali+a%le (strongest setting) Caution 9nly reduce the isolation level $hen necessary and as (ar as necessary /ind another $ay to maLe sure that data inconsistencies cannot be generated in the database' usually by preventing parallel access < I( the JDBC driver does not support any transactions' deactivate the logical unit o( $orL To do this' choose Data*ase Auto/Coit/Ena*led -No Transaction 0andling. The logical unit o( $orL ensures data consistency I( the JDBC driver does not support any transactions' you must (ind another $ay to ensure the consistency o( the data in the database' usually by preventing parallel access Caution Do not set this indicator i( the JDBC driver supports transactions F I( you $ant the database connection to be released and reestablished be(ore each Poll &nterval' select Disconnect fro Data*ase After Processing Eac+ Message 3 I( you $ant to collect S&# statements in a batch' select Batc+ Mode This can improve per(ormance considerably It may be the case that not every available JDBC driver is able to run batch processing Batch processing is not supported (or the (ollo$ing statements? o S*#*CT o ,PD-T*DI)S*+T o *!*C,T* o S&#D&,*+% G Speci(y additional Paraeter Naes and Paraeter 'alues in the table )ote -dditional parameters are published in S-P )ote ,0-./0 0 Speci(y the Date1Tie 2orats for Stored/Procedure Calls The string (ormat corresponds to the Java class 1ava.te2t.SimpleDateFormat ,etter Date or Tie Coponent Type E"aples P *poch name Te.t P A -D y %ear %ear yyyy A 2HH3C yy A H3 " "onth in year "onth """" A July' """ A Jul' "" A BG $ 8eeL in year )umber 4G 8 8eeL in month )umber 4 D Day in year )umber 203 d Day in month )umber 2B / Day o( $eeL in month )umber 4 * Day in $eeL Te.t TuesdayC Tue a am=pm marLer Te.t P" > >our in day (B741) )umber B L >our in day (274<) )umber 4< K >our in am=pm (B722) )umber B h >our in am=pm (2724) )umber 24 m "inute in hour )umber 1B s Second in minute )umber FF S "illisecond )umber HG0 E Time Eone Peneral time Eone Paci(ic Standard TimeC PSTC P"T7B0?BB Q Time Eone +/C 044 time Eone 7B0BB *.ample dd""yyyy corresponds to 2BBG4BBF' (or e.ample hhmm corresponds to BH24' (or e.ample K?mm a corresponds to B?1B P"' (or e.ample Defining )! Documents for essage Protocol )! S(! *ormat Use /o, can mo'if# one or more 'atabase tables b# means of an XI message. Depen'ing on the content of the message pa#loa'0 #o, can insert 1I2S!3450 ,p'ate 16PD+4!50 or 'elete 1D!L!4!5 'ata in 'atabase tables. /o, can also incl,'e res,lts from 7,eries 1S!L!C45 in the response in XML format for s#nchrono,s messages. /o, ,se !X!C64! to e"ec,te store' proce',res an' SQL Q6!3/ to for8ar' more comple" SQL statements to the 'atabase b# ,sing the a'apter. Structure of essage Payload <root> <StatementName1> +db,able-ame action./AC,'O-0 +table0realDb,able-ame+1table0 +access0 <col1>val1</col1> <col2>val2</col2> +1access0 +2ey30 <col2>val2old</col2> <col4>val4</col4> +12ey30 +2ey40 <col2>val2old2</col2> +12ey40 +1db,able-ame0 </StatementName1> JStatement)ame4K 555 555 </StatementName2> ... </root> Procedure 2 De(ine a mapping that converts the payload o( an !I message to the re6uired !"# structure Defining the )! Document Structure 4 De(ine a +root0tag %ou can use a name o( your choice (or the tag 1 ,nder the +root0tag' you can de(ine one or more statements %ou can use names o( your choice (or the tags (or statements *ach statement contains the description o( a database action 8ith the e.ception o( the e.ecution description (or a stored procedure' you use a common structure (or all statements < *nter the name o( the database table in the element under the statement element (db,able-ame) and the attribute action $ith the value UPDA,&' '-S&$,' UPDA,&6'-S&$,' D&!&,&7 S&!&C,7 &)&CU,&' or S(!8(U&$9 F I( you use the optional JtableK element' the speci(ied value is used as the database table name Do not change the name o( the tag +table0 must be the (irst element in the blocL $ithin +db,able-ame0 This enables you' (or e.ample' to de(ine table names that contain non7!"#7compatible characters or characters that cannot be used in inter(ace de(initions in the Integration Builder 3 -t the ne.t level there is (e.cept (or in the D&!&,& action) an element $ith the name access and one or more elements $ith arbitrary names In the above e.ample' these elements are called Ley) I *nter the access element (irst and de(ine the table columns that are to be accessed Do not change the name o( the tag I ,se the J2ey0 elements to describe the condition (or accessing the table columns G De(ine one or more statements (or editing database tables? I De(ining an ,PD-T* Statement I De(ining an I)S*+T Statement I De(ining an ,PD-T*DI)S*+T Statement I De(ining a D*#*T* Statement I De(ining a S*#*CT Statement I De(ining an *!*C,T* Statement I De(ining an S&#D&,*+% Statement Defining Attributes in the +2ey0&lements 0 %ou have the option o( setting the (ollo$ing attributes in the JLeyK elements? I compare9perationA JcompareTypeK %ou use this attribute to set the logical compare operation (or the respective element The (ollo$ing values are permitted? • ■ !Q9 !7,al 1'efa,lt .al,e5 • ■ 2!Q9 2ot e7,al • ■ L49 Less than • ■ L4!Q9 Less than or e7,al to • ■ :49 :reater than • ■ :4!Q9 :reater than or e7,al to • ■ LI;!9 Li<eness 1of strings5. In the correspon'ing .al,e0 the SQL placehol'ers =>? or =@? can then also be ,se'. >ere is an e.ample o( ho$ you can use the parameters? JLey2K Jcol4 compare9perationAR)*&RKval4oldJ=col4K Jcol< compare9perationAR#IK*RKvalSJ=col<K J=Ley2K T S*#*CT col2'col4'col1 /+9" dbTable)ame 8>*+* ((col4JKUval4oldU -)D col< #IK* UvalSU) 9+ (col4AUval4old4U)) T I has&uotA %*SV)9 During construction o( the 8>*+* condition o( the S&# statement' the table column type determines $hether the de(ault is to set the values in 6uotation marLs (te.t column types) or not (numerical column types) In a (e$ cases ((or e.ample' $hen using (unctions)' you may have to override this • ■ 4o al8a#s set 7,otation mar<s0 set /!S. • ■ 4o ne.er set 7,otation mar<s ro,n' .al,es 8ith this attrib,te in the SQL s#nta"0 set 2%. I is)ullA T+,* :alues $ith this attribute are ignored during construction o( the 8>*+* condition This attribute has the same e((ect as i( the respective value did not e.ist $esult 3esponse 'oc,ments can onl# be e.al,ate' b# the Integration Ser.erAPC; if the call is s#nchrono,s beca,se the content of the response 'oc,ment is not accessible if the call is as#nchrono,s. 4he response is p,t in a separate element BStatementName_responseC for each statement element. 4he str,ct,re of the response 'oc,ments is containe' in the 'escriptions of the statements. Defining )! Documents for essage Protocol -ative S(! *ormat Use 4his protocol is primaril# for test p,rposes. Instea' of an XML 'oc,ment format0 a te"t is e"pecte' that represents an# .ali' SQL statement. Procedure For e"ample0 to a'' a ro8 to a table0 enter the follo8ing9 D I2S!34 I24% table2ame 1col,mn$name10 col,mn$name20 col,mn$name35 E+L6!S1Fcol,mn$ .al,e1G0 Fcol,mn$.al,e2G0 Fcol,mn$.al,e3G5 Defining an UPDA,& Statement Use /o, ,se an 6PD+4! statement to change e"isting table .al,es. 4he statement correspon's to an SQL 6PD+4! statement. *ormat of UPDA,& Statement BStatement2ameC B'b4able2ame actionH?6PD+4!?C BtableCrealDb4able2ameBAtableC BaccessC Bcol1C.al1BAcol1C Bcol2C.al2ne8BAcol2C BAaccessC B<e#1C Bcol2C.al2ol'BAcol2C BcolC.alBAcolC BA<e#1C B<e#2C Bcol2C.al2ol'2BAcol2C BA<e#2C BA'b4able2ameC BAStatement2ameC Procedure 2 *nter the ne$ column values in the JaccessK element *nter e.actly one JaccessK element 4 In the JLeyK element' enter the condition that can (ind the data records $hose column values are to be changed I %ou can use any number o( JLeyK elements to (ormulate your condition I Column values $ithin a JLeyK element are combined $ith a logical -)DC di((erent JLeyK elements are combined $ith a logical 9+ I I( you do not de(ine the +2ey0element' or i( you de(ine an empty +2ey0 element' this means that no condition is speci(ied and that the entire table is to be changed I( you $ant to ensure this does not happen' select Key Tags "andatory in the adapter con(iguration I I( you have not (ormulated a condition in the JLeyK elements' but have selected Key Tags "andatory' this results in an error in message processing $ith a corresponding error output $esult 4he correspon'ing SQL statement in the XML str,ct,re abo.e is as follo8s9 T ,PD-T* dbTable)ame S*T col2AUval2U' col4AUval4ne$U 8>*+* ((col4AUval4oldU -)D col<AUval<U) 9+ (col4AUval4old4U)) T 4he col,mn t#pe S43I2: is ,se' for all col,mns. 4he character = ma# be missing in other col,mn t#pes. 4he response 'oc,ment contains the follo8ing element as 8ell as the n,mber of ,p'ate' table ro8s0 incl,'ing I. B,p'ate@co,ntCco,ntBA,p'ate@co,ntC Defining an '-S&$, Statement Use /o, ,se an I2S!34 statement to a'' table .al,es. 4he statement correspon's to an SQL I2S!34 statement. *ormat of '-S&$, Statement BStatement2ameC B'b4able2ame actionH?I2S!34?C BtableCrealDb4able2ameBAtableC BaccessC Bcol1C.al1BAcol1C Bcol2C.al2BAcol2C BAaccessC BaccessC Bcol1C.al11BAcol1C BAaccessC BA'b4able2ameC BAStatement2ameC Procedure 2 *nter the ne$ column values in the JaccessK blocL The statement must have at least one JaccessK element 4 Do not enter a JLeyK element $esult 4he correspon'ing SQL statement in the XML str,ct,re abo.e is as follo8s9 = I2S!34 I24% 'b4able2ame 1col10 col25 E+L6!S1F.al1G0 F.al2G5 I2S!34 I24% 'b4able2ame 1col15 E+L6!S1F.al11G5 = 4he response 'oc,ment contains the follo8ing element as 8ell as the n,mber of inserte' table ro8s0 incl,'ing I. Binsert@co,ntCco,ntBAinsert@co,ntC Defining a D&!&,& Statement Use /o, ,se this statement to 'elete table .al,es. *ormat of D&!&,& Statement BStatement2ameC B'b4able2ame actionH?D!L!4!?C B<e#1C Bcol2C.al2ol'BAcol2C BcolC.alBAcolC BA<e#1C B<e#2C Bcol2C.al2ol'2BAcol2C BA<e#2C BA'b4able2ameC BAStatement2ame3C Procedure 2 *nter the condition under $hich the table values are to be deleted in one or more JLeyK elements Column values $ithin a JLeyK element are combined $ith a logical -)DC di((erent JLeyK elements are combined $ith a logical 9+ 4 I( you do not enter a JLeyK element' or i( you enter an empty JLeyK element' no condition is speci(ied The entire table is deleted I( you $ant to ensure this does not happen' select Key Tags "andatory in the adapter con(iguration I( you have not (ormulated a condition in the JLeyK elements' but have selected Key Tags "andatory' this results in an error in message processing $ith a corresponding error output $esult 4he correspon'ing SQL statement for the XML str,ct,re abo.e is as follo8s9 = D!L!4! F3%M 'b4able2ame J&!3! 11col2HG.al2ol'G +2D colHG.alG5 %3 1col2HG.al2ol'2G55 = 4he response 'oc,ment contains one element9 B'elete@co,ntCco,ntBA'elete@co,ntC Defining an UPDA,&6'-S&$, Statement Use /o, ,se an 6PD+4!@I2S!34 statement to change an' a'' table .al,es. *ormat of UPDA,&6'-S&$, Statement BStatement2ameC B'b4able2ame actionH?6PD+4!@I2S!34?C BtableCrealDb4able2ameBAtableC BaccessC Bcol1C.al1BAcol1C Bcol2C.al2ne8BAcol2C BAaccessC B<e#1C Bcol2C.al2ol'BAcol2C BcolC.alBAcolC BA<e#1C B<e#2C Bcol2C.al2ol'2BAcol2C BA<e#2C BA'b4able2ameC BAStatement2ameC Procedure 2 *nter the ne$ column values in the JaccessK element *nter e.actly one JaccessKelement 4 In the JLeyK element' enter the condition that can (ind the data records $hose column values are to be changed I %ou can use any number o( JLeyK elements to (ormulate your condition I Column values $ithin a JLeyK element are combined $ith a logical -)DC di((erent JLeyK elements are combined $ith a logical 9+ I I( you do not de(ine the +2ey0element' or i( you de(ine an empty +2ey0 element' this means that no condition is speci(ied and that the entire table is to be changed I( you $ant to ensure this does not happen' select Key Tags "andatory in the adapter con(iguration I( you have not (ormulated a condition in the JLeyK elements' but have selected Key Tags "andatory' this results in an error in message processing $ith a corresponding error output I( no change can be made to the database table in this action (the (ormulated condition does not apply to any table entry)' the values described in the JaccessK element are added to the table in accordance $ith the description (or the I)S*+T statement JLeyK elements are ignored in this case See? De(ining an I)S*+T Statement $esult 4he response 'oc,ment has the follo8ing format0 8here one of the t8o .al,es is I beca,se either an 6PD+4! or an I2S!34 action is al8a#s e"ec,te'9 B,p'ate@co,ntCco,ntBA,p'ate@co,ntC Binsert@co,ntCco,ntBAinsert@co,ntC Defining a S&!&C, Statement Use /o, ,se this statement to select table .al,es. 4he statement correspon's to an SQL S!L!C4 statement. *ormat of S&!&C, Statement BStatement2ameC B'b4able2ame actionH?S!L!C4?C BtableCrealDb4able2ameBAtableC BaccessC Bcol1AC Bcol2AC Bcol3AC BAaccessC B<e#1C Bcol2C.al2ol'BAcol2C BcolC.alBAcolC BA<e#1C B<e#2C Bcol2C.al2ol'2BAcol2C BA<e#2C BA'b4able2ameC BAStatement2ameC Procedure 2 *nter the column names to be selected in the JaccessK blocL - statement $ith the action S*#*CT must have e.actly one +access0 element 4 In a JLeyK element' enter the condition that can (ind the data records $hose column values are to be selected %ou can de(ine any number o( JLeyK elements Column values $ithin a JLeyK element are combined $ith a logical -)DC di((erent JLeyK elements are combined $ith a logical 9+ I I( you do not de(ine the +2ey0element' or i( you de(ine an empty +2ey0 element' this means that no condition is speci(ied and that the entire table is to be selected I( you $ant to ensure this does not happen' select Key Tags "andatory in the adapter con(iguration I I( you have not (ormulated a condition in the +2ey0elements' but have selected Key Tags "andatory' this results in an error in message processing $ith a corresponding error output $esult 4he correspon'ing SQL statement for the XML str,ct,re abo.e is as follo8s9 = S!L!C4 col10col20col3 F3%M 'b4able2ame J&!3! 11col2HG.al2ol'G +2D colHG.alG5 %3 1col2HG.al2ol'2G55 = 4he response 'oc,ment contains the res,lt of the action in XML format as follo8s9 = Bro8C Bcol,mn1C.al,e11BAcol,mn1C Bcol,mn2C.al,e12BAcol,mn2C ... BAro8C ... Bro8C Bcol,mn1C.al,e21BAcol,mn1C Bcol,mn2C.al,e22BAcol,mn2C ... BAro8C = Defining an &)&CU,& Statement Use /o, ,se this statement to e"ec,te a store' proce',re. *ormat of &)&CU,& Statement BStatement2ameC Bstore'Proce',re2ame actionH? !X!C64!?C BtableCrealStore'Proce',ree2ameBAtableC Bparam1 KisInp,tH?tr,e?L Kis%,tp,tHtr,eL t#peHSQLDatat#peC.al1BAparam1C BAstore'Proce',re2ame C BAStatement2ameC Procedure 2 *nter the name o( the stored procedure in the database be(ore the action 4 I( you use the optional JtableK element' the value speci(ied here is used as the stored procedure name This enables you' (or e.ample' to de(ine stored procedure names that contain non7!"#7compatible characters or characters that stop them (rom being used in inter(ace de(initions in the Integration Builder I *nter JtableK as the (irst element o( the blocL $ithin JdbTable)ameK 1 Speci(y the parameters (or the stored procedure I %ou have the option o( speci(ying the attribute isInputAT2T(input parameter) or is9utputAT2T (output parameter) (or the parameters I( both attributes are missing' the element is interpreted as an input parameter The parameter names must be identical to those o( the stored procedure de(inition I %ou must speci(y the attribute typeAJS&#DatatypeK (or all parameter types (I)' 9,T) It describes the valid S&# data type The (ollo$ing S&# data types are supported? I)T*P*+' BIT' TI)%I)T' S"-##I)T' BIPI)T' /#9-T' +*-#' D9,B#*' ),"*+IC' D*CI"-#' C>-+' :-+C>-+' ST+I)P' #9)P:-+C>-+' D-T*' TI"*' TI"*ST-"P' BI)-+%' :-+BI)-+%' #9)P:-+BI)-+%' B#9B (input and output)' C#9B (input and output)' C,+S9+ (outputC only in connection $ith the 9racle JDBC driver) The binary data (or B#9B is he.adecimal encoded $esult +ll ret,rn .al,es are ret,rne' in an XML str,ct,re. 4he res,lts 8ithin the store' proce',re are ret,rne' either as a table or as the element B,p'ate@co,ntC. 4his 'epen's on the SQL statements e"ec,te' 8ithin the store' proce',re. 4he ret,rn parameters of a store' proce',re are appen'e' in a separate str,ct,re. Defining an S(!6(U&$9 Statement Use /o, ,se this statement to transfer comple" SQL statements 'irectl# to the 'atabase b# ,sing the a'apter. /o, ha.e the option of ,sing placehol'ers in these SQL statements0 8hich can be liste' in the <e#bloc<. 4his enables #o, to generate comple"0 parameterisable SQL statements. *ormat of S(!6(U&$9 Statement BrootC BStatement2ameC Ban#2ame actionH? SQL@Q6!3/? M =SQL@DML?C BaccessCSQL$String 8ith optional placehol'er1s5BAaccessC B<e#C Bplacehol'er1C.al,e1BAplacehol'er1C Bplacehol'er2C.al,e2Bplacehol'er2C BA<e#C BAan#2ame C BAStatement2ameC BArootC Procedure 2 Speci(y a name o( your choice (or the structure ,nliLe in the usual statement types' no table name or stored procedure name is e.pected in the de(ault setting 4 I( the S&# statement represents a 6uery to the database (S*#*CT)' choose actionAS&#D&,*+% I( it represents a call (rom the S&# Data "anipulation #anguage (,PD-T*' I)S*+T' D*#*T*)' choose actionAS&#DD"# 1 %ou must enter the JaccessK element (irst The content o( JaccessK represents a valid S&# call (or the respective mode' $ith the option o( placeholders I I( you use placeholders' list them $ithin the JLeyK element The names o( the placeholder elements must be identical to those used in the S&# string ($here they still have the W character) I In the !"# structure above' the strings Wplaceholder2W and Wplaceholder4W contained in the S&# string are replaced $ith value2 or value4 be(ore the S&# statement is e.ecuted I I( you do not use placeholders' you can omit the JLeyK element or set it as empty In both cases' you must not select the %ey Tags Mandatory (ield in the con(iguration' as this $ill cause runtime errors ,sing placeholders is not restricted to individual (ield values %ou can set any parts o( the S&# statement in this $ay %ou can also in(luence the logic o( the statement Surplus and unde(ined placeholders are tolerated in the JLeyK element ,nde(ined placeholders are le(t unchanged in the S&# string This can lead to synta. errors or to une.pected results in the database $esult 4he follo8ing e"ample 'oes not contain an# placehol'ers9 BrootC BstmtC BC,stomers actionHNSQL@DMLNC BaccessC 6PD+4! C,stomers S!4 Compan#2ameHOFirmaO0 +''ressHOStrasse 3O J&!3! C,stomerIDHOFIO BAaccessC BAC,stomersC BAstmtC BArootC 4he ,nchange' SQL statement is e"ec,te' in the 'atabase9 6PD+4! C,stomers S!4 Compan#2ameHOFirmaO0 +''ressHOStrasse 3O J&!3! C,stomerIDHOFIO 4he follo8ing e"ample contains placehol'ers9 BrootC BstmtC BC,stomers actionHNSQL@DMLNC BaccessC 6PD+4! C,stomers S!4 Compan#2ameHGP2+M!PG0 +''ressHGP+DD3!SSPO J&!3! C,stomerIDHOP;!/FI!LDPG BAaccessC B<e#C B2+M!CFirmaBA2+M!C B+DD3!SSCStrasse 3 BA+DD3!SSC B;!/FI!LDCFIBA;!/FI!LDC BA<e#C BAC,stomersC BAstmtC BArootC +fter the placehol'ers ha.e been replace'0 the same SQL statement is e"ec,te' in the 'atabase as abo.e9 6PD+4! C,stomers S!4 Compan#2ameHOFirmaO0 +''ressHOStrasse 3O J&!3! C,stomerIDHOFIO Document Formats for the Receiver D!" #dapter )! Document *ormat for the essage Protocol )! S(! *ormat /o, can mo'if# one or more 'atabase tables b# means of a message. Depen'ing on the content of the message0 #o, can either insert 1I2S!3450 ,p'ate 16PD+4!50 or 'elete 1D!L!4!5 the 'ata. 3es,lts from 7,eries 1S!L!C45 can also be incl,'e' in the response in XML format for s#nchrono,s messages. 4he XML 'oc,ment m,st ha.e the follo8ing schema in this case9 <root> <StatementName1> <dbTableName action=”UPDATE” | “UPDATE_INSERT”> <table>realDbTableName<table> <acce!!> <col1>"al1<col1> <col#>"al#ne$<col#> <acce!!> <%e&1> <col#>"al#old<col#> <col'>"al'<col'> <%e&1> <%e&#> <col#>"al#old#<col#> <%e&#> <dbTableName> <StatementName1> 3StatementName24 <dbTableName action=”INSERT”> <table>realDbTableName<table> <acce!!> <col1>"al1<col1> <col#>"al#<col#> <acce!!> <acce!!> <col1>"al11<col1> <acce!!> <dbTableName> <StatementName#> <StatementName(> <dbTableName action=”DE)ETE”> <%e&1> <col#>"al#old<col#> <col'>"al'<col'> <%e&1> <%e&#> <col#>"al#old#<col#> <%e&#> <dbTableName> <StatementName(> <StatementName'> <dbTableName action=”SE)E*T”> <table>realDbTableName<table> <acce!!> <col1> <col#> <col(> <acce!!> <%e&1> <col#>"al#old<col#> <col'>"al'<col'> <%e&1> <%e&#> <col#>"al#old#<col#> <%e&#> <dbTableName> <StatementName'> <StatementName+> <!toredProced,reName action=” E-E*UTE”> <table>realStoredProced,reeName<table> <.aram1 /i!In.,t=”tr,e”0 /i!1,t.,t=tr,e0 t&.e=S2)Datat&.e>"al1<.aram1> <!toredProced,reName > <StatementName+> <StatementName3> <an&Name action=” S2)_2UER4” | “S2)_D5)”> <acce!!>S2)6Strin7 $it8 o.tional .lace8older9!:<acce!!> <%e&> <.lace8older1>"al,e1<.lace8older1> <.lace8older#>"al,e#<.lace8older#> +12ey0 <an&Name > <StatementName3> <root> Comments Q The document contains a tag $ith the arbitrary name <root> 8ithin this tag there are one or more statement elements that also have arbitrary names *ach o( these statements contains the description o( a database action 8ith the e.ception o( the e.ecute description (or a stored procedure (sho$n in the e.ample under the element <StatementName+>)' all statements have the same structure? R The name o( the element beneath the statement element speci(ies the name o( the database table and contains the attribute action $ith the value INSERT' UPDATE' UPDATE_INSERT' DE)ETE' or SE)E*T I( you use the optional <table> element' the value speci(ied is used as a database table name This enables you' (or e.ample' to de(ine table names containing non7!"#7compatible characters or characters that prevent them (rom being used in inter(ace de(initions in the Integration Builder I( speci(ied' <table> must be the (irst element in the blocL $ithin <dbTableName> R 8ithin this element there is (e.cept (or in the DE)ETE action) an element $ith the name acce!! and one or more elements $ith arbitrary names In the above e.ample' these elements are called %e&N The acce!! element contains the table columns $hich are to be accessed It must be speci(ied as the (irst element The %e& elements describe a condition (or access I( no such elements are speci(ied' access proceeds $ithout any conditions In the case o( UPDATE and DE)ETE' this can lead to the entire table being updated or deleted respectively I( you $ant to ensure this does not happen' select Key Tags "andatory in the adapter con(iguration R The response documents described belo$ can only be evaluated by the Integration Server=PCK i( the call is synchronous because the content o( the response document is not accessible i( the call is asynchronous The response is put in a separate element JStatement-ame6responseK (or each statement element Q actionAUPDA,& Statements $ith this action cause e.isting table values to be updated There(ore' the statement corresponds to an S&# ,PD-T* statement The +access0 blocL contains the ne$ column values and a +2ey0 element contains the columns $hose values must be identical $ith the speci(ied value to get the ne$ column values The name o( the +2ey0 element is arbitrary Column values $ithin a +2ey0 element are combined $ith a logical -)DC di((erent +2ey0 elements are combined $ith a logical 9+ - statement $ith the action UPDA,& must have e.actly one +access0 element The number o( +2ey0 elements $ith arbitrary names is not restricted The corresponding S&# statement (or Statement-ame3 in the e.ample above is as (ollo$s? : UPDA,& db,able-ame S&, col3.;val3;7 col4.;val4ne%; <=&$& >>col4.;val4old; A-D col?.;val?;@ O$ >col4.;val4old4;@@ : -s in the other e.amples' the column type String is used (or all columns The character : may be missing in other column types The response document contains the (ollo$ing element as $ell as the number o( updated table lines' including B +update6count0count+1update6count0 I( there is no +2ey0 element' or i( there is a +2ey0 element but it is empty' then no condition is speci(ied and the entire table is to be updated This may not be permitted by the con(iguration o( the JDBC adapter (or security reasons and $ill there(ore result in an error during message processing and an appropriate error message Q actionA'-S&$, Statements $ith this action cause table values to be inserted There(ore' the statement corresponds to an S&# I)S*+T statement The +access0 blocL contains the ne$ column values - statement $ith the action '-S&$, must have at least one +access0 element It cannot have a +2ey0 element The corresponding S&# statement (or Statement-ame4 in the e.ample above is as (ollo$s? : '-S&$, '-,O db,able-ame >col37 col4@ AA!U&S>Bval3;7 Bval4;@ '-S&$, '-,O db,able-ame >col3@ AA!U&S>Bval33;@ : The response document contains the (ollo$ing element as $ell as the number o( inserted table lines' including B +insert6count0count+1insert6count0 Q actionAUPDA,&6'-S&$, The statement has the same (ormat as (or the UPDA,& action Initially' the same action is e.ecuted as (or UPDA,& I( no update to the database table can be made (or this action (the condition does not apply to any table entry)' values o( the table described in the JaccessK element are inserted in accordance $ith the description o( the action '-S&$, +2ey0 elements are ignored in this case The response document has the (ollo$ing (ormatC one o( the t$o values is al$ays B because either an UPDA,& or an '-S&$, action is al$ays e.ecuted? +update6count0count+1update6count0 +insert6count0count+1insert6count0 Q actionAD&!&,& Statements $ith this action cause e.isting table values to be deleted 9ne or more +2ey0 elements (ormulate the condition (or $hich table values are deleted The names o( +2ey0 elements are arbitrary Column values $ithin a +2ey0 element are combined $ith a logical -)DC di((erent +2ey0 elements are combined $ith a logical 9+ The corresponding S&# statement (or Statement-ameC in the e.ample above is as (ollo$s? : D&!&,& *$O db,able-ame <=&$& >>col4.;val4old; A-D col?.;val?;@ O$ >col4.;val4old4;@@ : The response document contains the (ollo$ing element? +delete6count0count+1delete6count0 I( there is no +2ey0 element' or i( there is a +2ey0 element but it is empty' then no condition is speci(ied and the entire table is to be deleted This may not be permitted by the con(iguration o( the JDBC adapter (or security reasons and $ill there(ore result in an error during message processing and an appropriate error message Q actionAS&!&C, Statements $ith this action cause e.isting table values to be selected There(ore' the statement corresponds to an S&# S*#*CT statement The +access0 blocL contains the column names to be selected' a +2ey0 element contains the columns $hose values must be identical $ith the speci(ied value to get the ne$ column values The name o( the +2ey0 element is arbitrary Column values $ithin a +2ey0 element are combined $ith a logical -)DC di((erent +2ey0 elements are combined $ith a logical 9+ - statement $ith the action S&!&C, must have e.actly one +access0 element The number o( +2ey0 elements $ith arbitrary names is not restricted The corresponding S&# statement (or Statement-ame? in the e.ample above is as (ollo$s? : S&!&C, col37col47colC *$O db,able-ame <=&$& >>col4.;val4old; A-D col?.;val?;@ O$ >col4.;val4old4;@@ : I( there is no +2ey0 element' or i( there is a +2ey0 element but it is empty' then no condition is speci(ied and the entire table is to be selected This may not be permitted by the con(iguration o( the JDBC adapter (or security reasons and $ill there(ore result in an error during message processing and an appropriate error message The response document contains the result o( the action in !"# (ormat as (ollo$s? “ <ro$> <col,mn1>"al,e11<col,mn1> <col,mn#>"al,e1#<col,mn#> ;;; <ro$> ;;; <ro$> <col,mn1>"al,eN1<col,mn1> <col,mn#>"al,eN#<col,mn#> ;;; <ro$> “ Q actionA&)&CU,& Statements $ith this action result in a stored procedure being e.ecuted The name o( the element is interpreted as the name o( the stored procedure in the database I( you use the optional JtableK element' the value speci(ied here is used as the stored procedure name This enables you' (or e.ample' to de(ine stored procedure names containing non7!"#7compatible characters or characters that prevent them (rom being used in inter(ace de(initions in the Integration Builder=PCK I( speci(ied' JtableK must be the (irst element in the blocL $ithin JdbTable)ameK The elements $ithin the stored procedure are interpreted as parameters They can optionally have the attribute isInputAT2T (input parameter) or is9utputAT2T (output parameter) or both (I)9,T parameter) I( both attributes are missing' the element is interpreted as an input parameter The parameter names must be identical to those o( the stored procedure de(inition 4he attrib,te t#peHBSQL$Datat#peC 0 8hich 'escribes the .ali' SQL 'ata t#pe0 is man'ator# for all parameter t#pes 1I20 %640 I2%645. 4he follo8ing SQL 'ata t#pes are s,pporte'9 I24!:!30 SI40 4I2/I240 SM+LLI240 SI:I240 FL%+40 3!+L0 D%6SL!0 26M!3IC0 D!CIM+L0 C&+30 E+3C&+30 S43I2:0 L%2:E+3C&+30 D+4!0 4IM!0 4IM!S4+MP0 SI2+3/0 E+3SI2+3/0 L%2:E+3SI2+3/0 SL%S 1inp,t an' o,tp,t50CL%S 1inp,t an' o,tp,t50 C63S%3 1o,tp,tT onl# in conU,nction 8ith the %racle VDSC 'ri.er5. The binary data (or B#9B is he.adecimal encoded -ll return values are returned in an !"# structure The results $ithin the stored procedure are returned either as a table or as the element +update6count0 This depends on the S&# statements e.ecuted $ithin the stored procedure The return parameters o( a stored procedure are attached in a separate structure Q actionA S&#D&,*+% V S&#DD"# This structure enables you to trans(er more comple. S&# statements to the database directly using the adapter %ou have the option o( using placeholders in these S&# statements' $hich can be listed in the subse6uent LeyblocL This maLes it easy to generate comple.' parameterisable S&# statements Details on the structure? R The name o( the structure is arbitrary ,nliLe in the usual statement types' no table name or stored procedure name is e.pected in the de(ault setting R I( the S&# statement represents a 6uery to the database (S*#*CT)' choose -ctionAS&#D&,*+% R I( it represents a call (rom the S&# Data "anipulation #anguage (,PD-T*' I)S*+T' D*#*T*)' choose -ctionAS&#DD"# R The (irst element in the structure must have the name JaccessK and contain a valid S&# call (or the respective mode' optionally $ith placeholders (see belo$) R I( you use placeholders' these must be listed in the element $ith the name JLeyK The names o( the placeholder elements must be identical to those used in the S&# string ($here they still have the W character) In the above e.ample JStatement)ame3K' the strings Wplaceholder2W and Wplaceholder4W contained in the S&# string are replaced $ith value2 or value4 be(ore the S&# statement is e.ecuted R I( you are not using placeholders' then the JLeyKblocL can be omitted or le(t empty In both cases' you must not select the %ey Tags Mandatory (ield in the con(iguration' as this $ill cause runtime errors &"ample ><ithout Placeholders@D JrootK JstmtK JCustomers actionAOS&#DD"#OK JaccessK ,PD-T* Customers S*T Company)ameAMCompanyM' -ddressAMStreet 1M 8>*+* CustomerIDAMC9M J=accessK J=CustomersK J=stmtK J=rootK The unchanged S&# statement is e.ecuted in the database? ,PD-T* Customers S*T Company)ameAMCompanyM' -ddressAMStreet 1M 8>*+* CustomerIDAMC9M &"ample >%ith Placeholders@D JrootK JstmtK JCustomers actionAOS&#DD"#OK JaccessK ,PD-T* Customers S*T Company)ameAUW)-"*WU' -ddressAUW-DD+*SSWM 8>*+* CustomerIDAMWK*%/I*#DWU J=accessK JLeyK J)-"*KCompanyJ=)-"*K J-DD+*SSKStreet 1 J=-DD+*SSK JK*%/I*#DKC9J=K*%/I*#DK J=LeyK J=CustomersK J=stmtK J=rootK -(ter the placeholders have been replaced' the same S&# statement is e.ecuted in the database as above? ,PD-T* Customers S*T Company)ameAMCompanyM' -ddressAMStreet 1M 8>*+* CustomerIDAMC9M Comments? R ,sing placeholders is not restricted to individual (ield values' as in this e.ample %ou can set any parts o( the S&# statement in this $ay %ou can also in(luence the logic o( the statement R Surplus and unde(ined placeholders are tolerated in the JLeyK section ,nde(ined placeholders are le(t unchanged in the S&# string This can lead to synta. errors or to une.pected results in the database Attributes in the +2ey0 &lements 4he XML elements in the <%e&> elements can ha.e the follo8ing optional attrib,tes9 Q compare9perationA <com.areT&.e> This attribute enables the logical compare operation to be set (or the respective element The (ollo$ing values are permitted? :alues (or compare9peration -ttribute :alue and ChecL *& *6uals (de(ault value) )*& Does not e6ual #T #ess than #T*& #ess than or e6ual to PT Preater than PT*& Preater than or e6ual to #IK* #iLe (strings) In the corresponding value' the S&# placeholders TSR or TDR can then also be used In the abo.e e"ample XML 'oc,ment0 the <%e&1> bloc< is change' for the SE)E*Tstatement 1Statement2ame5 as follo8s9 JLey2K Jcol4 compare9perationAR)*&RKval4oldJ=col4K Jcol< compare9perationAR#IK*RKvalSJ=col<K J=Ley2K 4he e"ec,te' SQL statement is then change' as follo8s9 T S*#*CT col2'col4'col1 /+9" dbTable)ame 8>*+* ((col4JKUval4oldU -)D col< #IK* UvalSU) 9+ (col4AUval4old4U)) T Q has&uotA %*SV)9 During construction o( the 8>*+* condition o( the S&# statement' the table column type determines $hether the de(ault is to set the values in 6uotation marLs (te.t column types) or not (numerical column types) In a (e$ cases ((or e.ample' $hen using (unctions)' it may be necessary to override this This attribute enables you to do this I( %*S' 6uotation marLs are al$ays set round the values (or $hich this attribute is set in the S&# synta. I( )9' 6uotation marLs are never set 9nly use this attribute in individual cases Q is)ullA T+,* :alues $ith this attribute are ignored during construction o( the 8>*+* condition This attribute has the same e((ect as i( the respective value does not e.ist This is o(ten di((icult to represent in mapping programs )! Document *ormat for the essage Protocol -ative S(! *ormat 4his protocol is primaril# for test p,rposes onl#. Instea' of an XML 'oc,ment format0 a te"t is e"pecte' that represents an# .ali' SQL statement. Jhen inserting a line into a table the correspon'ing 'oc,ment loo<s as follo8s9 < INSERT INT1 tableName 9col,mn6name1= col,mn6name#= col,mn6name(: >A)UES9?col,mn6"al,e1@= ?col,mn6"al,e#@= ?col,mn6"al,e(@: “ =o% to Configure JDBC Adapter in SAP P' This article $ill help you understand ho$ to con(igure the sender and receiver JDBC adapter in S-P PI=!I 8e $ill discuss a simple e.ample $herein $e $ill use sender and receiver JDBC adapter to talL to an 9racle Database T+e JDBC adapter is used to connect to different data*ase systes via SAP P&3 The adapter converts database content to !"# messages and vice versa Sender JDBC -dapter is used to read data (rom databases $hile the receiver JDBC adapter $rites data (rom S-P PI to the relevant databases Database content can be read $ith any S&# statement To $rite data to database' a prede(ined !"# (ormat needs to be used %ou can e.ecute S&# I)S*+T' ,PD-T*' S*#*CT' D*#*T*' or stored procedure statements Direct arbitrary S&# statement can as $ell be used >o$ever' this should be used only (or test purposes Point to note is that a message is al$ays processed in e.actly one database transaction To be able to use JDBC adapter $ith a particular database' you must install the corresponding JDBC drivers on your S-P PI server The driver (iles can be obtained (rom the database vendor )o$ let us con(igure a simple scenario to understand JDBC adapters #etUs say $e have a simple table $hich stores employee details in an 9racle Database The table has < (ields corresponding to *mployee )umber' )ame' Department and a status (ield to indicate ne$ entries 9ur aim is to read ne$ entries (rom this table using S-P PI -(ter reading a record' the status (ield should be set appropriately so that the record is not picLed up again 8e $ill con(igure this using a JDBC sender adapter )o$ $henever an employee is trans(erred (rom one department to other' this data should get updated bacL in the 9racle database 8e $ill accomplish this using JDBC receiver adapter "onfi$urin$ the Sender D!" #dapter The (igure belo$ sho$s a typical con(iguration (or JDBC sender adapter JDBC Driver and Connection parameters sho$n correspond to 9racle database These parameters di((er depending on the database you are using The correct parameters (or your database can be (ound out (rom the database vendor Poll Interval speci(ies ho$ o(ten JDBC adapter polls the database &uery S&# Statement should contain the actual S&# S*#*CT statement using $hich you $ant to 6uery the database eg in our case X SELEC& E*N5 a$ Emp*Num%er6 E*N(ME a$ Emp*Name6 DE7& a$ Emp*Dept )rom EM7*&(B 89ere E*NE: ; <=< or#er % E*N5 Corresponding to your S&# S*#*CT statementUs output' you need to create a data type and a message type in I+=*S+ In our case it $ould looL something liLe belo$? The standard (ormat sho$n must be (ollo$ed The JDBC adapter al$ays returns records in the !"# (ormat liLe one sho$n belo$ )ote that Jro$K is in all lo$ercase 3Me$$age&pe4 3ro84 ... ... 3>ro84 3ro84 ... ... 3>ro84 ... ... 3>Me$$age&pe4 Document )ame in the adapter con(iguration speci(ies the "essage Type ,pdate S&# Statement should contain the ,PD-T* statement so that previously read data is not read again $hen the adapter polls the database ne.t time eg in our case U7D(&E EM7*&(B SE& E*NE: ; <N< :?E"E E*NE: ; <=< /or test purposes' you might $ant to read the same data again and again In this case' put the string JtestK (including the angle bracLets) in the ,pdate S&# Statement (ield "onfi$urin$ the Receiver D!" #dapter )o$ $e $ant to update the database (rom PI /ollo$ing (igure sho$s re6uired con(iguration (or JDBC receiver adapter 8hen you use !"# S&# /ormat as "essage Protocol' the data type and message type created (or sending the data through JDBC adapter must (ollo$ a standard !"# (ormat sho$n belo$ 8hen sending the message' the action attribute should contain the type o( S&# statement eg I)S*+T' ,PD-T*' D*#*T* etc The table (ield should contain the actual database table name The access node should be used to speci(y the (ields that $ish to insert=update in the database $hile the Ley node speci(ies the $here criteria o( S&# statement 8hen you use )ative S&# String as "essage Protocol' the above (ormat is not necessary In that case' the JDBC adapter e.pects the actual S&# (ormatted string as the payload The )ative S&# String protocol should be used only (or test purposes ho$ever )o$ simply create a ne$ employee record in the 9racle database $ith *D)*8 A Y%U and the sender JDBC adapter $ill picL it up $hen it polls the database To test the receiver JDBC adapter' you might need to con(igure rest o( the scenario or you can send an !"# message in the above (ormat (rom the Test "essage tab o( +untime $orLbench
Copyright © 2024 DOKUMEN.SITE Inc.