In netsuite suitescript Can I get the results from MR script from Reduce and Map function? - mapreduce

I have sent some Item to MR script and process some operation on them. I want a detail summary of which passed and which failed with reason in client side.

Till Now my Solution is :
Create a custom Record with two fields MR_token and Result.
on MR summarize Event . Save the details to the the Record.
and in Client-side open a Suitelet which shows the results in a sublist

Related

Ajax call returned server error ORA-01403: no data found for APEX Interactive Grid

I am trying to save data into my table using an interactive grid with the help of custom plsql. I am running into an "ORA-01403-no data found" error while inserting data and I can't figure out why.
This is my plsql custom process which I run. Appreciate your help.
DECLARE
em_id NUMBER;
BEGIN
CASE :apex$row_status
WHEN 'C'
THEN
SELECT NVL (MAX (emergency_id), 0) + 1
INTO em_id
FROM emp_emergency_contact;
INSERT INTO emp_emergency_contact
(emergency_id, emp_id, emergency_name, emergency_relation
)
VALUES (em_id, :emp_id, :emergency_name, :emergency_relation
);
WHEN 'U'
THEN
UPDATE emp_emergency_contact
SET emergency_name = :emergency_name,
emergency_relation = :emergency_relation
WHERE emergency_id = :emergency_id;
WHEN 'D'
THEN
DELETE emp_emergency_contact
WHERE emergency_id = :emergency_id;
END CASE;
END;
So far I have not come across any documented way on how to use custom PL/SQL logic for processing submitted rows of APEX 5.1 Interactive Grid via AJAX call.
You are getting no data found error because the return is expected to be in certain json format.
The example you have provided is not too complex and can be with done using standard "Interactive Grid - Automatic Row Processing (DML)" process, which is an AJAX approach. If AJAX call is not important then you can create your own PL/SQL process with custom logic. Example of which is demonstrated in "Sample Interactive Grids" package application, check out Advanced > Custom Server Processing page in this application for more information.
I agree with Scott, you should be using a sequence or identity column for ids.
Not entirely sure. A 'select into' can raise a no_data_found exception, but yours shouldn't.
That being said, you shouldn't have max(id)+1 anywhere in your code. This is a bug. Use a sequence or identity column instead.
I have gotten this many times so the first thing I do is go look at any columns in my grid sql that are not part of the "Save", they are from a join for data only.
I just got it again and it was a heading sort column that I had as a column type of "Number". I changed it to display only and the "Save" now works.
Although, I had already set the "Source" of the column to "Query Only" which is also needed.
It is a bummer the Ajax error message doesn't at least give the column name that caused the error.
Hope this helps someone..
BillC
Add a RETURNING INTO clause after the insert. IG expects a primary key to be returned to query the inserted row.

Unix command in informatica

My Requirement is to get source counts,target counts and the rows that did not get changed that gets loaded via informatica.(Example:: Source::100, Target::50,Ignored(No change)::50)
I need to achieve this using presession and postsession command task.Can anyone help me with the scripts.
Thanks for the help in Advance
try to grep the information from the session log which gets created for every run. If you are still looking for the script, let me know.
example :
if you go to the bottom of the session log you see session load summary like below
SESSION LOAD SUMMARY
Output Rows [44768], Affected Rows [44768], Applied Rows [44768], Rejected Rows [0]
do cat log file name | grep 'Output Rows' in post session command
Why don't you use the metadata tables, write a Unix script on the infa server to get the count of SuccessfulRow count and all other counts you want from it and call it using postsession cmd which will also help you build an alert mechanism in for the number of count you get using mail -x. just see the below illustration.
Let me know if you need more details on this.
Short Answer: Refer to REP_SESS_Logs table in Informatica metadata repository Database.

How do I save the web service response to the same excel sheet I extracted the data from?

For example:
The given sample HP Flights SampleAppData.xls and using the CreateFlightOrder, we can link the data to the test functions and get a OrderNumber and Price response from the Web Service. And in the SampleAppData.xls Input tab, we can see that there is a empty column of OrderNumber.
So here is my question, is there any ways that I can take the OrderNumber response and fill the empty column in SampleAppData.xls?
My point to do this is because, let's say I have many test cases to do and will take days, and today I do this certain test and I would need the result of today for the next day's test.
Although I know that the responses are saved in the result but it beats the point of automation if I am required to check the response for each and every test cases?
Yes of course you can. There are a number of ways to do this. The simplest is as follows.
'Datatable.Value("columnName","sheetName")="Value"
DataTable.Value(“Result”,”Action1”)=“Pass”
Once you have recorded the results in the Datasheet, your can export them using
DataTable.ExportSheet("C:\SavePath\Results.xls")
You can write back the response programatically , if you already imported mannually .
You can use GetDataSource Class of UFT API , it will work like this lets say you imported excel from FlightSampleData.xls, and named it as FlightSampleData, you have sheet, accessing the sheet will be like below:
GetDataSource("FlightSampleData!input).Set(ROW,ColumnName,yourValue);
GetDataSource("FlightSampleData!input).Get(ROW,ColumnName);
for exporting you can use ExportToExcelFile method of GetDataSourse class after your test run . Please let me know if you have any furthur question about this.

SSIS Webservice Task Variable

Wonder if someone could help me here. I am trying to download data using Webservice task. The data supplier has a limit of 1000 records per call and asked us to iterate through the whole data set using the "select" and "skip" parameters. "For example to select the first 1000 records in the data set you should set the select parameter to 1000 and the skip parameter to 0. To select the next 1000 records you should set the select parameter to 1000 and the skip parameter to 1000. You should continue to do this until 0 records are returned to you to get the whole data set."
I am not sure how i can implement this in Webservice task using for loop or foreach loop? any help or tips will be greatly appreciated.
Many thanks
I don't see any options within the foreach loop as the enumerator supports no sort of dynamic HTTP connection. So if it is possible, it should be done somehow using a script task that will defines a list of url's that your loop is able to iterate over, after which for each of the iterations, the url from de dynamic list is linked in a dynamic connection that can be used in the web service task inside the foreach loop.
It might that you want to consider program this task fully in the script task and store the result in a SQL table.

trigger Informatica workflow based on the status column in oracle table

I want to implement the below scenario without using pl/sql procedure or trigger
I have a table called emp_details with coulmns (empno,ename,salary,emp_status,flag,date1) .
If someone updates the columns emp_status='abc' and flag='y', Informatica WF 1 would be in continuous running status and checking emp_status value "ABC"
If it found record / records then query all the records and it will invoke WF 2.
WF 1 will pass value ename,salary,Date1 to WF 2 (Wf2 will populate will insert the records into the table emp_details2).
How can I do this using the informatica approach instead of plsql or trigger?
If you want to achieve this in real time, write the output of WF1 to a message queue and in the second workflow WF2 subscribe to the message queue produced from WF1.
If you have batch process in place. Produce a output file from WF1 and use this output file in WF2. You can easily setup this dependency using job schedulers.
I don't understand why do you need two workflows in the first place. Why not accomplish emp_details2 table updates with the very same workflow that is looking for differences.
Anyway, this can be done using indicator file:
WF1 running continously should create a file if any changes have been found.
WF2 should be running continously with EventWait set to wait for the indicator file specified above. Once found it should use the Assignment Task to rename/delete the file and fetch the desired data from source and populate the emp_details2 table.
If you need it this way, you can pass the data through the indicator file
You can do this in a single workflow, Create a dummy session which which check for the flag in table after this divide the flow into two based on the below link conditions,
Flow one: Link condition, Session.Status=SUCCEEDED and SOURCE_SUCCESS_ROWS(count)>=1 then run your actual session which will load the data
Flow two: Link Condition, Session.Status=SUCCEEDED and SOURCE_SUCCESS_ROWS=0, connect this to control task and mark the workflow as complete.
Make sure you schedule the workflow at Informatica level to run continousuly.
Cheers