Wählen Sie Ihren SQL-Server:
AnySQL
MySQL
MS SQL Server
Oracle
PostgreSQL
SQLite
Firebird
SQL Anywhere
DB2
MaxDB

Neuheiten abonnieren
Partners
Testimonials
Craig Cordell: "The simplicity of your code generator is fantastic. We've evaluated dozens of others over the past few years but have yet to find one that is as easy to use as yours".
Ran / Cole: "We bought the tool last week and want to say how much we love it. We've found it not only powerful, but very user friendly. We have used the tool to create an interface that manages our MySQL DB for different types of users".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

Custom SQL queries

To add a query within the editor, use the Create Query button or select the corresponding popup menu item, then type the query name and text, and click OK. The query text must meet the following condition: such query as

 

select * from

(

YOUR_QUERY_TEXT

) tb_alias

 

must be valid. The Objects list displays the names of invalid queries in red.

 

 

Creating updatable datasets (For Professional Edition Only)

To get an updatable dataset based on an SQL query, you have to provide up to three SQL queries: UPDATE, INSERT, and DELETE to be able to modify, add and remove records accordingly. The first query provides an UPDATE statement for modifying existing records; the second query provides an INSERT statement to add a new record to the tables; and the third one provides a DELETE statement to remove the records. Each of these queries can contain several parameterized statements that use parameters like :field_name.

 

Example

Assume that we have the following SELECT statement:

 

SELECT

       id,

       first_name,

       last_name

FROM customer

WHERE last_name LIKE 'A%'

 

To create an updatable dataset based on this query, INSERT, UPDATE and DELETE statements can be specified as follows:

 

INSERT INTO

       customer

VALUES (:id, :first_name, :last_name);

 

UPDATE customer

SET        id = :id,

       first_name = :first_name,

       last_name = :last_name

WHERE id = :OLD_id;

 

DELETE FROM customer

WHERE id = :id;



Prev Return to chapter overview Next