Results 1 to 2 of 2

Thread: Long File Names

  1. #1
    Join Date
    Apr 2004

    Question Unanswered: Long File Names

    How can I convert long file names into short file names using PL/SQL? Is there any library or function to do this?
    EX: "Oracle scripts 001.sql" >> "ORACLE~1.SQL"

  2. #2
    Join Date
    Nov 2002
    Desk, slightly south of keyboard

    Without some external calls you're never really going to have a satisfactory conclusion to this. The algorithm to convert it is fairly straightforward (remove illegal characters, take leftmost resulting six characters, add a tilda and a '1' followed by the original file extension.

    The problem is that many different long filenames resolve to identical short file names so you need to test for existence of the short filename and start incrementing the final '1'. To test for the existence of the file you would need Extproc or Java calls.

    The problem occurs much later on when you have successfully changed....

    'oraclefilea.sql' to 'oracle~1.sql'
    'oraclefileb.sql' to 'oracle~2.sql'

    and you are left with just the resulting short name.... which one relates to which original long name? You would need to manage this somewhere.

    Please don't email me directly with questions. I've probably just got home from the pub and cannot guarantee the sanity of my answers. In fact, I can't believe I actually made it home.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts