1
- /* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.248 2003/07/14 12:18:25 meskes Exp $ */
1
+ /* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.249 2003/07/18 14:32:56 meskes Exp $ */
2
2
3
3
/* Copyright comment */
4
4
%{
@@ -1818,12 +1818,24 @@ TruncateStmt: TRUNCATE opt_table qualified_name
1818
1818
*
1819
1819
*****************************************************************************/
1820
1820
1821
+ /* This is different from the backend as we try to be compatible with many other
1822
+ * embedded SQL implementations. So we accept their syntax as well and
1823
+ * translate it to the PGSQL syntax. */
1824
+
1821
1825
FetchStmt : FETCH fetch_direction from_in name ecpg_into_using
1822
1826
{ $$ = cat_str(4 , make_str(" fetch" ), $2 , $3 , $4 ); }
1827
+ | FETCH fetch_direction name ecpg_into_using
1828
+ { $$ = cat_str(4 , make_str(" fetch" ), $2 , make_str(" from" ), $3 ); }
1829
+ | FETCH from_in name ecpg_into_using
1830
+ { $$ = cat_str(3 , make_str(" fetch" ), $2 , $3 ); }
1823
1831
| FETCH name ecpg_into_using
1824
1832
{ $$ = cat2_str(make_str(" fetch" ), $2 ); }
1825
1833
| FETCH fetch_direction from_in name
1826
1834
{ $$ = cat_str(4 , make_str(" fetch" ), $2 , $3 , $4 ); }
1835
+ | FETCH fetch_direction name
1836
+ { $$ = cat_str(4 , make_str(" fetch" ), $2 , make_str(" from" ), $3 ); }
1837
+ | FETCH from_in name
1838
+ { $$ = cat_str(3 , make_str(" fetch" ), $2 , $3 ); }
1827
1839
| FETCH name
1828
1840
{ $$ = cat2_str(make_str(" fetch" ), $2 ); }
1829
1841
| MOVE fetch_direction from_in name
@@ -1832,8 +1844,7 @@ FetchStmt: FETCH fetch_direction from_in name ecpg_into_using
1832
1844
{ $$ = cat2_str(make_str(" move" ), $2 ); }
1833
1845
;
1834
1846
1835
- fetch_direction : /* EMPTY */ { $$ = EMPTY; }
1836
- | NEXT { $$ = make_str(" next" ); }
1847
+ fetch_direction : NEXT { $$ = make_str(" next" ); }
1837
1848
| PRIOR { $$ = make_str(" prior" ); }
1838
1849
| FIRST_P { $$ = make_str(" first" ); }
1839
1850
| LAST_P { $$ = make_str(" last" ); }
@@ -1853,7 +1864,7 @@ fetch_count: IntConst { $$ = $1; }
1853
1864
;
1854
1865
1855
1866
from_in : IN_P { $$ = make_str(" in" ); }
1856
- | FROM { $$ = make_str(" from" ); }
1867
+ | FROM { $$ = make_str(" from" ); }
1857
1868
;
1858
1869
1859
1870
/* ****************************************************************************
0 commit comments