Focal Point
[SOLVED] convert alpha to integer

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8987033136

June 07, 2013, 02:07 PM
cs_source
[SOLVED] convert alpha to integer
I seem to have a mental block but can someone assist me on converting an Alpha field into an integer?

i extract data from a source and it can only extract as alpha, i have to remove a character which i did and i'm at the point where i would ned to convert the field to an integer but can't seem to do this. I'm trying to create a define field in the synonym

This message has been edited. Last edited by: <Kathryn Henning>,


WebFocus 8.02, SQL Server 2008r2
June 07, 2013, 02:41 PM
Spence
DEFINE FILE EMPLOYEE
EMPID/I9 = EDIT(EMP_ID);
END
TABLE FILE EMPLOYEE
PRINT EMP_ID AS 'A9 FORMAT'
EMPID AS 'I9 FORMAT'
BY LAST_NAME AS 'LAST NAME'
END


WF 8 version 8.2.04. Windows.
In focus since 1990.
June 07, 2013, 02:51 PM
Spence
You can add a DEFINE to the synonym.
DEFINE EMPID/I9 = EDIT(EMP_ID); ,$


WF 8 version 8.2.04. Windows.
In focus since 1990.
June 07, 2013, 03:33 PM
Vivian
All of these things are documented in the WebFOCUS Keysheet Release 8.0.2. It is such a great quick reference guide --- You will save so much time! Why beat your head against the wall, when you can have the answer right at your fingertips. You really should check it out.

Vivian
www.aviter.com


Vivian Perlmutter
Aviter, Inc.


WebFOCUS Keysheet Rel. 8.0.2
(Almost) 1001 Ways to Work with Dates thru Rel. 8.0.2
Focus since 1982
WebFOCUS since the beginning
Vivian@aviter.com

June 07, 2013, 04:40 PM
Tony A
CS

Look for the SQL prefix to include SQL functions in synonyms. Works like a dream in passing to RDBMS.

Something like -
DEFINE MYINT/I9 = SQL.SUBSTR(column, 2, 9); $

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
June 07, 2013, 05:39 PM
cs_source
Hello Spence,Vivian,Tony,

Thank you for the reply these will really help me and i will certainly look more into the documentation.

Thanks again Smiler


WebFocus 8.02, SQL Server 2008r2