Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Adding LEFT function to a UDF function within SELECT
I have a UDF called SECTIONS.
SELECT SECTIONS(st300.uid,'2000','FALL') FROM st300
gives me blanks, but
SELECT LEFT(SECTIONS(st300.uid,'2000,'FALL'),32) FROM st300
gives me the correct result (string).
Anybody knows why?
Here's the function:
FUNCTION SECTIONS(pUID,pYear,pSem)
LOCAL xRet, xTemp, xSS440
xRet=''
xSS440=zSS+'SS440' &&zSS is a global variable for path to SS files.
DO CASE
CASE UPPER(pSem)="FALL"
xSem='1'
CASE UPPER(pSem)="SPRING"
xSem='2'
CASE UPPER(pSem)="SUMMER"
xSem='0'
ENDCASE
*sts='S' means scheduled.
*List only scheduled sections.
SELECT sts,sec FROM &xSS440 ;
WHERE UID=pUID and sem=xSem and year=pYear and sts='S' ;
ORDER BY UID,per INTO CURSOR xTemp
GO TOP
DO WHILE NOT EOF()
IF EMPTY(xRet) THEN
xRet=str(sec,3)
ELSE
xRet=xret+','+str(sec,3)
ENDIF
SKIP
ENDDO
Return xRet
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement