SQL: Update fields based on another fields information - oracle

I am trying to automate an UPDATE query based off one columns data and apply that same field to another.
See screenshot:
In this, what I am trying to do is update PCODE from a value of 0 to that of the value shown in SI_PCODE. This would need to be updated by the unique variable of the SALES_QUOTE_ID. I currently do this manually with excel using
update sales_quote_contact set pcode= where sales_quote_id=;
but want to run this automatically through a batch job I have.

Related

Power Automate - Flow adding duplicate entries

I have 2 SharePoint sites (SiteA and SiteB) In siteA I have an excel file called LocationA, when this file is edited (rows added, rows edited or rows deleted) I want to reflect these changes in another excel file called LocationB which is stored in SiteB (I have not added the delete operation yet but suggestions on how I might do so are welcomed).
The issue is that the flow is adding rows instead of updating the existing rows in LocationB.
Please find my flow below (it is running without errors but the output is the problem)
Note
The expression in the filter array is string(items('Apply_to_each')?['ID']) which changes the ID field to String
The expression in condition 2 is empty(body('Filter_array')) this condition checks if the list item exists in excel
Because you are using the action to add a row in the power automate, you need to change the action for example, Update a row. That will work.

How pull in fields value from created parameter

I created a parameter [GroupID] that is used to query several datasets in my SSRS report. It is using the field [GroupID] from my GroupList_Rolling12 dataset. An example of [GroupID] is 77610N. When 77610N is selected, all of my datasets are correctly 'filtering' for this [GroupID].
I now need to create a text box that returns the [GroupName] of [GroupID]. In other words, when 77610N is selected from my GroupID parameter, I want the [GroupName] that is associated with the selected GroupID parameter to display.
I'm still very new to SSRS and cannot figure this out. I tried creating the expression =First(Fields!GroupName.Value, "GroupList_Rolling12") but that did not work since it simply returns the first value from the query.
I also tried =First(Parameters!GroupID.Value(0)) but this also did not work
I also tried this expression =Lookup(Fields!GroupID.Value, Fields!GroupID.Value, Fields!GroupName.Value, "GroupList_Rolling12")
)
Can you please help?
You can reference the parameter label directly like this
=Parameters!GroupID.Label
There is no need to put the index on the end (=Parameters!GroupID.Label(0)) unless your parameter is multi-value, in which case it would select the first selected entry.

Change column type, Laravel

I have a column $table->date('start_date'); , and I want to store data and time so I will need timestamp.
I already have some date in my current table, so I am not sure what to do without deleting existing data.
I find some solutions (on changing data type) that involve doctrine, but from what I read, Supported Laravel Versions is 6.x and I am using 7.
Any solutions?
According to the PostgreSQL documentation you can convert a date to timestamp by using to_timestamp() function
https://www.postgresql.org/docs/8.2/functions-formatting.html
You have two choices :
Create a new column and create a script which convert all entries in the right format
Create a script which update all the datas you need to into the already existing table

Data Envrionments, True DB grids and VB6

I have finally been able to get all the columns I wanted to show up in the data environment and have added an additional command to try and pull those values from a local DB into the grid.
The issue I am running into is the values are not appearing inside my grid.
I have it running the correct command to pull in the data I believe: I took that same query and ran it on the local DB and it does output the values I expect. I then clone the Environment command to a record set.
If gbEnableD2D Then
If DataEnvironment7.rscmdMeterReadsDistinctD2D.State <> adStateOpen Then
DataEnvironment7.cmdMeterReadsDistinctD2D
End If
Else
If gbEnableD2D Then
Set rsDevices = DataEnvironment7.rscmdMeterReadsDistinctD2D.Clone
Else
' Display all the columns I want to display
From there I can determine the columns do show up as intended but in the display as well as using the watching system I can not access the MeterReadsDistinctD2D nor does the record set contain the values but does have the fields I expect.
Any thoughts on to why this would occur or how I could go about tracking down how to determine how I can see if these values are in my data environment or if they are in there why they are not being passed to the record set?
You need to make sure the TrueDBGrid is in Bound Mode, then bind it to a Data Control and set the Recordset/Recordsource of the Data Control to your SQL Query. Make sure the ConnectionString of the Data Control successfully connects to your database.

Informatica cloud: use field in pre/post sql commands

I am trying to delete a set of data in the target table based on a column (year) from the lookup in IICS (Informatica Cloud).
I want to solve this problem using pre/post sql commands but the constraint is I can't pass year column to my query.
I tried this:
delete from sample_db.tbl_emp where emp_year = {year}
I want to delete all the employees in a specific year i get from lookup return
For Ex:
I got year as '2019', all the records in table sample_db.tbl_emp containing emp_year=2019 must be deleted.
I am not sure how this works in informatica cloud.
Any leads would be helpful.
How are you getting the year value? A pre/post SQL may not be the way to go unless you need to do this as part of another transformation, i.e., before or after the transformation runs. Also, does your org only have ICDI, or also ICAI? ICAI may be a better solution depending on the value is being provided.
The following steps would help you achieve this.
Create an input-output parameter in your mapping.
Assign the result of your lookup in an expression transformation to the parameter using SetMaxVariable
Use the parameter in your target pre SQL as
delete from sample_db.tbl_emp where emp_year = $$parameter
Let me know if you have any further questions

Resources