Forum Stats

  • 3,837,263 Users
  • 2,262,245 Discussions
  • 7,900,240 Comments

Discussions

GLOBAL variables VS Package variables

User_G4WFE
User_G4WFE Member Posts: 7 Green Ribbon

Hi everyone

I´m using Oracle forms 12.2.1.4

Question: What is best (in performance terms): use GLOBAL variables or Package variables ?


Thanks in advance...

Best Answer

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 7,294 Employee
    Answer ✓

    I don't think "performance" is a factor these days. The performance difference between the two likely would be immeasurable. The real question would be what's the use case. Forms global variables are restricted to being VARCHAR2, where are in a package variables can be just about anything. But again, the savings between the two would be hardly measurable unless you are talking about declaring hundreds or thousands, which does not sound like a good design choice.

    I suppose one advantage of a package variable is that it would be defined in a known place. With Forms globals they can be scattered all over the app, making it potentially difficult to troubleshoot the app in the future (if there were many of them.

    Bottom line is that I don't think any one is better than the other. Use the one that is most appropriate for your use case.

    Just one man's opinion...


    Michael Ferrante

    Senior Principal Product Manager

    Oracle

    Twitter: @OracleFormsPM

    User_G4WFE

Answers

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 7,294 Employee
    Answer ✓

    I don't think "performance" is a factor these days. The performance difference between the two likely would be immeasurable. The real question would be what's the use case. Forms global variables are restricted to being VARCHAR2, where are in a package variables can be just about anything. But again, the savings between the two would be hardly measurable unless you are talking about declaring hundreds or thousands, which does not sound like a good design choice.

    I suppose one advantage of a package variable is that it would be defined in a known place. With Forms globals they can be scattered all over the app, making it potentially difficult to troubleshoot the app in the future (if there were many of them.

    Bottom line is that I don't think any one is better than the other. Use the one that is most appropriate for your use case.

    Just one man's opinion...


    Michael Ferrante

    Senior Principal Product Manager

    Oracle

    Twitter: @OracleFormsPM

    User_G4WFE
  • User_G4WFE
    User_G4WFE Member Posts: 7 Green Ribbon

    Hi Michael

    Very well.

    Thanks you.