Microsoft Power Automate Condition - power-automate

Dears
Greetings,,
I'm trying to create a Ms flow that uses condition if any one of these employees numbers submit a form consider it as yes others no.
If possible get the chosen employees from the excel table
employees numbers:
1115
1114
2150
2233
3322
5555
etc
more than 50 employees numbers

I would use a Filter Array to check if the single item is part of a Employees numbers array. After that you can check if it has a match.
Belows is an example with a manual trigger to give you an idea of the approach.

Related

Concurrent get timestamp plus sequence from Oracle

background: two application nodes, three Oracle node.
I have a sequence, ddl like this:
CREATE SEQUENCE "XXX_SEQ" MINVALUE 10 MAXVALUE 99 INCREMENT BY 1 START WITH 10 NOCACHE ORDER CYCLE ;
And I use this to generate the id as my primary key
SELECT 'FWK2-' || TO_CHAR(SYS_EXTRACT_UTC(CURRENT_TIMESTAMP), 'YYYYMMDDHH24MISSFF2') || '-' || XXX_SEQ.nextval AS MSG_REQ_ID FROM DUAL;
But when concurrent generate the id, it hit the duplicate issue, in milliseconds it generate the duplicate id.
It is part of the log
2019-09-03 04:40:17,501 FWK2-2019090304401699-43
2019-09-03 04:40:17,010 FWK2-2019090304401699-43
And I checked in the 99 milliseconds, there are no more than 99 msg that would make the sequence cycle to hit the duplicate issue.
I suspect it should be the ddl issue
Dose anyone know about how to optimize it?
actually, in my PROD env, i have 3 application that use this method to generate, and each application has 2 nodes. Suppose 3 application are A,B,C.
A and C has only one place to generate id
B has more than three place to generate id
and one more strange that as my sequence is order, why the id in db is not order?
FWK2-2019090304394159-34
FWK2-2019090304394280-37
FWK2-2019090304394298-35
FWK2-2019090304394311-36
FWK2-2019090304394354-40
FWK2-2019090304394359-38
Update
Although I test with sequence NOCACHE, ORDER, under Jmeter use 3 api, each api 300 threads.
The id would not be order, like this:
FWK2-2019090403025046-67
FWK2-2019090403025046-68
FWK2-2019090403025050-69
FWK2-2019090403025053-10
FWK2-2019090403025053-11
FWK2-2019090403025053-31
FWK2-2019090403025053-39
FWK2-2019090403025053-40
FWK2-2019090403025053-41
FWK2-2019090403025053-42
FWK2-2019090403025053-46
FWK2-2019090403025053-47
FWK2-2019090403025053-70
FWK2-2019090403025053-71
FWK2-2019090403025053-72

Oracle SQL: Replace numbers with variable-length sequences of asterisks

I have a table with employee names and their wages. Now I want to concatenate them in a column. So far so good.
But instead of the normal number (ex. $1200) it needs to show me in the query a star (*) for every $100.
The result should look like this:
Employees and their wage
Smith, **********
Jonson, ******************
Sanchez, *************
I have searched everywhere with every search term which came to my mind. Can it be that it is not possible in Oracle SQL Developer? I use database 11g.
I would be happy if someone could direct me to the right answer. Thanks in advance.
Given a salary value you can create a string of asterisks for every $100 dollars of salary with
RPAD('*', TRUNC(SALARY/100), '*')
SQLfiddle here
Best of luck.

Slow update query in Oracle - what am I doing wrong?

Update queries have never been my strong point, I am hoping someone can help me make a more efficient query?
I am trying to update a table with the total sales for a given product, for a given customer.
The table I am looking to update is the sales column of the below 'Estimate' table:
ID Customer Product Estimate Sales
--------------------------------------------
1 A 303 100 20
2 A 425 20 30
3 C 1145 500 250
4 F 801 25 0
The figure I am using to update is taken from the 'Sales' view:
Product Customer Actual
------------------------------
303 A 30
500 C 2
425 A 88
1145 C 700
The query I have written is:
UPDATE estimate e
SET e.sales = (SELECT s.actual FROM sales s
WHERE e.customer = s.customer and e.product = s.product)
WHERE EXISTS (SELECT 1 sales s
WHERE e.customer = s.customer and e.product = s.product)
An added complication is that 'estimates' exists between a range of dates and need to be updated for sales during that period only. My 'sales' view above take care of that, but I have left this out of the example for simplicity sake.
I initially ran the query using test data of only around 20 records and it ran in around 3 /4 seconds. My actual data is 7,000+ records and when I run the query here, my browser times out before I get any results.
I suspect that the query is updating the whole table for every record in the view or vice versa?
Any help much appreciated.
Cheers
Andrew
Try a merge instead:
merge into estimate tgt
using sales src
on (tgt.customer = src.customer and tgt.product = src.product)
when matched then
update tgt.sales = src.actual;
By doing the merge instead of an update, you negate the need to repeat the query in the set clause in the where clause, which ought to speed things up a bit.
Another thing to check is how many indexes do you have on the estimate table that has the src column in it? If you have several, it might be worth reducing the number of indexes. Each index that has to be updated is an overhead when you update the row(s) in the table.
Also, do you have triggers on the estimate table? Those might be slowing things down as well.
Or maybe you're missing an index on the sales table - an index on (customer, product and sales) ought to help, as the query should then be able to avoid going to the table at all since the data it needs from that table would all be in the index.
Another argument you could have is to not do the update at all. If the information is available in the Sales table, why do you need to bother updating the estimate table at all? You could do that as a join when querying the estimate table. Of course, it depends on how often you'd be querying for the estimate vs actual sales information vs how often they'd be updated. If you update frequently and read infrequently, then I'd skip the update and just query the two tables directly.

Oracle Query for finding non-repeated rows

I will try to put forward this question in a simple way. Consider that I have a table with two columns (Name, Contact_No). We can have the same name but with different Contact No in the table. All I want to know is to find out which name is NOT repeated in the entire table. Or in other words, which name is unique in this table and has appeared only once.. This is just an example, the actual scenario is quite different but if anyone can help me with this example, I'll be able to handle the actual scenario.
Here is an example
Name Contact_No
A 123
A 124
B 125
C 126
C 127
All I want is to find (B) which is not repeated in the entire table. Thanks
You can simply do this:
SELECT name FROM tbl_name GROUP BY name HAVING COUNT(name) = 1
Check Out SQLFIDDLE

How to reduce cost on select statement?

I have a table in oracle 10g with around 51 columns and 25 Million number of records in it. When I execute a simple select query on the table to extract 3 columns I am getting the cost too high around 182k. So I need to reduce the cost effect. Is there any possible way to reduce it?
Query:
select a,b,c
from X
a - char
b - varchar2
c - varchar2
TIA
In cases like this it's difficult to give good advice without knowing why you would need to query 25 million records. As #Ryan says, normally you'd have a WHERE clause; or, perhaps you're extracting the results into another table or something?
A covering index (i.e. over a,b,c) would probably be the only way to make any difference to the performance - the query could then do a fast full index scan, and would get many more records per block retrieved.
Well...if you know you only need a subset of those values, throwing a WHERE clause on there would obviously help out quite a bit. If you truly need all 25 million records, and the table is properly indexed, then I'd say there's really not much you can do.
Yes, better telling the purpose of the select as jeffrey Kemp said.
If normal select, you just need to give index to your fields that mostly you can do, provide table statistic on index (DBMS_STATS.GATHER_TABLE_STATS), check the statistic of each field to be sure your index is right (Read: http://bit.ly/qR12Ul).
If need to load to another table, use cursor, limit the records of each executing and load to the table via the bulk insert (FORALL technique).

Resources