Page 1 of 1

Does the Postgres Destination Support User Variables?

Posted: Thu 04 Aug 2016 20:36
by sxwalsh55
I'm using the SSIS Postgres flow components, and I don't see anywhere that a user variable can be used in the source table field. This is useful to me because I'd like to be able to use a variable to control the target schema of the flow components of my package.

So far it looks like I need to open up every data flow and make all schema changes manually when switching back and forth between environments, which we control with schemas.

Thanks

Re: Does the Postgres Destination Support User Variables?

Posted: Fri 07 Oct 2016 20:01
by Shalex
Sorry for the delay.

Please define your parameter (for example, with name=TODAY and expression=GETDATE() ) via SSIS > Variables menu of Visual Studio.

Devart PostgreSql Source: you can use newly created parameter in the query in the following way

Code: Select all

select * from MyTable where LastModifiedDate='<@User::TODAY>'
Devart PostgreSql Destination: create an additional component Derived Column (the Common tab in SSIS Toolbox)
some source -> Derived Column -> Devart PostgreSql Destination
Now you can drag&drop User::TODAY to the bottom surface within Derived Column Transformation Editor to create a new Input Column for Devart PostgreSql Destination (map it via the Column Mappings tab).

Does this help?

Re: Does the Postgres Destination Support User Variables?

Posted: Sat 14 Sep 2019 14:38
by Shalex
The possibility to set object name via user variable in destination components is implemented: viewtopic.php?f=60&t=39336.

After you created the variable named tableName, set ObjectName=User::tableName in the destination component.