Drag and Drop from Data Source Explorer View
- Configure a database connection (see the specific procedure for your database server in the Database Connection Support section).
- Browse to the table you will use in your statement.
-
Drag the table or a column of the table into the editor where a SQL file is open.
Drag and drop actions are available both on the table and on its fields. A pop-up menu is displayed in the SQL editor.
Figure: SQL Statement Editing with Drag and Drop
-
Select the type of statement from the pop-up menu.
Depending on your choice, dragging a table results in one of the following statements being inserted into the document:
- SELECT `field1`,`field2`, .... FROM `catalog`.
`table` (for example:
SELECT `DEPT`,`DEPTNAME`,`LOCATION` FROM `camera`.`cameraDesc`) - UPDATE `catalog`. `table` SET `field1`=,
`field2`=,.... (for example:
UPDATE `camera`.`cameraDesc` SET `DEPT`=, `DEPTNAME`=, `LOCATION`=) - INSERT INTO`catalog`. `table` ( `field1`,`field2`,
....) VALUES (, , ) (for example:
INSERT INTO `camera`.`cameraDesc` (`DEPT`,`DEPTNAME`,`LOCATION`) VALUES (, , )) - DELETE FROM `catalog`. `table` (for example:
DELETE FROM `camera`.`cameraDesc`)
Depending on your choice, dragging a column results in one of the following statements being inserted into the document:
- SELECT `field` FROM `catalog`. `table` (for example:
SELECT `DEPT` FROM `camera`.`cameraDesc`) - UPDATE `catalog`. `table` SET `field`= (for example:
UPDATE `camera`.`cameraDesc` SET `DEPT`=) - INSERT INTO`catalog`. `table` ( `field1) VALUES () (for
example:
INSERT INTO `camera`.`cameraDesc` (`DEPT`) VALUES ()) - DELETE FROM `catalog`. `table` (for example:
DELETE FROM `camera`.`cameraDesc` WHERE `DEPT`=)
- SELECT `field1`,`field2`, .... FROM `catalog`.
`table` (for example: