3 Replies Latest reply on Sep 18, 2013 6:54 AM by philmodjunk

    Scrips

    lorenamusser

      Title

      Scrips & Variables

      Post

           I am reviewing a database that has some extensively long scripts; the current script I am reviewing has 800+ steps.  I am thinking about breaking the script out into smaller script chunks...my issue is that it currently uses a lot of local variables throughout the script.  If I move those variables into smaller scrips that are run within the main script, will they carry across or is there another better approach?

        • 1. Re: Scrips & Variables
          schamblee

               If it's not broke why fix it.  Local variables with just $ are only available in the current script.  Global variables with $$ are available in other scripts.

          • 2. Re: Scrips & Variables
            lorenamusser

                 The purpose of reviewing the database is to determine if it is better to rebuild or reuse the current database.  We are leaning towards rebuilding for a variety of reasons.  So looking at how to clean up some of the scripts and make them easier to follow for future updates.

            • 3. Re: Scrips & Variables
              philmodjunk

                   You may find it useful to change some variables from $Local to $$Global as S Chamblee suggested. If you break the large script up into smaller scripts you can also pass data to the script being called as a script parameter and there are several ways to combine multiple values into one script parameter.