Oracle Apex 20.2 (IR): How I can get selected row(s) and process its data through a function - select

please somebody guide how to process selected row(s) from Interactive Report to execute a function one-by-one which return success/failure result (like update select employee's information etc.)

Related

Crystal Reports - Order of execution of multiple commands

I would like to know if there's a way to alter the order of how the commands in a report are executed.
The commands are not linked between them in any way.
For instance, I have two commands:
Command 1: Obtains a common list from a table. (Select * from Customers)
Command 2: Obtains footer information. (Select version, logo from ReportInfo)
I would like Command 2 executing first and then Command 1.
Is it possible to configure in CR the order of execution of the commands. Now it's executing in the order the were created. But i would like to customize them.
Thanks.
Crystal Report version 13.0.4
You can use Subreports. They would process in the order of their location within the main report.
It is not clear why you need to control the order of execution. Perhaps combine the whole logic into a single VIEW or STORED PROCEDURE instead of using multiple Commands.

Get value from Measure in OLAP Cube and Insert it in a SQL table

I need help with the the following:
I got an OLAP Cube, let's call it "company_prod" on "server\instance"
That Cube has (among many) a calculated member called "[Measures].[Value]"
One of the Dimensions in the Cube is for time (Year, Month, Date and so on). e.g. [TIME].[Y_M_D].[YEAR].&[2020]
Our main frontend is Excel, where we retrieve Data from the Cube with CUBEELEMENT, CUBEVALUE etc.
We got some measures which unfortunately, when I update the Excel report now and show numbers for last year, the result is different when I update that same report in a few weeks or months. This is something I won't be able to change and in some reports it's the desired behaviour because underlying data from SAP is changed and sometimes valid_from and valid_to dates are changed retroactively.
Now I want to get the value from my "[Measures].[Value]" on a certain date, let's say April 1st. I then want to insert the value I get on April 1st for 2020 in a SQL table. This should be done by an agent job that executes a stored procedure or runs a dtsx package or anything else, whichever works.
I hope it's clear what I am trying to accomplish...
If you can create linked servers from your SQL Server to SSAS Server, then you can run your MDX query against the linked SSAS Server using OPENQUERY and save the result directly to the SQL Server table.
i.e.,
INSERT INTO <your table>
EXECUTE <your mdx statement> AT <linked server>
You can add the run the above via your SQL Agent job on schedule.

Customer SQL USING SELECT COUNT(*) in TABLEAU RETURNING ZERO

I'm using TABLEAU Datasource option to run Custom SQL "Select count() from table_name. It is based on a ODBC connection. Unfortunately, I have 400 tables that I need to run my script with 400 lines of "Select count()" , Tableau is not returning the total # of records and is only returning ZEROs. I'm using the Edit Custom SQL option from the Datasource Tab.
I have tried using the View Result after Opening the Edit Customer SQL and selecting the View Result to get the total count. My plan was to include all he 400 select counts in one script and run it. It worked fine as a part of my connection to another database but not ODBC.
SELECT COUNT(*) FROM ACCOUNTING_BOOKS
The expected result should be,
Select Edit Customer SQL
View Result
Get a listing of counts.
According to this answer count isn't available as a NetSuite function. You might want to follow the link in that article (if you have a NetSuite account) to see if this has changed.

Crystal report that auto-emails to vendors in Parameter

This is a little bit of a stretch, but we're trying to convert old reports in an increasingly unstable Access Database and I have a question.
Here's what the report does in Access currently:
The user gets prompted for one of our many Suppliers in a drop down style list
Once the supplier is entered, that Suppliers list of parts will be populated
The report then pulls an email address from our system (IFS) and emails the list that has been populated to the email in our files.
We've made a SQL Query that will pull in the information that we need to replicate the report, but we're at a sort of cross-roads with how to get it to automatically go through the list of Suppliers that are in the Parameters and send off the email to them all automatically.
Would there be an easier way to do this in Crystal Reports (2011) besides automating the report and selecting all the parameters manually or in Oracle SQL Developer through maybe a WHILE LOOP?
Thanks in advance, and if you need any more information, I'll try and clarify!
This looks like a data driven report ( publication). You will run a query to retrieve the list if suppliers and their emails then run a report for each record returned by the query. Let say you have a report , which accepts a parameter SupplierID and the query returns data like this
SupplierID SupplierEmail
ID=1 email=supplierA#mail.com
ID=2 email=supplierB#mail.com
ID=3 email=supplierC#mail.com
The software will get row #1 and will use ID=1, as a parameter for Suppliers report, will export the report and will send the exported file to supplierA#mail.com. Then it will move to the next row and will use ID=2 as a parameter for the next run of the same report, export it and send it to supplierB#mail.com. The same will happen for row #3. You can check also this video, which demonstrates the proces: http://www.r-tag.com/Pages/Preview_CreateBatchJob.aspx .
Because the values for report parameters, emails etc are returned by the query this approach is known as data driven report ( publication).
Data driven publications are available in SSRS if you own SQLServer Enterprise license. There are other types of software who support them. The sample video above is from R-Tag, which could be useful too and supports SSRS, Crystal reports and SQL Ad-hoc queries. If you use Ad-hoc query you can export suppliers data to Excel without creating a special report.

Get un retrieved rows only in DB2 select

I have an BPM application where I am polling some rows from DB2 database at every 5 mins with a scheduler R1 with below query -
- select * from Table where STATUS = 'New'
based on rows returned I do some processing and then change the status of these rows to 'Read'.
But while this processing is being completed, its takes more than 5 mins and in meanwhile scheduler R1 runs and picks up some of the cases already picked up in last run.
How can I ensure that every scheduler picks up the rows which were not selected in last run. What changes do i need to do in my select statement? Please hep.
How can I ensure that every scheduler picks up the rows which were not selected in last run
You will need to make every scheduler aware of what was selected by other schedulers. You can do this, for example, by locking the selected rows (SELECT ... FOR UPDATE). Of course, you will then need to handle lock timeouts.
Another option, allowing for better concurrency, would be to update the record status before processing the records. You might introduce an intermediary status, something like 'In progress', and include the status in the query condition.