Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Chandra Kumar — — source: Informix-list mailing list archive (1991-1998)
Hello Friends,
Let me first wish an Happy Diwali (Festival of lights Celebrated in India which brings
Good wishes to all).
I have written a following stored procedure. I want to know whether dynamic sql can
Be handled in Informix-SPL. The procedure is as follows--
CREATE PROCEDURE "informix".sp_rverchk ( iOldRowVer Integer,
sBranch Char(10),
sCtryCd Char(3))
DEFINE IRowVer integer;
SELECT ROW_VER INTO IRowVer
FROM COUNTRY
WHERE CTRY_CODE = sCtryCd AND BRANCH_CODE = sBranch;
IF (IRowVer <> iOldRowVer) THEN
RAISE EXCEPTION -746,0, 'concurrency failure';
END IF
END PROCEDURE;
I hope u got what I am trying to tell. The above procedure is specific to the table COUNTRY.
What I want is to make the procedure generic ie I would like to pass the table name and the
Where condition the following sql statement I want build
SELECT ROW_VER INTO IRowVer
FROM COUNTRY
WHERE CTRY_CODE = sCtryCd AND BRANCH_CODE = sBranch;
Like
SELECT ROW_VER INTO IrowVer
FROM + <table Name> +
WHERE < conditon>
How to do ?. Do Reply
I will be thank full
Regards
Chandra kumar
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.