Re: Inserting a serial key with stored procedures
Posted in 1993
In <1993Apr26.213930.13850@Thalatta.COM> bossert@thalatta.com (John Bossert) writes:
>Yet another Stored Procedures question!
>The serial type is not a valid datatype within stored procedure language
>(SPL). How can one insert the "next highest value" into a serial field?
>Suppose I have:
>create table foo(foo_nr serial, foo_date date);
>and I want to create an SP that, passed a date, would insert a row with
>the desired date AND the next highest value of foo_nr as a key.
>How should this be done?
Are you saying that "INSERT INTO foo VALUES (0, date_parm)" fails? I
don't have 5.0 installed right now, so I can't test it. What goes wrong?
graeme
--
Disclaimer: The author's opinions are his own, and not necessarily
those of Pyramid Technology Ltd. or Pyramid Technology Inc.
---------------------------------------------------------------------------
-m------- Graeme Sargent Voice: +44 (0)252 373035
---mmm----- Senior Database Consultant Fax : +44 (0)252 373135
-----mmmmm--- Pyramid Technology Ltd. Telex: Tell who???
-------mmmmmmm- Farnborough, Hants GU14 7PL Email: graeme@pyra.co.uk
---------------------------------------------------------------------------
We have the technology. The tricky bit is learning how to use it.