Forum Discussion

kmiesse's avatar
kmiesse
Contributor
8 years ago

Dynamic DB Account Use Cases

What are the use cases of dynamic database accounts if we can’t use pipeline parameters or fields in the input document to specify the host name, port number, database name, user name or password?

14 Replies

  • shodge's avatar
    shodge
    Former Employee

    For a dynamic account, you can use pipeline parameters (though not fields in the document). When you create a dynamic account (take from MySQL):

    You can toggle those fields with = into expressions and insert the name of the _pipelineParam that you want the field to be filled from.

    Is that what you were looking for?

    Thanks,

    Shayne

    • kmiesse's avatar
      kmiesse
      Contributor

      Yes, thanks! Not sure what I was doing wrong when dynamic accounts first came out but I just tried the param again and it worked. That’s good enough!

      • nganapathiraju's avatar
        nganapathiraju
        Former Employee

        What others have done is read these properties from a file or database and call the child pipelines passing these parameters through pipeline execute.

        Hope that makes sense.

  • I’m sorry, I don’t create the dynamic account programmatically. But here is an example of how I set it up with the dynamic Hostname and Database name:

  • rakesh_2004's avatar
    rakesh_2004
    New Contributor

    Thanks for the details. Did you pass the parameters from pipeline parameters? I have cretaed a parent pipeline where i have read the parameters from a file and then passing them to child pipeline where i have the MySQL execute snap. In the account tab of My SQL execute i want to create a connection dynamically by using the parameters coming from parent pipeline which are coming from the file.

    • rakesh_2004's avatar
      rakesh_2004
      New Contributor

      I tried it access pipeline parameters where i have host name , port name , db name, user and password but the parameters are not available when i am trying to create the Dynamic connection. Any help will be very much appreciated.

      • kmiesse's avatar
        kmiesse
        Contributor

        Make sure you name the pipeline parameters without the leading underscore but when you refer to them in the child pipeline or account settings use the leading underscore.
        Make sure you can do this without the parent/child to eliminate any issues passing from parent to child. Just try it with one pipeline containing the snap set to the dynamic account.

    • kmiesse's avatar
      kmiesse
      Contributor

      I just have the MySQL snap set to your-account-name dynamic MySQL account and the pipeline that has the MySQL snap has the pipeline parameters YourHostName and YourDBName. I also do pass these parameters from a parent pipeline to a child pipeline where the child contains the MySQL snap with the dynamic SQL account.

  • CKARKHANIS's avatar
    CKARKHANIS
    New Contributor

    Hi,
    I am new to SnapLogic and thus have a very basic question. This topic gives the solution in bits and pieces but I am looking for a little more detail. Basically I am building a set of ~40 pipelines to load tables. The connection I need on the source side (Oracle) needs to be dynamic in that I should be able to use the same set of 40 pipelines in test and prod environments. I’d like to maintain a file (JSON?) where I define the db connection details for test and prod environments. How can I go about setting this up? All help is appreciated!

    • dimitri_hristov's avatar
      dimitri_hristov
      Contributor

      Hi @CKARKHANIS,

      One approach would be to create an expression library, and then include that expr. lib. in the pipelines where you’d want to use it. In the expr. lib. you’d need to define, say, the name and location of the account for the Oracle Snaps. Then you can use that in the Account reference property of the Snaps.

      The setting up and usage of expression libraries is covered here.

      BR,
      Dimitri