I HAVE A PROBLEM REGARDING DECLARATION/ INITIALISATION OF VARIABLES IN POSTGRESQL FUNCTIONS AND PROCEDURES. MY CODE PRESENTLY LOOKS LIKE CREATE FUNCTION ins_into_std_values() RETURNS void AS $BODY$ myflag CHAR(1) :='y'; dbms_output.put_line('enter the values sequentially'); loop if myflag='n' then exit; end if; insert into std_values values('&tree_species_name','&location',&p,&c1,&c2,&q,&c3,&a,&b,&sp_gravity,&exp_factor); commit; dbms_output.put_line('records inserted sucessfully'); dbms_output.put_line('enter n to exit or y to continue entering values'); myflag:= '&y or n'; end loop; commit; $BODY$ LANGUAGE 'sql' VOLATILE;
BUT IT SHOWS ERROR AT INITIALISATION OF MYFLAG... CAN ANYONE TELL ME HOW TO DECLARE VARIABLES IN POSTGRESQL..