Re: Stored Procedures and TEXT/BYTE data types
Posted in 1998
Fred Prose wrote:
> Can I use a stored procedure to store (insert) a row containing
> a text or byte field? Can I use a SP to retrieve a row and return
> the text or byte data?
Yes, but...
-- Check syntax for parameters; I think I've got it wrong!
CREATE PROCEDURE text_byte(t reference text, b reference byte)
RETURNING reference text, reference byte; DEFINE i INTEGER;
INSERT INTO WhereEver (SerialCol, TextCol, ByteCol)
VALUES(0, t, b); LET i = DBINFO('sqlca.sqlerrd[1]'); -- check notation and index#
SELECT TextCol, ByteCol INTO t, b FROM WhereEver
WHERE SerialCol = i; RETURN t, b;
END PROCEDURE;
..the values have to be passed into the procedure or back out of
the procedure into blob variables. There are no blob variables in
DB-Access, et al. ESQL/C and I4GL can manage, of course.
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN
#include <disclaimer.h>