4 Replies Latest reply on Jul 22, 2014 6:36 AM by philmodjunk

    Export/Import on $Variable including leading and trailing 0 "zero"

    Emmanuel

      Title

      Export/Import on $Variable including leading and trailing 0 "zero"

      Post

           Hi,

           I am working on this script where I have to Export/Import a $Variable to move records from a table to another. Badly enough, it contains leading and trailing 0 on some of the records.

           It seems to me that I tried every export format possible but zero are still missing which I can see from the import mapping windows while moving from a record to another.

           Do you have a suggestion?

            

           Thank you

            

        • 1. Re: Export/Import on $Variable including leading and trailing 0 "zero"
          raybaudi

               Hi

               also the original field, if number type, hasn't any leading and trailing zeros.
               You could format the field to show them but really they aren't there.

               The solution is to use a text field with a calculation result that writes those zeros.

          • 2. Re: Export/Import on $Variable including leading and trailing 0 "zero"
            RickWhitelaw

                 This begs the question why to move records from one table to another, presumably related, table.

            • 3. Re: Export/Import on $Variable including leading and trailing 0 "zero"
              Emmanuel

                   Hi,

                    

                   Thanks for the quick response. I have to use this export - import method because the tables are not related (rather than using a duplicate script).

                   That is said, the two field, the one exporting and the ont importing the Item No field, are already in text format. For sure I could use a calculation that adds a certain amount of 0s but the issue is that it is only certain records that have them. It is part of already existing data that cannot be modified.

                   So the issue stands... how can I make sure that the information that is export/imported is "as is"? Would a GetasText line or something like that be helping?

              • 4. Re: Export/Import on $Variable including leading and trailing 0 "zero"
                philmodjunk

                     You've answered why you think that import/export is needed as a method to copy the data but not why you think it is necessary to copy the data at all. Often, in relational database design, this is not needed so you may be needlessly complicating the design of your system.

                     "the tables are not related" raises a whole set of additional issues to be answered by "Why aren't they related?"

                     As Raybaudi has stated: The data in the field IS imported as is. It is the formatting of that value that may or may not be imported. Fields of type number do not store leading zeroes. IF you have fields where you have numeric digits preceded by leading zeroes, you either have data in a field of type text or a calculation field with text specified as the result type, not number an it should be imported into a corresponding field of type text.