Login   Register  
PHP Classes
elePHPant
Icontem

File: test.sql

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Orazio Principe  >  SQL Parser  >  test.sql  >  Download  
File: test.sql
Role: Auxiliary data
Content type: text/plain
Description: test sql file
Class: SQL Parser
Parse SQL files and extract query statements
Author: By
Last change: Updated tests with all comments possibilities
Date: 2014-01-03 01:00
Size: 1,056 bytes
 

Contents

Class file image Download
#Sql Comments example from the global mysql documentation

/*
this is a
multiple-line comment before instructions
*/
SELECT 1+1, "ciao; #good text --, testo";      # This comment; continues to the end of line
SELECT 1+1, "ciao; #good text --, testo", 1 /* this is an in-line comment */ * 1;
SELECT 1+1, "ciao; #good text --, testo";     -- This comment continues to the end of line
SELECT 1-
/*
this is a
multiple-line comment
*/
1;

#THIS IS A COMMENT :)

SELECT * FROM table1 WHERE a=1;

--SELECT COMMENTED 2 
SELECT * FROM
    table2
    where a=2;

#INSERTING VALUES
INSERT IGNORE INTO `VERSIONS`(`release`,`revision`,`name`,`lastUpdate`) VALUES ( '1','0','SqlParser',NOW()); 

#CREATING TABLES
CREATE TABLE `TESTS` (
  `Id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `Name` varchar(80) NOT NULL DEFAULT '',
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#CUSTOMS OPERATIONS
INSERT INTO `TESTS`(`Id`,`Name`) VALUES ( '1','test valiue'); 
UPDATE `TEST` SET `Name`='test value update' WHERE `Id`='1';