Here is an example of what i would like to do...---
CREATE FUNCTION fun_totalrecords(varchar) RETURNS int8 AS'DECLAREtheTable ALIAS FOR $1;result int := 0;BEGIN
result = COUNT(*) FROM theTable; -- this is where i need help
RETURN result;
END; 'LANGUAGE 'plpgsql'
Is there an equivelent to the OUTPUT parameter in MS-SQL?
here is an example:
CREATE PROCEDURE GetPagedList( @CurrentPage tinyint, @PageSize tinyint, @TotalRecords int OUTPUT,)ASSet NoCount On-- ...some code here...-- Return the total number of records
quot;);INSERT INTO tblslides(slideid, scriptID, allowdgp, allowdgo, waitforslidefinish, title,text, flashfiledgp, flashfiledgo, slidetype)
VALUES(seqID, aScriptID, aAllowDGP, aAllowDGO, aWaitForSlideFinish, aTitle,aText, aFlashFileDGP, aFlashFileDGO, aSlideType);RETURN seqID;END;'LANGUAGE 'plpgsql' VOLATILE;Clark Allan wrote:
> Thanks for the help Tony,> But im still having some trouble.>
really mising was a semi colon afer nextval('myseq') andthe begin end.CREATE or REPLACE FUNCTION getSeq()
RETURNS int AS$$beginRETURN nextval('myseq');end;$$LANGUAGE 'plpgsql';Clark Allan wrote:>-->CREATE FUNCTION getSeq
ahhh... very nice. Thank you.
On 7/5/05, Tony Caduto <[EMAIL PROTECTED]> wrote:
Or upgrade your server to 8.x and use dollar quoting.with dollar quoting all that is a thing of the past.
CREATE FUNCTION sp_slide_create(int4) RETURNS int4 AS$$DECLAREaScriptID ALIAS FOR $1;seqID int4 := nextval('gense
I am new to Postgre, and am still learning some of the basics...
please bare with me.
I need to know how to access a sequence from within a function. Let me
know whats wrong with the following...
(this is not the exact function, just for examples sake...)
-