Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] CSV suppressing leading zeros on varchar

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] CSV suppressing leading zeros on varchar
 Login/Join
 
Gold member
posted
I have a column defined in the database as VARCHAR2(6). The column contains some values with only numbers ie 000123 and others with letters as well ie. 12345A. In HTML and XLS these print as expected. In CSV, 000123 is seen as a number and the leading 0's are being deleted and aligned right, while the values with a letter at the end are aligned left. This causes an issue when a customer wants to upload the CSV file with 123 instead of 000123 in the column. I've tried to define the column as A6, and it still deletes the leading zeros in the affected rows. I've found a work-around by formatting the column to 000000 after it has opened. Or concatenating double quotes around the column. Any suggestions that would be invisible to the user?

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.0.08
Solaris
HTML, PDF, XLS, CSV
 
Posts: 55 | Registered: September 08, 2010Report This Post
Expert
posted Hide Post
If you open the file in Excel the leading zeros will indeed be suppressed, but if you open the file in a text editor, you will see the leading zeros.

DEFINE FILE CAR
TEST_COL/A6 = IF COUNTRY EQ 'JAPAN' THEN '000123' ELSE '12345A';
END

TABLE FILE CAR
PRINT
COUNTRY
TEST_COL
ON TABLE HOLD AS BASEAPP/HTEST1 FORMAT COMT
END


If it's Excel you're worried about, you could force it to leave the leading zeros by prefixing the value with an apostrophe, unfortunately it will be visible until you click and press enter in the cell.

SET HOLDLIST=PRINTONLY

DEFINE FILE CAR
TEST_COL/A6 = IF COUNTRY EQ 'JAPAN' THEN '000123' ELSE '12345A';
END

TABLE FILE CAR
PRINT
COUNTRY
COMPUTE TEST_COL_LEAD/A7 = '''' || TEST_COL;
ON TABLE HOLD AS BASEAPP/HTEST2 FORMAT COMT
END


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] CSV suppressing leading zeros on varchar

Copyright © 1996-2020 Information Builders