-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.226 2003/05/30 08:39:01 meskes Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.227 2003/05/30 13:22:02 meskes Exp $ */
/* Copyright comment */
%{
%type ECPGFree ECPGDeclare ECPGVar opt_at enum_definition
%type struct_union_type s_struct_union vt_declarations
%type var_declaration type_declaration single_vt_declaration
-%type ECPGSetAutocommit on_off variable_declarations
+%type ECPGSetAutocommit on_off variable_declarations ECPGDescribe
%type ECPGAllocateDescr ECPGDeallocateDescr symbol opt_output
%type ECPGGetDescriptorHeader ECPGColLabel single_var_declaration
%type reserved_keyword unreserved_keyword ecpg_interval
%type col_name_keyword func_name_keyword precision opt_scale
%type ECPGTypeName variablelist ECPGColLabelCommon c_variable
-%type inf_val_list inf_col_list using_descriptor ECPGDescribe
-%type into_descriptor
+%type inf_val_list inf_col_list using_descriptor into_descriptor
%type s_struct_union_symbol
-%type ECPGGetDescriptor
+%type ECPGGetDescriptor
%type simple_type signed_type unsigned_type
}
| ECPGDescribe
{
- if (connection)
- mmerror(PARSE_ERROR, ET_ERROR, "no at option for describe statement.\n");
-
- fprintf(yyout, "{ /* ECPGdescribe(__LINE__, %s) */;", $1);
+ fprintf(yyout, "{ ECPGdescribe(__LINE__, %s,", $1);
+ dump_variables(argsresult, 1);
+ fputs("ECPGt_EORT);", yyout);
+ fprintf(yyout, "}");
+ output_line_number();
+
/* whenever_action(2); */
free($1);
}
*/
ECPGDescribe: SQL_DESCRIBE INPUT_P name using_descriptor
{
- mmerror(PARSE_ERROR, ET_ERROR, "using unsupported describe statement.\n");
- $$ = cat_str(3, make_str("input"), $3, $4);
+ mmerror(PARSE_ERROR, ET_WARNING, "using unsupported describe statement.\n");
+ $$ = cat_str(3, make_str("1, ECPGprepared_statement(\""), $3, make_str("\")"));
}
| SQL_DESCRIBE opt_output name using_descriptor
{
- mmerror(PARSE_ERROR, ET_ERROR, "using unsupported describe statement.\n");
- $$ = cat_str(3, $2, $3, $4);
+ mmerror(PARSE_ERROR, ET_WARNING, "using unsupported describe statement.\n");
+ $$ = cat_str(3, make_str("0, ECPGprepared_statement(\""), $3, make_str("\")"));
}
| SQL_DESCRIBE opt_output name into_descriptor
{
- mmerror(PARSE_ERROR, ET_ERROR, "using unsupported describe statement.\n");
- $$ = cat_str(3, $2, $3, $4);
+ mmerror(PARSE_ERROR, ET_WARNING, "using unsupported describe statement.\n");
+ $$ = cat_str(3, make_str("0, ECPGprepared_statement(\""), $3, make_str("\")"));
}
;