Re: Help in SPL reqd
Posted in 1997
On Mon, 17 Nov 1997, S.Sathish wrote:
} 1) this compiled fine
}
} create procedure temp()
} end procedure
}
} 2) This did not why ?
}
} create procedure proc_tmp ( last char(15),first char(15))
} returning int;
} # ^
} # 201: A syntax error has occurred.
} #
} define x int;
} on exception in (-206)
} create table proc_tab (lname char(15),fname char(15),tele char(15));
}
} insert into proc_tab values (last,first,'1000');
}
} end exception with resume
}
} end procedure
Because you tried to create it with ISQL instead of DB-Access, and ISQL
does not understand CREATE PROCEDURE syntax. It thinks that the first
semi-colon marks the end of the statement, so it sent the engine the
'command':
CREATE PROCEDURE proc_tmp ( LAST CHAR(15),FIRST CHAR(15))
RETURNING INT;
Now, as you can see, this is not a complete CREATE PROCEDURE statement, so
you get that wonderfully informative -201 error.
} 3)this did not.why?
}
} create procedure temp()
} define x char;
} # ^
} # 201: A syntax error has occurred.
} #
} end procedure;
Same reason; the semi-colon throws it out.
} 4)even this did not.why?
}
} create procedure temp()
} define x char;
} # ^
} # 201: A syntax error has occurred.
} #
} end procedure
I'm not sure what the difference between 3 and 4 is, but the semi-colon is
the cause of the trouble.
} Informix ODS 7.1 on SCO.
Use DB-Access instead of ISQL -- DB-Access does understand CREATE PROCEDURE
statements!
Yours,
Jonathan Leffler (johnl@informix.com) #include <witticism.h>