=pod =head1 NAME SQL::Statement::Syntax - documentation of SQL::Statement's SQL Syntax =head1 SYNOPSIS See L for usage. =head1 DESCRIPTION The SQL::Statement module can be used either from a DBI drive like DBD::CSV or directly. The syntax below applies to both situations. In the case of DBDs, each DBD can implement its own sub-dialect so be sure to check the DBD documentations also. SQL::Statement is meant primarly as a base class for DBD drivers and as such concentrates on a small but useful subset of SQL. It does *not* in any way pretend to be a complete SQL parser for all dialects of SQL. The module will continue to add new supported syntax, and users may also extend the syntax (see L<#Extending the SQL syntax>). =head1 USAGE =head2 Default Supported SQL syntax - Summary B CALL CREATE [TEMP] TABLE CREATE [TEMP] TABLE
AS
AS IMPORT() CREATE FUNCTION [ NAME ] CREATE KEYWORD [ NAME ] CREATE OPERATOR [ NAME ] CREATE TYPE [ NAME ] DELETE FROM
[] DROP TABLE [IF EXISTS]
DROP FUNCTION DROP KEYWORD DROP OPERATOR DROP TYPE INSERT [INTO]
[] VALUES LOAD SELECT SELECT [] [ ORDER BY ocol1 [ASC|DESC], ... ocolN [ASC|DESC]] ] [ GROUP BY gcol1 [, ... gcolN] ] [ LIMIT [start,] length ] UPDATE
SET [] B NATURAL, INNER, OUTER, LEFT, RIGHT, FULL B * Aggregate : MIN, MAX, AVG, SUM, COUNT * Date/Time : CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP * String : CHAR_LENGTH, CONCAT, COALESCE, DECODE, LOWER, POSITION, REGEX, REPLACE, SOUNDEX, SUBSTRING, TRIM, UPPER B * IMPORT - imports a table from an external RDBMS or perl structure * RUN - prepares & executes statements in a file of SQL statements B = , <> , < , > , <= , >= , IS [NOT] NULL , LIKE , CLIKE , IN , BETWEEN B and B * regular identifiers are case insensitive (though see note on table names) * delimited identifiers (inside double quotes) are case sensitive * column and table aliases are supported B * use either ANSI SQL || or the CONCAT() function * e.g. these are the same: {foo || bar} {CONCAT(foo,bar)} B * comments must occur before or after statements, can't be embedded * SQL-style single line -- and C-style multi-line /* */ comments are supported B * currently NULLs and empty strings are identical, but this will change * use {col IS NULL} to find NULLs, not {col=''} (though both currently work) See below for further details. =head2 Syntax - Details =head3 CREATE TABLE Creates permanenet and in-memory tables. CREATE [TEMP] TABLE ( ) CREATE [TEMP] TABLE AS