Talend- get results from tdb2Row component and insert into another table - db2

I'm running a select count query in a tDB2Row component. I need to get the value found and insert it into another table.
I've tried using the propagate query's recordset, but it doesn't make sense to me.
Also what component would i use next?
Thanks in advance!

Please use tDB2Input component for select query and give schema to it and add tLogRow to it to see the result.
tDB2Row is for dml query like update and delete.
Hope this helps...

Related

Loop through database ANYLOGIC

In my model I want to loop through the database which contains multiple columns (see example) by an event. The idea behind it is that I want to create dynamic events based on the rows in the database.
But I've no clue how to iterate through a database in anylogic and also was not able to find an example of a loop with a database.
The dummycode of my problem would look something like this:
For order in orderdatabase:
Create order based on (order.name, order.quantity, order.arrivaltime, order.deliverylocation)
Where order in the loop is every row of the database, and the value on which the creation is based based on the different column values of that specific row.
Can somebody give me a simple example of how to create such a loop for this specific problem.
Thanks in advance.
Use the database query wizard:
put your cursor into a code field
this will allow you to open the database wizard
select what you need (in your case, you want the "iterate over returned rows and do something" option
Click ok
adjust the dummy code to make it do what you want
For details and examples, check the example models and the AnyLogic help, explaining all options in detail.

Determining Table to Paste to On The Fly

How do I tell Filemaker what table to paste a value into based on the value? Is there a way to somehow have Filemaker paste a value into a table without hard coding the table name?
Using imported transaction data, I determine which ledger (table) the transaction should be posted to. But I can't seem to get the script to then post it into the right table based on the value.
Screenshot of Script
Thanks for the thoughtful suggestions!
I found a way to do what I was thinking, #AndreasT your suggestion helped.
Case (
Imported_Transactions::Debit_To = "Expenses_All"; "Expenses_All::Description";
Imported_Transactions::Debit_To = "Liability_CrCard_BofA"; Liability_CrCard_BofA::Description;
Imported_Transactions::Debit_To = "Liability_CrCard_CitiBusiness"; Liability_CrCard_CitiBusiness::Description;
)
Using the Case function, I was able to get Filemaker to put the data in the right table. It took some doing, but by putting the tablename::field in quotes, it worked.
Ultimately, though, I found it easier to just use one table and field descriptors to store my data. Simplicity makes it easier to produce reports.
You could use the conditional If script step to determine what table to insert data into based on your input.
Set field by name[ tablename::fieldname ; value ]

Results given by stored procedure aren't editable

I would love to have a stored procedure which returns a selection which is editable in phpadmin. For example, something as simple as
SELECT * FROM students
written from the console will allow you to edit the records as far as each row is unique (table with a primary key). However, that same statement within a procedure won't allow it!
The point is that I have a selection that I will be using quite often and it's a bit more complex than the one above. If I copy it and paste it on the console, it's fine, but not so when run from a procedure!
I would appreciate any ideas to work around this limitation.
Thank you in advance!
Thanks to those who read my question. I just figured out that a very simple way to solve this issue is to create a table with my output selection. Then, from the console, I can select and edit whatever I need from that temporary table.
Thanks for your time!

How to run the update query in JPA

I am playframework application developer. I am using createNativeQuery method in jpa to extracting values from tables through select query. I need to use update query. What i have to do and what will be the return type of that method. Please anyone help me. Thanks in advance..
if i use like this it showing error..
Query query=JPA.em().createNativeQuery("update truck set flag='YES' where shipment_upc=:EAN_code");
query.setParameter("EAN_code", EAN_code);
System.out.println(query.getSingleResult());
Use createNativeQuery with your update- query and you will get back a Query- Object.
On it use executeUpdate and you get back the number of updated datas.

How do I get updated row id in ZEND?

I use
$table->update($data, $where);
How do I get updated row id in ZEND?
As with working with just the plain ol' SQL, just re-query for the info you want. Use $table->select('rowid')->where($where) to do this.
from manual :
The return value is the number of
rows affected by the update
operation.
its not what you want. so you need to using select to get the row