September 25, 2006, 09:26 PM
focusqueenALPHA file format in WebFocus 7
I have a program that selects student ID numbers and then holds the list as an ALPHA output file. The students are selected using SQL within my .fex file. When I look at the output file, there appears to be the length of the field displayed first and then the id number on each line. How do I get rid of the length that is showing? I didn't have this problem in our previous version of WebFocus.
September 25, 2006, 09:34 PM
PiipsterI would expect that the numbers are AnV format ... variable length. You'll have to look at the settings available for your relational adapter to control how variable length fields are dealt with.
September 26, 2006, 08:06 AM
Tony Afocusqueen,
Several ways you can do it. I'll use a ficticious column "student_number" as an example -
Method 1
SQL SQLMSS SET VARCHAR OFF
Method 2
SQL
SELECT CAST(student_number AS CHAR(12)) AS student_num
;
Method 3
TABLE FILE SQLOUT
PRINT student_number/A12
ON TABLE SAVE AS whatever
END
Hope this helps
T
September 26, 2006, 08:10 AM
Tony AWhoops, missed at least one
-
SQL
SELECT CONVERT(VARCHAR(12), CHAR(12), student_number) AS student_num
;
T
September 26, 2006, 09:16 AM
focusqueenYou guys are awesome. The select cast(student_number as char(12)) as student_num worked great. Thank you so much!!!
September 26, 2006, 09:34 AM
Tony AYou are most welcome.
I suppose the advantage of the chosen resolution is that, should WF revert to forcing non-varchar then the CAST will not fail whereas the COVNERT may have done so. That and the fact that you are only applying the conversion to one actual column.
T