GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SQL::Maker::SelectSet(3) User Contributed Perl Documentation SQL::Maker::SelectSet(3)

SQL::Maker::SelectSet - provides set functions

    use SQL::Maker::SelectSet qw(union_all except);
    my $s1 = SQL::Maker::Select ->new()
                                ->add_select('foo')
                                ->add_from('t1');
    my $s2 = SQL::Maker::Select ->new()
                                ->add_select('bar')
                                ->add_from('t2');
    union_all( $s1, $s2 )->as_sql;
    # =>
    #  SQL::Maker::SelectSet->new_set(
    #      operator => 'UNION ALL',
    #      new_line => $s1->new_line
    #  )->add_statement($s1)
    #   ->add_statement($s2)
    #   ->as_sql;
    # => "SELECT foo FROM t1 UNION ALL SELECT bar FROM t2"
    except( $s1, $s2 )->as_sql;
    # => SQL::Maker::SelectSet->new_set( operator => 'EXCEPT', new_line => $s1->new_line )
    #     ->add_statement( $s1 )
    #     ->add_statement( $s2 )
    #     ->as_sql;
    # => "SELECT foo FROM t1 EXCEPT SELECT bar FROM t2"

This module provides some set functions which return a SQL::Maker::SelectSet object inherited from SQL::Maker::Select.

"union($select :SQL::Maker::Select | $set :SQL::Maker::SelectSet) : SQL::Maker::SelectSet"
Tow statements are combined by "UNION".
"union_all($select :SQL::Maker::Select | $set :SQL::Maker::SelectSet) : SQL::Maker::SelectSet"
Tow statements are combined by "UNION ALL".
"intersect($select :SQL::Maker::Select | $set :SQL::Maker::SelectSet) : SQL::Maker::SelectSet"
Tow statements are combined by "INTERSECT".
"intersect_all($select :SQL::Maker::Select | $set :SQL::Maker::SelectSet) : SQL::Maker::SelectSet"
Tow statements are combined by "INTERSECT ALL".
"except($select :SQL::Maker::Select | $set :SQL::Maker::SelectSet) : SQL::Maker::SelectSet"
Tow statements are combined by "EXCEPT".
"except($select :SQL::Maker::Select | $set :SQL::Maker::SelectSet) : SQL::Maker::SelectSet"
Tow statements are combined by "EXCEPT ALL".

my $stmt = SQL::Maker::SelectSet->new( %args )
$opretaor is a set operator (ex. "UNION"). $one and $another are SQL::Maker::Select object or SQL::Maker::SelectSet object. It returns a SQL::Maker::SelectSet object.

The parameters are:

$new_line
Default values is "\n".
$operator : Str
The operator. This parameter is required.

"my $sql = $set->as_sql() : Str"
Returns a new select statement.
"my @binds = $set->bind() : Array[Str]"
Returns bind variables.
"$set->add_statement($stmt : $stmt->can('as_sql')) : SQL::Maker::SelectSet"
This method adds new statement object. $stmt must provides 'as_sql' method.

Return Value is the $set itself.

SQL::Maker::Select
2014-12-22 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.