How can i pass database connection details as parameter/variable, using set variables.
Thank you for your help
You may want to look into the below steps and official documents:
To set a variable using Spoon:
In Spoon, select Edit > Edit the kettle.properties file.
In the Kettle Properties window, modify the variable value.
If you want to add a variable, complete these steps.
Right-click on a line number, then select Insert before this row or Insert after this row.
Enter the variable name and value.
If you want to reposition the variable, right-click on the row number again, then select Move Up or Move Down.
Click the OK button.
Add your database properties using the above step.
To Access the variable in your transformation or jobs:
The Get Variable and Get Session Variables steps can explicitly retrieve a value from a variable.
${VARIABLE}
%%VARIABLE%%
Related
Automation Anywhere. How do I pick a value from dropdown. I tried 'set text' from a copied variable. Its very slow, and also doesnt seem to be the right away. I would want to pick a value from the dropdown. Any idea how this can be done ? Thank you
You can use Object Cloning for this.
The process will be like:
Select object cloning and select the window you want to clone.
Capture the object to which you want to select from the drop-down.
Object cloning intelligence will automatically treat this as Drop down, and an extra option like "select Item by text" will appear in the action list. Select that option.
It will only suggest the all the drop down options. Select the required option you want.
Press Save.
That's it.
Thanks
You can do it using 'Manage Windows Controls' AA Command ( in this command make sure you check available checkbox for Capture a control of specific type [select - Drop Down] in next text box) and capture the value from pick list.
in my Access application I have a form and a report. In the form I have my textBoxForm, in the report I have my textBoxReport. Normally, in the textBoxReport I see the textBoxForm value. How can I set dynamically from the report VBA-code the value of the textReport? For example, I want that, if the value in the textForm is 1, the value in the textReport is "ok".
I have already searched a solution in internet, but in all cases I see always an error similar to 'impossible set this value for this element'.
Thank you!
Does your report use a query? If so, you would just place an 'IIF' in the query that tests for the value you want to change, then either changes it to something else, or retains the original value. The below will test field 'Nbr1' for the presence of a 1, and if found, change it to 'OK', otherwise it stays the same.
Note! You will need to change the control source in the report to reflect the name you provide (i.e. 'MyChange') because you can't keep the original name.
SELECT Table1.ID, Table1.EMPID, Table1.TestResult,
IIf([Nbr1]=1,"OK",[Nbr1]) AS MyChange, Table1.Nbr2
FROM Table1;
Am working on creating SSIS Package the does the following, so far my SSIS Package works well to insert records from '.DBF' file from one folder location ONLY (Am using Data Flow Task onto the Control Flow and OLE DB Source/Destination to read a .DBF file and get it inserted). However, am not able to figure out how to make it works with 20 sites, for example: I have 20 '.DBF' files stored in the following structure:
1. E:\DBF Files\Site1\Data\records.DBF
2. E:\DBF Files\Site2\Data\records.DBF
3. E:\DBF Files\Site3\Data\records.DBF
4. E:\DBF Files\Site4\Data\records.DBF
and so on till Site20 (here file name remain the same but the content will differ from site to another).
I have table for 'records.dbf' file in my SQL Server in the following structure:
Records Table:
Product_Name Price FilePath FileName
---------------------------------------------------------------
now here, how can process these files from different sites to be stored in my records sql table with it respective FilePath using SSIS??
P.S File Names will always remain the same and the path will change "Like Site 1"
Grab a For Each Loop container for the SSIS Toolbox and drag it on to the Control Flow designer.
Double click the For Each container to bring up the editor, click the Collection tab from the left-hand menu
Leave the Enumerator set at Foreach Item Enumerator and click the Columns button in the lower right.
Click the Add button and just go with the defaults which should be Column 0 and String. Click OK to return to the previous dialog. In the new Column 0 column add your folder paths one per row.
Next click the Variable Mappings tab from the left-hand menu, for the drop-down menu in the Variable column select New Variable. Again go with the defaults except for the name which in my example I have called dbf_path.
Next click OK to complete the For Each. Now the difficult bit for me because I don't what tasks you currently have that are working for one file. Whatever it is you have working, select it with the mouse and then drag and drop it into the For Each container.
For each task or tasks that need to use the file path do the following:
double click it to edit, in the left-hand menu select Expressions, then click Expressions and then click the ellipsis.
From the Property drop-down in the Property Expression Editor you need to find the property that would hold the file path for this task. The names are not always obvious and can be called different things in different tasks. In my example I am using a File System Task which I think is the Source Property.
Click the ellipsis in the Expression column and add an expression that consists of your path variable concatenated a string that contains the name of your file. One thing to note is backslashes have special meanings so if your string contains any they must be escaped with a second backslash.
Now when you run the package the For Each will loop through each path you have defined and store it in your variable which tasks will reference.
I am trying to use a variable that I am updating in a loop inside an expression in SSIS. I am going to trying to be as clear as possible. Before to arrive to the last Data Flow Task (where I have a ODBC source), I am getting some values inside the variable (Return) that I am going to use in the [ODBC Source].[SqlCommand], with the second Script Task I could checked that the variable is been updating in the way I need. The problem is that in the Data Flow the expression is taking into account this variable but with the Default value that I have choosen ('').
In the first Script task I am updating the variable:
Dts.Variables["Return"].Value = Dts.Variables["Return"].Value + identif;
So, I do not know if I missed a previous indication or what could be happening with the execution of this control flow
The Variables window will not show you the value of the variable at the end of package execution. You need to set breakpoints and use the local window to "catch" the value of the variable before and after it changes.
Breakpoints Example
I have a package with a single script task.
The code inside is this...
new string strReturn = "NewValue";
public void Main()
{
// TODO: Add your code here
Dts.Variables["Return"].Value = strReturn;
Dts.TaskResult = (int)ScriptResults.Success;
}
The code sets the my SSIS variable equal to NewValue. To catch this variable changing values I will set breakpoints. To set breakpoints, right-click the Script Task and select Edit Breakpoints.
Set a Pre and PostExecute breakpoint. Save and then execute the package. When it reaches the breakpoint, it will pause. The first pause is PreExecute event, just before the script is about to execute. During this pause, you can enter the name of your variable into the locals window.
You will see that the value has not changed yet. Press the continue button to move to the next breakpoint, PostExecute. Now, the Script Task has been executed. Check the local window and you should see that the value has changed!
Notice that throughout each of these the top left Variables window never shows an updated value. It always shows '' . You must use breakpoints to see a variable value changing. Hope this helps you to debug your package!
I've started using QTP last weekend so I'm still a bit confused about some things.
I've coded a function that opens an URL on IE, performs some actions and writes a report. But I have a little problem: at a certain point the function has to click on a button to go on but this button's value is changed at every refresh of the page.
For example: at the first access the button's value (or label) is "Results List (51)" but, if I refresh the page, the value becomes "Results List (11)".
What changes is the number inside the brackets (that identifies the number of results inside the list).
Obviously I recorded the action only one time and the result is this:
Browser("myBrowser").Page("myPage").Frame("myFrame").WebButton("Results List 51)").Click
How can I click on the button without having to worry about it's value?
You should open the object repository and have a look at the description that was create for your WebButton then make the property in question a regular expression.
In your case the value should be Results List \(\d+\), this means Result List followed by open-parentheses, followd by one or more digits (a number) followed by close-parentheses.
Here's an explanation on how to use regular expressions in UFT.
This question reminded me of the days when I was a beginner in QTP ;) I think I still am!
Coming to your question -
If you don't really care about what is inside the brackets then you can just give Results List*.* but if you want to check if there is a bracket and digits within it then use the value suggested by Motti i.e. Results List (\d+)
Detailed Steps as you are a rookie:
1) Go to Resources->Object Repository
OR
In the Resources pane expand your action and double-Click the local object repository (You recorded hence the objects will be in local)
2) Click on the Concerned Object so that the object properties specific to this object is displayed.
3) Select the property (name?), at the extreme right you will see a button to configure the value, click on it.
4) Type the text Results List (\d+) or Results List*.*, select the checkbox for regular expressions.
5) A message box will appear, Click on No and then OK button.
Your script should run now!