Subject Question select in Stored procs
Author Erik De Laet
I want to select different fields of a table
depending on a parameter to the stored procedure.

Is this possible ?

Example (simplified version of course):
CREATE TABLE CURSUSTYPE
(
CURSUS_CODE
VARCHAR( 8) NOT NULL COLLATE ISO8859_1,
CURSUS_DESCR_NL VARCHAR( 255) COLLATE ISO8859_1,
CURSUS_DESCR_EN VARCHAR( 255) COLLATE ISO8859_1,

CONSTRAINT PK_CURSUSTYPE PRIMARY KEY (CURSUS_CODE)
);

I have written a stored procedure which performs a select on this table.

But I would like it to return 'CURSUS_DESCR_NL'
when I pass it a parameter 'NL' and
'CURSUS_DESCR_EN' when I pass it a parameter 'EN'.

I would like to use a select in the stored proc as f.i.

select CURSUS_CODE as Code, CURSUS_DESCR_<nl or en> as Descr from TheTable.

By the way: this is a simplified example of
course, so I would not like to use an
IF-statement to use different select-statements depending on the parameter.

So I am asking for the way to something like
this. Not the exact solution to the above problem.

Thanks in advance ,

Erik



----------
Erik De Laet - CEO E.De.L.Com bvba
Author of Sitestepper - the Web Maintenance
program. Visit the home of Sitestepper at www.sitestepper.com.
Programmer by choice and profession !

----------
E.De.L.Com bvba - The Software bridge to the user !
Software-, hardware en internetconsultants and
developers in Delphi, Paradox and VBA (Word, Excel en Access).

----------
Lambrechtshoekenlaan 211-2170 Merksem
(Antwerpen)-Belgiƫ-ONr:BTW BE 0460.974.682
tel: (32)3-541 77 24 - fax: (32)3-542 49 69 -
mobile: (32)475-32 99 47 - (32)475-81 67 83
web site: www.edelcom.be - www.edelcom.com - email: info@...


[Non-text portions of this message have been removed]