5 use DBIx::Class::Storage::DBI::Oracle::WhereJoins;
8 use DBIC::SqlMakerTest;
12 my $sa = new DBIC::SQL::Abstract::Oracle;
14 $sa->limit_dialect('RowNum');
20 [ 'foo.id', 'bar.id', \'TO_CHAR(foo.womble, "blah")' ],
25 SELECT A.*, ROWNUM r FROM
27 SELECT foo.id AS col1, bar.id AS col2, TO_CHAR(foo.womble, "blah") AS col3 FROM rubbish
34 'Munged stuff to make Oracle not explode'
38 # search with undefined or empty $cond
40 # my ($self, $table, $fields, $where, $order, @rest) = @_;
41 my ($sql, @bind) = $sa->select(
45 { "-join_type" => "LEFT", artist => "artist" },
46 { "artist.artistid" => "me.artist" },
49 [ 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
56 'SELECT cd.cdid, cd.artist, cd.title, cd.year, artist.artistid, artist.name FROM cd me, artist artist WHERE ( artist.artistid(+) = me.artist )',
58 'WhereJoins search with empty where clause',
61 ($sql, @bind) = $sa->select(
65 { "-join_type" => "", artist => "artist" },
66 { "artist.artistid" => "me.artist" },
69 [ 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
70 { 'artist.artistid' => 3 },
76 'SELECT cd.cdid, cd.artist, cd.title, cd.year, artist.artistid, artist.name FROM cd me, artist artist WHERE ( ( ( artist.artistid = me.artist ) AND ( artist.artistid = ? ) ) )',
78 'WhereJoins search with where clause'
81 ($sql, @bind) = $sa->select(
85 { "-join_type" => "LEFT", artist => "artist" },
86 { "artist.artistid" => "me.artist" },
89 [ 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
90 [{ 'artist.artistid' => 3 }, { 'me.cdid' => 5 }],
96 'SELECT cd.cdid, cd.artist, cd.title, cd.year, artist.artistid, artist.name FROM cd me, artist artist WHERE ( ( ( artist.artistid(+) = me.artist ) AND ( ( ( artist.artistid = ? ) OR ( me.cdid = ? ) ) ) ) )',
98 'WhereJoins search with or in where clause'