How to do CLIPPED in Store Procedure
Posted in 2003
Topics: General Discussion
Hi .. I'm having problem to clipp 2 character variable into one variable in Sore procedure Example define p_lineno INTEGER; define p_lineno2 CHAR(2); define p_lineno3 CHAR(2); LET p_lineno2 = p_lineno ; IF p_lineno < 10 THEN LET p_lineno3 = '0' + p_lineno2; ELSE LET p_lineno3 = p_lineno2; END IF By doing the trace debug, it gave a result p_lineno3 = 1.000000000 whcih i do not understand how it can be like that. If I used LET p_lineno3 = '0',p_lineno2 it gave me error ; The number of values return does not match with the variable. I can't used 'CLIPPED' in SQL , the system do not understand. Please can somebody help me to resolve this. Thanks
Hi Syed, Use "||" (two PIPEs) to concatenate character variables in SP. For eg: as per your code... LET p_lineno3 = '0' || p_lineno2; Cheers Ravi Shankar N. -----Original Message----- From: SYED AHMAD .... [mailto:najmi@centurysoftware.com.au] Sent: Saturday, August 02, 2003 1:24 PM To: ids@iiug.org Subject: How to do CLIPPED in Store Procedure [1623] Hi .. I'm having problem to clipp 2 character variable into one variable in Sore procedure Example define p_lineno INTEGER; define p_lineno2 CHAR(2); define p_lineno3 CHAR(2); LET p_lineno2 = p_lineno ; IF p_lineno < 10 THEN LET p_lineno3 = '0' + p_lineno2; ELSE LET p_lineno3 = p_lineno2; END IF By doing the trace debug, it gave a result p_lineno3 = 1.000000000 whcih i do not understand how it can be like that. If I used LET p_lineno3 = '0',p_lineno2 it gave me error ; The number of values return does not match with the variable. I can't used 'CLIPPED' in SQL , the system do not understand. Please can somebody help me to resolve this. Thanks
CLIPPED as it is in 4gl, could not be done in SPL. You have to do somthing very tricky to do it. If you are using IDS use the new string functions in SQL. Chucho! N Ravishank.... wrote: > Hi Syed, > Use "||" (two PIPEs) to concatenate character variables in SP. > > For eg: as per your code... > > LET p_lineno3 = '0' || p_lineno2; > > Cheers > Ravi Shankar N. > > -----Original Message----- > From: SYED AHMAD .... [mailto:najmi@centurysoftware.com.au] > Sent: Saturday, August 02, 2003 1:24 PM > To: ids@iiug.org > Subject: How to do CLIPPED in Store Procedure [1623] > > Hi .. > > I'm having problem to clipp 2 character variable into one variable in Sore procedure > > Example > > define p_lineno INTEGER; > define p_lineno2 CHAR(2); > define p_lineno3 CHAR(2); > > LET p_lineno2 = p_lineno ; > IF p_lineno < 10 THEN > LET p_lineno3 = '0' + p_lineno2; > ELSE > LET p_lineno3 = p_lineno2; > END IF > > By doing the trace debug, it gave a result p_lineno3 = 1.000000000 whcih i do not understand how it can be like that. > > If I used > LET p_lineno3 = '0',p_lineno2 it gave me error ; > The number of values return does not match with the variable. > I can't used 'CLIPPED' in SQL , the system do not understand. > > Please can somebody help me to resolve this. > > Thanks > > > -- Atte, Jesús Antonio Santos Giraldo jeansagi@myrealbox.com jeansagi@netscape.net