on 03-22-2012 12:52 PM
Hi,
I need to use sql query in custom code for reminder emails.
I refered below code :
import com.frictionless.api.common.platform.IapiDbHandleIfc; dbHandle = session.getDbHandle(); dbHandle.beginTransaction(); sQuery = "SELECT DOC_DESCRIPTION " + "FROM " + "FCI_CUSTOM_MD2 " + "WHERE " + "EID = '" + sParameter + "'"; dbHandle.executeQuery(sQuery);
But my query would return multiple rows with different types of column data.
What will be the return type of Query Results?
How to fetch multiple rows, where to return them?
Please guide me through.
Thanks,
Saloni
Hi Saloni,
Sounds like you are trying to get the description of the custom master data object. You should be able to do this by calling IAPI method getDocumentDescription().In general, try to find solution that don’t require DBHandle class and it should be considered only as a last resort. In cases where you have a need to use DBHandle class, I would recommend reading the Scripting and Workflow guide on SMP that explains how to use DbHandle class as it has specific coding protocols. If those are not followed it will result in system performance issues.
Regards,
Vikram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vikram,
No, I am not trying to get the description of the custom master data object. I just was trying to use this sample code.
My requirement is to actually execute query that returns pending approvals and then send reminder emails to approvers from returned resultset. I need help on how to write query code in my custom java code class.
I came across dbhandle and dbaccessor methods. But need help on this. Which one is better way to execute the query that returns multiple rows.
Please guide me if you have idea on it.
Thanks,
Saloni
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.