Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Session variables in a Pre-session command

Status
Not open for further replies.

marcp2001

MIS
Nov 20, 2002
1
NZ
Hi

I am trying to pass a session variable $$PROCDATE to a pre-session command (The manual indicates that this should work) in a Solaris environment running Powermart 5.1.2

In the shell script I am calling the variable appears as 5162PROCDATE - ie it is not being resolved by Powermart, it is being passed as a literal string and the shell is interpreting $$ as the PID followed by PROCDATE.

Anyone got this to work?
(I trying to create a complex database view which needs a date to be supplied (the date is not known until run-time) so it can be used as a data source in the subsequent mapping)

Thanks in advance
Marc
 
Hello Marc,

I faced a similar problem in one of my mappings. I tried to use the mapping variable in an Unconnected Storedproc as a parameter passed to the Storedproc, but even this didn't work.
Passing session variable in some script, I suppose is possible in PowerCentre. This is another package by itself from Informatica, it seems.
Well even I would like to know if there is any way in PowerMart, to do these things.

Regards

 
marc,

to my understanding, you can't use session variables. But you can use session parameters. Those parameters are also limited to specific fields only in the session properites screen.

Table 5-2. Naming Conventions for User-Defined Session Parameters
Parameter Type Naming Convention
Database Connection $DBConnectionName
Reject File $BadFileName
Source File $InputFileName
Target File $OutputFileName
Session Log File $PMSessionLogFile

I tried using other session parameters apart from the listed above in the pre-, post-session commands, where I faced the same problem what you got. But when I created $DBConnectionName parameter and passed to the session in source and target type, it worked. At the same time if you pass the same parameter to pre-,post-session commands it should work. why can't you try this. create a $DBConnectionName parameter and assign the date value to this parameter in the session parameter file. But do not assign this value to the source and target type. pass this parameter to your comamnd.

Please let me know how you go.

Vijay
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top