7 Replies Latest reply on Feb 13, 2011 7:18 AM by unieater

    Multiple Database files and and passing parameters to other databases.

    unieater

      Title

      Multiple Database files and and passing parameters to other databases.

      Post

      I've have many non-related databases (by design), but occassionally I want to pass a variable (or many) to that database and run a script within that structure.  I understand the basic functions of parameter passing, and can do so by "performing script" with the parameter box filled (i've figured out a way to pass multiple parameters and then parse on the other side too).  But I can't seem to access another database with open database command and also pass a parameter.

      Anyone out there have any suggestions?  I know how to make this work when I identified the database as an external souce, and also have created a relationship, but my problem stems from no-related fields within both databases (again by design).

      I'm using Filemaker Pro 11 Advanced on Mac. 

      Thanks in advance for your help.

        • 1. Re: Multiple Database files and and passing parameters to other databases.
          RickWhitelaw

          Hmm . . . just a stab in the dark here, but I suspect it's not possible to pass a parameter to an unrelated file or table. I can't imagine why the tables of your files would not be related somehow. What's the point given we're dealing with relational databases?

          RW

          • 2. Re: Multiple Database files and and passing parameters to other databases.
            Sorbsbuster

            I was expecting you to say you were using something like FM5 when you said you had learned how to build up and parse out strings of parameters - with FM11 you can define a list of variables and pass them between scripts, saving you the parsing work.  (Doesn't answer your question about file-to-file, though.)

            • 3. Re: Multiple Database files and and passing parameters to other databases.
              philmodjunk

              But I can't seem to access another database with open database command and also pass a parameter.

              There's really no connection between using Open File to open the other database and performing a script in that other file while passing it a parameter.

              You should be able to just use Perform Script and specify that other file. If the file is not already open, it will be opened by this script step automatically.

              THere are a few details you have to watch out for in order to get this to work. Can you describe in more detail how this is not working? Moving the second file to a different location or renaming a folder that contains it are two possibile ways this might fail here.

              • 4. Re: Multiple Database files and and passing parameters to other databases.
                unieater

                Thanks all for details:

                Sorbsbuster:  If you can direct me to any documents, links or websites outling the process of defining a list and passing between scripts, I would appreciate it.

                Rick Whitelaw:  Example of why you have multiple non-related databases.  Primary reason is database size management and script management.  If you have created unique functionality that you don't want to copy into a table of one database, you simply pass parameters to the other database and execute your scripts there.(maybe I'm missing something in size management here)

                PhilModJunk: To answer your third paragraph regarding detail, when I open the new database none of the $$variables pass with it.  When I pass parameters in a Perform Script, it works fine until the line Open File...at which point it no longer has a functional Get ( Script Paramerter ) capability.

                Perhaps the process of defining a list and passing between scripts satisfies my requirements.... unfortunately I can't find any documentation regarding it's usage and only learned about it by questioning the group.

                Thank you all for the suggestions....

                • 5. Re: Multiple Database files and and passing parameters to other databases.
                  RickWhitelaw

                  "Rick Whitelaw:  Example of why you have multiple non-related databases.  Primary reason is database size management and script management.  If you have created unique functionality that you don't want to copy into a table of one database, you simply pass parameters to the other database and execute your scripts there.(maybe I'm missing something in size management here)"

                  I don't understand how relating the tables  of different files would affect database size. As well, in the times in which we live, drive space and bandwidth are relatively inexpensive, even if what I suggest does increase file size. Just curious I guess . . .

                  RW

                  • 6. Re: Multiple Database files and and passing parameters to other databases.
                    philmodjunk

                    When I pass parameters in a Perform Script, it works fine until the line Open File...at which point it no longer has a functional Get ( Script Paramerter ) capability.

                    Why do you have Open File at all? I don't see what that step does for you here. In any case, I've never seen any reports nor experienced any issues myself with that script step affecting the function of Get (ScriptParameter).

                    There are several ways to build multiple values into a list. My preferred method is to use an expression in the Parameter box like this:

                    List ( value1 ; value 2 ; value 3)

                    The Value1, value2... parameters in this list can be references to fields, variables or a calculation that computes a value to be passed in the list.

                    In the script performed I then prefer to put these script steps at the beginning of my script:

                    Set Variable [$Parameter1 ; Value: GetValue ( Get ( ScriptParamter ) ; 1 ]
                    Set Variable [$Parameter2 ; Value: GetValue ( Get ( ScriptParamter ) ; 2 ]
                    Set Variable [$Parameter3 ; Value: GetValue ( Get ( ScriptParamter ) ; 3 ]

                    and so forth...

                    While not strictly necessary, I like the way this "declares" my parameters at the beginning of the script--which makes it easier to set up future perform script calls to this script with a correct parameter list.

                    • 7. Re: Multiple Database files and and passing parameters to other databases.
                      unieater

                      PhilModJunk: Thanks.  The list function is much cleaner than what I was doing.  Very nice.  Greatly appreciate.

                      All: Still have question about passing parameters to other databases, but given I have size constraints around storage, it looks like i have to find a different solution.  I appreciate everyones feedback.