Re: Bug in PL/SQL *NOTE* Please try the following!

From: Daryl Erwin <derwin_at_mach2.wlu.ca>
Date: Mon, 15 Feb 1993 18:53:02 GMT
Message-ID: <C2I74F.BEp_at_mach1.wlu.ca>


In article <casivils.729466354_at_node_508ba> casivils_at_lescsse.jsc.nasa.gov (craig sivils) writes:
>In <C28q7J.5wL_at_mach1.wlu.ca> derwin_at_mach2.wlu.ca (Daryl Erwin) writes:
>
>>On Sequent, Oracle 6 Forms3.0 , PL.SQL in a Procedure.
>>Ill try to demonstrate...
 

>>I have a CHAR field called x.
 

>>In :x I have stored '1<CR><CR>' (ie 1 and two carriage returns.
 

>>if I do length(:x) it is 3. Correct.
>>Now, in PL/SQL I have a variable y 'char(50)'.
>>y := :x;
 

>>length(y) = 3. Correct.
>>now
>>:x := y;
>>length(:x) = 1. WRONG!
 

>>Can this be done!
>>How can I force the assignment of y to :x be be ALL 3 characters?
 

>>HELP!
>
>This is just a guess, (my machine doesn't do that), try the copy procedure.

I cant get the copy procedure to work at all so.....

Well, Craig and others can you try running this on your machine. I just got the standard answer from ORACLE Support "It works for me - Upgrade!".

Here is a demo of the bug. Can you run this on your machine and see what answer you get. For input type "abc<cr><cr>". And the lengths should be 5 in every case of the message displayed. (but alas it isnt for me)

---CUT HERE---
/* Copyright (c) 1988 by the Oracle Corporation */

SQL*FORMS_VERSION = 03.00.16.07.01
TERSE = ON DEFINE FORM    COMMENT = <<<
   Purchase Order Entry



   1-23-92 Ver 1.1 - Added address tpye to the list field values on the
                     short key and the id fields.
   1-24-92 Ver 1.2 - Added a new field xtmpohd_dept_title to allow them to
                     override the department description
   1-28-92 Ver 1.3 - Increased QTY by 2 and decreased Description by 2.
                     If american vendor then american currency.
   2-11-92 Ver 1.4 - Added preliminary budget check pop-up window    2-13-92 Ver 1.5 - Fixed problem with taxes reverting back to old values
                     when passing through blocks (gst_forced, pst_forced
                     are lost when a query is done on the block)
   09-Apr-92 Ver 1.6 - Allow them to override the address type on the
                       address
   09-Apr-92 Ver 1.7 - Check department & fund combination
   14-Apr-92 Ver 1.8 - Problem with detail being deleted when Prv Block
   27-Apr-92 Ver 1.9 - Only do budget checking on Op Fund
   21-MAy-92 Ver 1.10 - Problem in CALC_TAXES, type in Tax Code G & not H
   17-Jun-92 Ver 1.11 - Blanket Order Indicator Y or N - used on XAAINVC.
   15-Dec-92 Ver 2.0 - Removed Approvals
                     - Allow multiple copies of a Purchase Order
                     - Removed bar codes (just the indicator)
                     - Added header comments
                     - added received indicator capability
                     - added print flag
   13-Jan-93 Ver 2.1 - Dont abort if no User/Password is given simply dont
                     - print the PO
                     - If an error occurs dont generate a second PO number
   27-Jan-93 Ver 2.2 - Fixed problem with EDIT_COMMENTS and its inablity
                     - to handle SQL substr on LONG character fields
   >>>

   NAME = TEST
   TITLE = XAAPORD
   DEFAULT_MENU_APPLICATION = DEFAULT    DEFINE PROCEDURE

      NAME = MYPROC
      DEFINITION = <<<
      procedure MYPROC is
      temp char(3000);
      begin
          message('Prior length=' || to_char(length(:myfield)));
          temp := :myfield;
          message('Length temp=' || to_char(length(temp)));
          :myfield := temp;
          message('After length=' || to_char(length(:myfield)));
      end;
      >>>

   ENDDEFINE PROCEDURE    DEFINE BLOCK

      NAME = MYBLOCK
      DESCRIPTION = XTMPODT
      ROWS_DISPLAYED = 1
      BASE_LINE = 1
      LINES_PER_ROW = 16
      ARRAY_SIZE = 0
      ORDERING = <<<
      where XTMPODT_POHD_NO = 'TMP' ||
                 substr(userenv('sessionid'),
                      greatest(1,length(userenv('sessionid'))-9),6)
      >>>

      DEFINE FIELD

         NAME = MYFIELD
         DATATYPE = CHAR
         LENGTH = 200
         DISPLAY_LENGTH = 21
         QUERY_LENGTH = 0
         MANDATORY = ON
         PAGE = 1
         LINE = 4
         COLUMN = 24
         HELP = Enter a desc. for the product as it would appear on PO. Press [Edit] to add more
         AUTOHELP = ON

         DEFINE TRIGGER

            NAME = KEY-STARTUP
            TRIGGER_TYPE = V3
            TEXT = <<<
            edit_field(15,4,52,9);
            MYPROC;
            >>>

         ENDDEFINE TRIGGER

      ENDDEFINE FIELD

   ENDDEFINE BLOCK    DEFINE SCREEN       DEFINE PAGE

         PAGE = 1
         PAGE_XS = 0
         PAGE_YS = 0
         PAGE_PX0 = 0
         PAGE_PY0 = 0
         PAGE_PXS = 0
         PAGE_PYS = 0
         PAGE_SX0 = 0
         PAGE_SY0 = 0

      ENDDEFINE PAGE

      DEFINE PAGE

         PAGE = 2
         POPUP = ON
         DISSOLVE = ON
         PAGE_XS = 25
         PAGE_YS = 1
         PAGE_PX0 = 0
         PAGE_PY0 = 0
         PAGE_PXS = 25
         PAGE_PYS = 1
         PAGE_SX0 = 55
         PAGE_SY0 = 15

      ENDDEFINE PAGE

      DEFINE PAGE

         PAGE = 3
         POPUP = ON
         DISSOLVE = ON
         PAGE_XS = 19
         PAGE_YS = 13
         PAGE_PX0 = 0
         PAGE_PY0 = 0
         PAGE_PXS = 19
         PAGE_PYS = 13
         PAGE_SX0 = 35
         PAGE_SY0 = 7
         MODE = TEXT
         LINE = 2
         BOILER = <<<
            No   Bar Code
         >>>
         MODE = BOX
         BOILER = <<<
          p---------------q
          |               |
          |               |
          |               |
          |               |
          |               |
          |               |
          |               |
          |               |
          |               |
          |               |
          |               |
          b---------------d
         >>>

      ENDDEFINE PAGE

      DEFINE PAGE

         PAGE = 4
         POPUP = ON
         DISSOLVE = ON
         PAGE_XS = 80
         PAGE_YS = 3
         PAGE_PX0 = 0
         PAGE_PY0 = 0
         PAGE_PXS = 80
         PAGE_PYS = 3
         PAGE_SX0 = 1
         PAGE_SY0 = 11
         MODE = TEXT
         BOILER = <<<
         - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                    End Use:
         >>>
         MODE = BOX
         LINE = 3
         BOILER = <<<
         <------------------------------------------------------------------------------>
         >>>

      ENDDEFINE PAGE

      DEFINE PAGE

         PAGE = 5
         POPUP = ON
         DISSOLVE = ON
         PAGE_XS = 80
         PAGE_YS = 12
         PAGE_PX0 = 0
         PAGE_PY0 = 0
         PAGE_PXS = 80
         PAGE_PYS = 12
         PAGE_SX0 = 1
         PAGE_SY0 = 11
         MODE = TEXT
         BOILER = <<<
         - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
         >>>
         LINE = 6
         BOILER = <<<
          Use <<##>>                                                           Press
             for                                                              [Commit]
           standard                                                         when complete
           comments
         >>>

      ENDDEFINE PAGE

      DEFINE PAGE

         PAGE = 6
         POPUP = ON
         DISSOLVE = ON
         PAGE_XS = 25
         PAGE_YS = 1
         PAGE_PX0 = 0
         PAGE_PY0 = 0
         PAGE_PXS = 25
         PAGE_PYS = 1
         PAGE_SX0 = 55
         PAGE_SY0 = 15

      ENDDEFINE PAGE

      DEFINE PAGE

         PAGE = 7
         POPUP = ON
         BORDER = ON
         DISSOLVE = ON
         PAGE_XS = 78
         PAGE_YS = 7
         PAGE_PX0 = 0
         PAGE_PY0 = 0
         PAGE_PXS = 78
         PAGE_PYS = 7
         PAGE_SX0 = 2
         PAGE_SY0 = 5
         MODE = TEXT
         BOILER = <<<
                              ** Preliminary Budget Check **
         >>>
         LINE = 3
         BOILER = <<<
           FSYR  Dept  Title                                     Budget $ Avail
         >>>
         LINE = 5
         BOILER = <<<
                     Enter Deparment code and [Enter] or [Exit] to leave
         >>>

      ENDDEFINE PAGE

      DEFINE PAGE

         PAGE = 8
         POPUP = ON
         DISSOLVE = ON
         PAGE_XS = 80
         PAGE_YS = 22
         PAGE_PX0 = 0
         PAGE_PY0 = 0
         PAGE_PXS = 80
         PAGE_PYS = 1
         PAGE_SX0 = 44
         PAGE_SY0 = 15

      ENDDEFINE PAGE

      DEFINE PAGE

         PAGE = 9
         POPUP = ON
         DISSOLVE = ON
         PAGE_XS = 25
         PAGE_YS = 1
         PAGE_PX0 = 0
         PAGE_PY0 = 0
         PAGE_PXS = 25
         PAGE_PYS = 1
         PAGE_SX0 = 55
         PAGE_SY0 = 15

      ENDDEFINE PAGE

      DEFINE PAGE

         PAGE = 10
         POPUP = ON
         PAGE_XS = 80
         PAGE_YS = 5
         PAGE_PX0 = 0
         PAGE_PY0 = 0
         PAGE_PXS = 80
         PAGE_PYS = 5
         PAGE_SX0 = 56
         PAGE_SY0 = 13
         MODE = TEXT
         LINE = 2
         BOILER = <<<
          Discount  %  Disc.  Amt
         >>>
         MODE = BOX
         BOILER = <<<
         <------------------------------------------------------------------------------>
         >>>

      ENDDEFINE PAGE

      DEFINE PAGE

         PAGE = 11
         POPUP = ON
         PAGE_XS = 80
         PAGE_YS = 5
         PAGE_PX0 = 0
         PAGE_PY0 = 0
         PAGE_PXS = 80
         PAGE_PYS = 5
         PAGE_SX0 = 56
         PAGE_SY0 = 13
         MODE = TEXT
         LINE = 2
         BOILER = <<<
         PST/Unit      PST Amount
         >>>
         MODE = BOX
         BOILER = <<<
         <------------------------------------------------------------------------------
         >>>

      ENDDEFINE PAGE

      DEFINE PAGE

         PAGE = 12
         POPUP = ON
         PAGE_XS = 80
         PAGE_YS = 5
         PAGE_PX0 = 0
         PAGE_PY0 = 0
         PAGE_PXS = 80
         PAGE_PYS = 5
         PAGE_SX0 = 56
         PAGE_SY0 = 13
         MODE = TEXT
         LINE = 2
         BOILER = <<<
         GST/Unit    Gst Amount
         >>>
         MODE = BOX
         BOILER = <<<
         <------------------------------------------------------------------------------>
         >>>

      ENDDEFINE PAGE

      DEFINE PAGE

         PAGE = 13
         POPUP = ON
         PAGE_XS = 80
         PAGE_YS = 12
         PAGE_PX0 = 0
         PAGE_PY0 = 0
         PAGE_PXS = 80
         PAGE_PYS = 12
         PAGE_SX0 = 1
         PAGE_SY0 = 11
         MODE = TEXT
         BOILER = <<<
         - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
         >>>
         LINE = 6
         BOILER = <<<
                                                                               Press
                                                                              [Commit]
                                                                            when complete
         >>>

      ENDDEFINE PAGE

   ENDDEFINE SCREEN ENDDEFINE FORM ---CUT HERE--- Received on Mon Feb 15 1993 - 19:53:02 CET

Original text of this message