5 Replies Latest reply: Aug 7, 2011 1:15 PM by GJW1 RSS

    Wrap utility not working

    GJW1
      Hi,

      I am trying to wrap some source code using the version of wrap included with the 11g Express Edition but I always get an empty file created. I am running on Windows.

      I am running the following command line:
      C:\oraclexe\app\oracle\product\11.2.0\server\bin\wrap.exe iname=C:\Temp\get_date_string.sql oname=C:\Temp\get_date_string.plb
      There are no errors in the output:
      PL/SQL Wrapper: Release 11.2.0.2.0- Beta on Sat Aug 06 21:04:24 2011

      Copyright (c) 1993, 2009, Oracle. All rights reserved.

      Processing C:\Temp\get_date_string.sql to C:\Temp\get_date_string.plb
      The contents of the get_date_string.sql file:
      CREATE OR REPLACE FUNCTION get_date_string RETURN VARCHAR2 AS
      BEGIN
      RETURN TO_CHAR(SYSDATE, 'DD-MON-YYYY');
      END get_date_string;
      /
      I have tried compiling the function straight into the database and it runs successfully.

      Does anyone have any ideas why I am getting problems?

      Graham
        • 1. Re: Wrap utility not working
          clcarter
          Not seeing the problem, using xp pro SP3 ...
          $ wrap iname=mysql.sql
          
          PL/SQL Wrapper: Release 11.2.0.2.0- Beta on Sat Aug 06 18:30:46 2011
          
          Copyright (c) 1993, 2009, Oracle.  All rights reserved.
          
          Processing mysql.sql to mysql.plb
          
          $ type mysql.plb
          CREATE OR REPLACE FUNCTION get_date_string wrapped
          a000000
          b2
          abcd
          abcd
          abcd
          abcd
          abcd
          abcd
          abcd
          abcd
          abcd
          abcd
          abcd
          abcd
          abcd
          abcd
          abcd
          8
          6f ae
          nFyz0XQ0hI8R8Iy+Nwi7ZbmBWekwg8eZgcfLCNL+XlquYvSuoVah8JbRPpdHDOrnwLK9spte
          58d0wDO4dGUJuHSLwMAy/tKGrPJGzsbWFCGs79ZMdoRxMo53THH1EHNz9e83Z0zr7Nk9cumv
          VSoUHBT9LHbTXSnBSNempgzqLFE=
          
          /
          
          $ sqlplus /nolog
          connect ... passwd ...
          @mysql.plb
          Function created.
          
          SQL> select get_date_string from dual;
          GET_DATE_STRING
          ----------------
          06-AUG-2011
          Same result when adding oname=...

          What are you using to create your .sql file? notepad?

          Edited by: clcarter on Aug 6, 2011 6:44 PM
          add compile and test
          • 2. Re: Wrap utility not working
            GJW1
            Hi,

            I create my files in Notepad.

            EDIT: Wrap doesn't work when I use SQLDeveloper to edit the sql file.

            I have tried updating my path to be only the XE install directory:
            echo %PATH%
            C:\oraclexe\app\oracle\product\11.2.0\server\bin
            But the output file still is not created.

            I wonder if the problem is to do with me running Windows 7?

            Graham

            Edited by: Graham on Aug 6, 2011 10:24 PM
            • 3. Re: Wrap utility not working
              clcarter
              running Windows 7?
              Could be the issue, although I'm not finding any relevant support notes on the wrap utility. One mentions the 10g client doesn't include wrap.exe, another on HP OpenVMS needs an environment setting for wrap to work, that's it. I'm on xp pro so can't help much to verify if that is the trouble or not.
              doesn't work when I use SQLDeveloper to edit the sql file
              So maybe something in the .sql file might be interfering- what about starting up a brand new notepad session and try pasting in the DDL, might be some non-printing characters in the file introduced by SQLDeveloper that keep wrap.exe from working.

              Only other possibility I can think of for Windows, could be permissions related if your computer user isn't in local admins and/or the ORA_DBA group. I have a hard enough time remembering how to get to local groups on xp no idea how to check that for win7.
              • 4. Re: Wrap utility not working
                orafad
                clcarter wrote:
                Only other possibility I can think of for Windows, could be permissions related ...
                This might be it.

                To op: Try starting command prompt with ctrl+shift + click (on Cmd.exe start menu item), to start with elevated privs. Might be a problem writing to C:\Temp\ or similar.
                • 5. Re: Wrap utility not working
                  GJW1
                  orafad wrote:
                  This might be it.

                  To op: Try starting command prompt with ctrl+shift + click (on Cmd.exe start menu item), to start with elevated privs. Might be a problem writing to C:\Temp\ or similar.
                  That's fixed it for me.

                  Thanks,
                  Graham