INDEPENDENCESOFT.COM

 

[Visual SQL Query Builder] :::

Choosing query-types There are different query types that can be generated. Choose the one you need.



The different statement-types:

  • Select: A normal select-statement will be generated.
  • Select distinct: A select-distinct-statement will be generated
  • Select (grouped by): You may also use some aggregating functions like max, min, avg...
  • Update: An update-statement will be generated. Provide criteria and new values
  • Insert by values: You may specify some fix values for an insert-statement. The statement will look something like "INSERT INTO ... VALUES ..."
  • Insert by select: You may specify a select-statement with the visual-builder. The generated statement will be something like "INSERT INTO ... SELECT ... FROM ... WHERE ..."
  • Delete: A delete-statement will be generated
  • Count results: You'll get a select-count-statement with your specified criteria.
Choosing tables When building your query visually all tables from the specified databaseschema are shown in a dropdownlist.




You can choose tables to be displayed in the building area by pressing the plus-button beside. The table and its attributes will be shown.
 
Generating the SQL-statement When finished with query-building press . The generated query will be displayed in the SQL console. sqlFree will change automatically to the console-window.
 
Clearing the view To clear and initialize the visual builder press the clear-button . All tables and relations will be removed from the building area as well as all chosen attributes from the lower criteria table.
 
Relations If your database has the information about the relationship between tables you are able to visualize them, too. There are following opportunities:

Tables which are currently being displayed in the builder will get their relational information added:

Datamodel functionality. All tables(not only the currently displayed ones) and relations from the database are read and displayed. This functionality is intended to give an overview over the relationship between the tables: 
When executing the datamodel functionality be aware that this might take a while, depending on your database and amount of data.

Layout the table view:

 

Specifying joins between attributes To specify equiJoins (=values of attributes of two tables have to match) just drag and drop attributes from one table to another. Your result should look something like this:



To modify the meaning of a relation you have to get the contextmenu of the relation: Rightclick in one of the two little boxes shown on the relationline or on the relationline itself. A contextmenu will appear from which you can make the supported choices. If you drop on an attribute inside the same table the result will be a self-join.



Example: In case you only want the results from the left table and just the matching from the right (rest is filled up with SQL-null) choose the appropriate menuentry. As shown in the illustration below a little plus sign is shown at the table which will be filled up with SQL-nulls. So your relation-line should appear as follows:

 
Removing elements from the view
  • Removing tables: If you want to remove a table from the view simply click on the cross in the titlebar of the table.



  • Removing relations: As shown above just choose "Remove relation from view" in the appropriate contextmenu
 
Setting criteria on your attributes In most cases you'll want to have a look at specific attributes and their values in your database. To explicitely select the attributes you are interested in doubleclick them. For every doubleclicked attribute you'll get an additional row in the lower criteriatable of the building screen.

Table: Tablename the attribute is belonging to. This value can not be modified.

Attribute: Attributename. You can modify this entry by the statement 'as ...'. Example: 'PROJ_NAME as projectname'.

Criteriafields: Feel free to enter values or boolean expressions in a field. Examples:

  • 1 or 2
  • 3 or >6
  • like 'ab%'
  • like 'abc%' and not 'abcd'
  • not (3 or 4)
  • Placeholdervalues: You can also use 'placeholders'. When sending your statement to the database with sqlFree (by pressing the 'Send SQL-Statement'-Button) you will be asked for an actual placeholdervalue. This value will be placed instead. Example:
    • ##enter projectname##
    • not ##not name a## and not ##not name b##
    • $xyz

Order: You can specify an order on your result-set

Show: By default every chosen attribute will be shown in your resultset. Sometimes you simply want to use the attribute to enter a criteria but not see it in your result-set.


Depending on your query-type there may be additional fields:

Functions: When making aggregations (grouping) you have the choice between the functions listed in the dropdown-list. If choosing "Condition" the appropriate criteria value will be built in the statement

New value: When updating/inserting values you can specify here what the new value should be.

Insert into: If choosing "Select by insert"-statementtype each value which is marked as to be shown in the table, has to be mapped to the attribute in the inserted table.

 
How are the criteriafields interpreted? Think about the following input:

The logic how the built SQL-statement would look like is as follows:

(1 and 2 and 3) or
(4 and 5 and 6) or
(7 and 8 and 9)

 
Choosing schema-name generation
  • Tablesnames are referenced fully qualified by default. Means: The schemaname is put as prefix to the table.
  • By changing the fontsize you are able to display big tables or datamodels in the builderarea. Otherwise you would have to scroll in some cases.

 

 

 

>>MAIN

>>CONTACT US

:::Buy now:::
IndependenceSoft.com © 2003
:::Home:::