Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003

    Unanswered: How to access parallel port in PL/SQL

    Hello all,
    The next code opens the parallel port and writes there some special character which gives the order to the cash drawer to open,
    how to rewrite this code in PL/SQL.

    lport = lpt1 'parallel port
    Sub openCashDrawer() ' Cash Drawer open
    Open lport For Output As #2
    Print #2, Chr$(27) & Chr$(112) & Chr$(0) & Chr$(33) & Chr$(33)
    Print #2, Chr$(27) & Chr$(112) & Chr$(1) & Chr$(33) & Chr$(33)
    Close #2
    End Sub


  2. #2
    Join Date
    Aug 2003
    Where the Surf Meets the Turf @Del Mar, CA
    Provided Answers: 1
    >how to rewrite this (opening parallel port) code in PL/SQL?
    The answer is with some degree of difficulty.
    To do so you'll need to either create/use an EXTERNAL PROCEDURE or JAVA;
    because you need to get out of the PL/SQL engine & back to the OS.
    Examples of both can be found at
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

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

    As you're writing straight ASCII, you might try using the supplied UTL_FILE package. I have no idea whether Oracle would support allowing or using LPT1 as a file, but theoretically atleast, it would be possible.

    There are plenty of threads about regarding UTL_FILE.

    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