Passing variable in XML topology in ODI - oracle-data-integrator

I am trying to parameterized the topology connection in ODI to load multiple xml of same structure one by one using variable.But i am getting unknown token error.
Jdbc url :jdbc:snps:xml?f=U:/SOTI_CLOUD/#B.xml
{ #B is ODI variable having file name)

Try using #GLOBAL.B if it is a Global variable or #<PROJECT_NAME>.B if it is a project variable.
Also check what is your history setting for that variable. If it is set on "No History", make sure you are declaring/refreshing the variable within the same session in which you want to access that XML file.

Just a hunch…
For the variable to be picked up in JDBC URL you need to launch a separate scenario. Your problem might be different but make sure you have an outer loop with variable declare/refresh and whenever you refresh/increment it you launch a separate scenario (not just an interface) where you load data using such constructed URL.

Related

update source code of react through azure pipeline

I have created a react environment variable in .env file and is able to update it through command prompt or power shell now my aim is to update it through azure pipeline so add a powershell script.But I am not able to figure out how to read or write data in .env file through a azure pipeline powershell script. I wish to change base url for differnet envirnoments dev stage prod (base_url_dev = https://projectName.dev.azurewebsites.net/). Please let me know If there is any other way
You would commit your file like this:
base_url = '#{base_url}#' (never commit enivornment specific values into Source Code)
And then set a base_url variable in each AzDo Stage to the actual value. (You can also use stage scoped variable groups)
in each stage, use a replacetokens step and target your .env file to replace the #{base_url}# to the actual value you declared for each stage.
update source code of react through azure pipeline
We could remove the base url from the .env file, then use a Inline powershell task to set the base url via Logging Command:
Write-Host "##vso[task.setvariable variable=REACT_BASE_URL;]$(REACT_BASE_URL)"
Then define the variable REACT_BASE_URL with different value for different stages in the Variables tab:
Alternatively, just like michiel said, we could use the task Replace Tokens to update the value in the .env file.
Change the base_urls values to #{REACT_BASE_URL}#`:
REACT_BASE_URL = #{REACT_BASE_URL}#
Then, also defined the variable REACT_BASE_URL with different value for different stages in the Variables tab.
And add the task Replace Tokens in the pipeline:

Looping with multiple variables in a URL using Postman

Using postman tool, I am trying to loop in multiple values in the place of a specific parameter 'memid' in the sample URL https://www.testdomain.com/login?memid=123
I have replaced the value '123' as {{id}} in the URL and then declared a single value '123' in Globals. It's working fine when I execute this. But, is there a way where I can loop the URL and replace the variable memid every time with some other predefined unique values? Should I be storing all the values in a separate csv file?? Thanks in advance.
You could take a look at using a Data file in the Collection Runner to help with this - More information can be found here.
https://learning.getpostman.com/docs/postman/collection_runs/working_with_data_files/

Store XML retrieved value as string variable for use in child package

I would like to store an XML retrieved value as a string variable for later use in a child package within SSIS. The situation is as follows:
I'm retrieving an ID from an XML file in a data flow task (A). I need to save this ID as a variable so I can pass it later on to a child package via package configurations and use it there. The issue is that with the 'Recordset Destination', I can only store it as an object type, and then I can't seem to convert it in my child package to a string again.
I think that I can solve this with a foreach loop, but I don't feel like this is very performant. Is there any other way to do this? I attached some screenshots to make the situation a bit more clear.
Thanks!
Screenshots
You can use a Script Component to Store the ID value in a variable, Just add the script component as destination, select the variable as Read\Write variable in the script form. And assign a value to this variable in the PostExecute() function inside the Script Editor.
You can refer to one of the following link for more information:
How to use variables in a Script Component
Using Variables in the Script Component
Read and Write variables in a Script Component in SSIS (SQL Server Integration Services) using C#

Unable to evaluate the expression. An error occurred that usually indicates a corrupt installation (code 0x80004002)

I use Visual Studio 2015 and SQL Server 2016 and also I use COZYROC component for SSIS for working with SFTP.
I what move all files between two folder in SFTP. For that. I have created a variable (V_FilesNameList) with object data type. Then, I have used a COZYROC SFTP Task for getting the list of files name on SFTP server:
This is a configuration for above component :
Then, I have created a foreach loop on my variable (V_FilesNameList).
And inside the loop I want to change the name of each file and copy it to the new address.
But I have this error :
Error: ForEach Variable Mapping number 1 to variable
"User::V_File_Name_Old" cannot be applied.
Error: ForEach Variable Mapping number 919997528
to variable "껤ʧ" cannot be applied.
And when I want to watch the value inside the my variable (V_FilesNameList) in Watch windows, I have this error :
V_FilesNameList Unable to evaluate the expression. An error occurred
that usually indicates a corrupt installation (code 0x80004002).
If the problem persists, repair your Visual Studio installation via
'Add or Remove Programs' in Control Panel.
Why I have those errors? And how can I move the files between two folder in SFTP server with SSIS?
And how can I move the files between two folder in SFTP server with
SSIS?
Download Files (File Transfer Task CozyRoc) to your file system inside some folder (configurable Project Parameter)
Now using the Foreach Loop Container (Set Enumerator -> ForEach File Enumerator ) get complete file path for each file.
Using File Transfer Task move file to the SFTP.
Using File System Task delete all files from the local folder (Where files are download in step 1).
Check the Variable Mappings in your foreach loop container, if the object V_FilesNameList contains a list string of file names, then the variable in your Variable Mappings should be in string data type, so that they could be mapped correctly. I am guessing your mapped variable variable 껤ʧ is not set correctly.
I had the error to variable "껤ʧ" cannot be applied when I was working with a ForEach loop container too. The problem is with NULL's in the ResultVariable. Try to handle the NULLS returned from source. In my case, the object variable was populated from a query so all I had to do was use ISNULL sql function.

Foreach Loop Container failed to traverse through all files in a folder

I have one temp folder C:\Mydata inside that i have .csv files with name
demo1.csv demo2.csv...etc
Now I want to insert data from all those files into database table
for this I have taken Foreach Loop Container in the property Directory I mention
C:\Mydata
inside Foreach Loop Container taken a Data Flow Task in that Flat File Source is there in the connection manager property in file name what should I mention, so that it will traverse through all folder and all files whose extension is .csv
I did like C:\DEMO\*.csv which is giving me error :
no file found path is wrong
From what i interpreted, your issue was assigning the resulting file from the foreach to the connector.
To do that you need to assign the filename from the Foreach to a variable.
The first step to be taken is to create the variable. To do that you need to activate the "Variables" window:
Then you need to create a new variable of type string and rename it.
For more information on SSIS variables and how to create them, see http://msdn.microsoft.com/en-us/library/ms140216.aspx
Now you need to assign the new variable (in this case i named it "filename") to the foreach loop:
NOTE THAT WHILE THE OPTION "Name Only" IS SELECTED IN THE FIRST WINDOW, IN YOUR CASE YOU PROBABLY WANT "Fully Qualified"!!
The screenshot was taken from a working project i have and i am using only the name (Name Only) as opposed to the full path (Fully Qualified)
After doing that you need to assign that variable to your flat file connector using expressions:
Which version of MSSQL and SSIS are you using? And why are you using C:\Mydata in one place and C:\DEMO in another?
The basic technique of looping over files is described here.
There is lot of information about these steps in the documentation and on the web. If you need more help, please be as specific as possible about what you've tried, what isn't working, what versions you're working with etc.

Resources