24.08.2015 Views

Oxygen XML Author plugin 13.2.0

Oxygen XML Author plugin 13.2.0

Oxygen XML Author plugin 13.2.0

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3. Drag the table or a column of the table into the editor where a SQL file is open.DND is available both on the table and on its fields. A popup menu is displayed in the SQL editor.4. Select the type of statement from the popup menu.If you dragged a table depending on your choice, one of the following statements are inserted into the document:• SELECT `field1`,`field2`, .... FROM `catalog`. `table` (for this example: SELECT`DEPT`,`DEPTNAME`,`LOCATION` FROM `test`.`department` )• UPDATE `catalog`. `table` SET `field1`=, `field2`=,.... (for this example: UPDATE `test`.`department`SET `DEPT`=, `DEPTNAME`=, `LOCATION`=)• INSERT INTO`catalog`. `table` ( `field1`,`field2`, ....) VALUES (, , ) (for this example: INSERT INTO`test`.`department` (`DEPT`,`DEPTNAME`,`LOCATION`) VALUES (, , ))• DELETE FROM `catalog`. `table` (for this example: DELETE FROM `test`.`department`)If you dragged a column depending on your choice, one of the following statements are inserted into the document:• SELECT `field` FROM `catalog`. `table` (for this example: SELECT `DEPT` FROM`test`.`department` )• UPDATE `catalog`. `table` SET `field`= (for this example: UPDATE `test`.`department` SET`DEPT`=)• INSERT INTO`catalog`. `table` ( `field1) VALUES () (for this example: INSERT INTO`test`.`department` (`DEPT`) VALUES ())• DELETE FROM `catalog`. `table` (for this example: DELETE FROM `test`.`department` WHERE`DEPT`=)SQL ValidationCurrently, SQL validation support is offered for IBM DB2. Please note that if you choose a connection that doesn'tsupport SQL validation you will receive a warning when trying to validate. The SQL document will be validated usingthe connection from the associated transformation scenario.Executing SQL StatementsThe steps for executing an SQL statement on a relational database are the following:1.Configure a transformation scenario from theTransformation toolbar.Configure Transformation Scenario button from theA SQL transformation scenario needs a database connection. You can configure a connection from thePreferences button from the scenario dialog.The dialog that appears contains the list of existing scenarios that apply to SQL documents.2. Set parameter values for SQL placeholders from the Parameters button from the scenario dialog.For example in SELECT * FROM `test`.`department` where DEPT = ? or DEPTNAME = ? twoparameters can be configured for the place holders (?) in the transformation scenario.When the SQL statement will be executed, the first placeholder will be replaced with the value set for the firstparameter in the scenario, the second placeholder will be replaced by the second parameter value and so on.Restriction: When a stored procedure is called in an SQL statement executed on an SQL Server databasemixing in-line parameter values with values specified using the Parameters button of the scenario dialogis not recommended. It is due to a limitation of the SQL Server driver for Java applications. An example ofstored procedure call that is not recommended is: call dbo.Test(22, ?).3. Execute the SQL scenario from the Transform now button of the scenario dialog.The result of a SQL transformation will be displayed in a view at the bottom of the <strong>Oxygen</strong> <strong>XML</strong> <strong>Author</strong> <strong>plugin</strong>window.4. View more complex return values of the SQL transformation in a separate editor panel.Working with Databases | 345

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!