Data passed from Java to a PL/SQL function

OK, I am at the beginner-to-intermediate level when it comes to PL/SQL...and a virtual novice when it comes to Java, so please forgive me if my question seems strange or naive.
We are developing a Java-based web app. Some of the screens are reminiscent of a spreadsheet-type layout--potentially LOTS of rows and LOTS of columns (actually, an open-ended # of rows/columns--the rows represent a particular 'thing' and the columns represent the dates on which that 'thing' occurred), where the user can check off any and all the cells that apply. We are also 'auditing' all database activity (who did what to the data, and when). The approach we have chosen is as follows: When the user clicks save, the first thing we do is 'inactivate' all of the existing active rows in the db for that screen, whether or not they have changed(i.e., there is an 'active' flag that we set to false & we also save the user id of the person making the change and the date time of the change). Then the Java code calls the database once per row/contiguous column unit. For instance, on a single row, if the user checks off columns 1-4 and 7-15 and column 21 the Java code will send three calls to the database for that row with info about the start/stop column for each unit.
OK--here is my concern...the majority of the time there will be a reasonably small #of 'units'. Occasionally there will be a moderate, and once in awhile a LARGE # of 'units'. So, let's take an extreme case and say that currently the db has 200 such row/contiguous column units for a given screen. The user goes into that screen and adds the 201st unit, then clicks Save. Java calls the db to first inactivate the 200 rows. Then one by one Java calls the db to add the rows back in, only on row #40, the internet connection is lost. The only way the user can tell what happened is to look at the entire screen and reverify ALL the data in order to tell what got saved/resaved and what didn't. Obviously this is a bad situation that we want to avoid.
I should add that the reason this approach was chosen is that the Java developers thought it would be way too complex in this situation to track the changes the user made on the screen, sort out what has been added/modified/deleted, and only call the db for changes.
So given this background, can anyone offer any suggestions/ideas on how we can prevent unintended data loss given the auditing constraints and concern about minimizing complexity on the Java side (redesigning the GUI screen is NOT an option, as the users are very attached to this design)?
Is there a way for Java to pass a multidimensional (& variable-sized) array to a PL/SQL function? Can Oracle's complex (row, table) data types be used in a function's parameter string, and if so...how?...Or else is there some way we can send a single call to the db on a screen like this one? We thought of calling the db once and sending one very large string packed with all the data (could get very big, not sure of Oracle's limatations on passed data--is it 32K for varchar2? )
Advice, ideas, even random thoughts would be greatly appreciated!

Tracy,
<quote>… only on row #40, the internet connection is lost. The only way the user can tell what happened is to look at the entire screen and reverify ALL the data in order to tell what got saved/resaved and what didn't</quote>
That would be "the only way" if the Java programmers had decided to totally bury the error … what should happen here is the end-user should get a proper error message … no need to re-verify at this point since all bets are off (in fact, nothing should’ve been changed in the database).
Nonetheless, your concerns regarding the chosen approach are valid … making multiple calls to the database after a Save makes controlling a business transaction rather complex (in an n-tier system) … they should make one call only to the database passing in all the data to be saved … one database transaction … either all changes get applied or none.
The fact that lots of data may need to be passed in for one Save is of no relevance … if you have to carry 500Kb of data for that screen then, well, you have to do it … 1 bucket of 500Kb or 50 buckets of 10Kb? … it doesn’t really matter as far as the actual transport part is concerned.
As already answered, one can pass complex types in pl/sql … so one database call per Save would be my first random thought. There are lots of suspect things in here … some things you didn’t mentioned at all … like how is concurrency addressed? … have you/they implemented some sort of optimistic locking mechanism? Of course the architecture of your system won’t be solved in a forum … so, finding a good system/data/Oracle architect on site for the project would be my second random thought.
PS. One last random thought … fight off that idea of packing and sending large strings (XML or not) … if the data is structured then contemplate XML for no more than few seconds.

Similar Messages

  • Passing parameters from java jdbc to pl/sql

    I’m calling stored procedures from java jdbc… but looking for nicer interfaces in terms of passing data. Has anyone come up with a good way to pass data from java jdbc to pl/sql without passing a million parameters? I’m thinking here of some type of structure like pl/sql rowtype or table index type or something else. Has anyone tried to create typed objects in oracle databases and access them from java?
    Thanks, Patrick Caldwell

    Hi Patrick,
    Yes, I have created an Oracle object type, which I successfully returned to a java class, from a PL/SQL stored function, using JDBC. Environment was J2SE 1.3.1, with Oracle 8.1.7.4 on SUN [sparc] Solaris 7 with Oracle's JDBC (thin) driver. It was a while ago, so I don't remember the details very clearly, but I recall being able to figure it out quite easily using the Oracle documentation and the sample code available at Oracle's Technet Web site.
    Hope this has helped you.
    Good Luck,
    Avi.

  • How to change a date value from "java.util.Date" to "java.sql.Date"?

    Hi all,
    How to change a date value from "java.util.Date" to "java.sql.Date"?
    I m still confusing what's the difference between them.....
    thanks
    Regards,
    Kin

    Thanks
    but my sql statement can only accept the format (yyyy-MM-dd)
    such as "select * from xx where somedate = '2004-12-31'
    but when i show it to screen, i want to show it as dd-MM-yyyy
    I m using the following to change the jave.util.Date to str and vice versa. But it cannot shows the dd-MM-yyyy. I tried to change the format from yyyy-MM-dd to dd-MM-yyyy, it shows the wrong date in my application.
         public String date2str(java.util.Date thisdate)     {
              if (thisdate != null)     {
                   java.sql.Date thissDate = new java.sql.Date(thisdate.getTime());
                   return date2str(thissDate);
              }     else     {
                   return "";
         public String date2str(java.sql.Date thisdate)     {
              if (thisdate != null)     {
                   SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                   return sdf.format(thisdate);
              }     else     {
                   return "";
         public java.util.Date str2date(String thisdate)     {
              String dateFormat = "yyyy-MM-dd"; // = 1998-12-31
              java.util.Date returndate = null;
              if (thisdate != null)     {
                   SimpleDateFormat dateFormatter = new SimpleDateFormat(dateFormat);
                   try {
                        returndate = dateFormatter.parse(thisdate);
                   } catch (ParseException pe) {
                        System.out.println (pe.getMessage());
              return returndate;
         }

  • How to accept date parameter from java if SP have the datatype as DATE

    Dear Gurus,
    I have written SP as below
    CREATE OR REPLACE PROCEDURE proc1
    No NUMBER,
    StartDate DATE,
    EndDate DATE
    AS
    BEGIN
    DBMS_OUTPUT.PUT_LINE('Start Date ='||to_char(StartDate,'YYYY-MM-DD HH24:MI:SS'));
    DBMS_OUTPUT.PUT_LINE('Start Date ='||to_char(EndDate,'YYYY-MM-DD HH24:MI:SS'));
    END;
    If I want to pass date from java code to above SP. Then how to send Date to SP from Java code.
    Means if I print that date in SP then it should be print as it is what i sent from java.
    e.g. Start Date = 2008-02-01 00:00:00
    End Date = 2008-02-01 23:59:59
    Could any one help me in above issue.
    Regards
    Sanjeev Atvankar

    Yes, because there is no default date format in oracle for date value having time part.
    Suppose your agreed date format between java and pl/sql is DDMMYYYYHH24MISS.
    You create procedure as:
    CREATE OR REPLACE PROCEDURE proc1
    No NUMBER,
    StartDate VARCHAR2,
    EndDate VARCHAR2,
    AS
      v_start_date date := to_date(startdate,'DDMMYYYYHH24MISS');
      v_end_date date := to_date(enddate,'DDMMYYYYHH24MISS');
    BEGIN
    /* YOU can use local pl/sql date variables inside your plsql code*/
    DBMS_OUTPUT.PUT_LINE('Start Date ='||to_char(StartDate,'YYYY-MM-DD HH24:MI:SS'));
    DBMS_OUTPUT.PUT_LINE('Start Date ='||to_char(EndDate,'YYYY-MM-DD HH24:MI:SS'));
    END;
    /

  • USB data manipulation from Java to all OS

    Hello currently I'm developing on a software where I need to detect the USB Device and get access to the data send from the USB Devices. I googled but couldn't find the perfect library for usb for all platform. My program is used by many clients of different platform but I couldn't find solution. Please do you have known any library for this?
    Thanks in advance.

    Tracy,
    <quote>… only on row #40, the internet connection is lost. The only way the user can tell what happened is to look at the entire screen and reverify ALL the data in order to tell what got saved/resaved and what didn't</quote>
    That would be "the only way" if the Java programmers had decided to totally bury the error … what should happen here is the end-user should get a proper error message … no need to re-verify at this point since all bets are off (in fact, nothing should’ve been changed in the database).
    Nonetheless, your concerns regarding the chosen approach are valid … making multiple calls to the database after a Save makes controlling a business transaction rather complex (in an n-tier system) … they should make one call only to the database passing in all the data to be saved … one database transaction … either all changes get applied or none.
    The fact that lots of data may need to be passed in for one Save is of no relevance … if you have to carry 500Kb of data for that screen then, well, you have to do it … 1 bucket of 500Kb or 50 buckets of 10Kb? … it doesn’t really matter as far as the actual transport part is concerned.
    As already answered, one can pass complex types in pl/sql … so one database call per Save would be my first random thought. There are lots of suspect things in here … some things you didn’t mentioned at all … like how is concurrency addressed? … have you/they implemented some sort of optimistic locking mechanism? Of course the architecture of your system won’t be solved in a forum … so, finding a good system/data/Oracle architect on site for the project would be my second random thought.
    PS. One last random thought … fight off that idea of packing and sending large strings (XML or not) … if the data is structured then contemplate XML for no more than few seconds.

  • 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

  • Data extraction from SAP r/3 to sql 2000, bpc server

    Hi All,
    I have posted a similar thread previously,sap r/3 to sql 2000/2005, and understood how to transfer data from SAP R/3 to SQL 2005, but I need to transfer data from SAP R/3 to SQL 2000 server, not SQL 2005 server.
    Any help will be greatly appreciated.
    Regards,
    Kranthi.

    If you want to extract SAP R/3 data to SQL 2000, here are some alternatives:
    1. It becomes very easy if by any chance, you are using SAP BW with SAP R/3. You can extract the data into BW using standard or custom extractors and then send it out with open hub. SQL2000 can pick the flat files from a specified location at regular intervals.
    2. You can use Business Object extractors. You can get more info at:
    http://www.france.businessobjects.com/pdf/products/dataintegration/rapid_marts_sap_infosheet.pdf
    3. If that is not an option, then you need to have a tool that allows being called via RFC. This agent will then execute the required command on behalf of your application and return the result. I do not know if there is a ready-to-use RFC-compliant agent for SQL Server. If you have a tool that does it for you, you might have to check your network connections (ping), permissions etc. and see if you can execute an rSQL from the remote machine on the SQL server.
    There is a general solution to connect to nearly any kind of modern server application from a remote site by using simple HTTP requests. Suitable HTTP server for most needs would be:
    1. Microsoft IIS
    2. Java Tomcat or IBM WebSphere
    3. SAP WebAS
    In most cases, the IIS would probably be the one as it is installed on the Windows 2000 server anyway.
    Define an Active Server Page (ASP.NET) and insert the necessary code in your favorite language to extract the data from the SQL server.
    Your ASP.NET page would pack the result in the HTTP response object to be returned. In order to call the page from SAP you call the function modules HTTP_POST (using a HTTP POST request) or HTTP_GET (for HTTP GET request) on the standard RFC destination SAPHTTPA. (Pointing to a SAP utility program saphttp that resides in the SAP binary directory of your SAP database server and can be called from the command line in order to test its functionality without RFC).
    Regards
    Pravin

  • MS Access Date problem (from Java program)

    I have written an app. in Java that reads & writes data from a MS Access database.
    I am trying to write an insert class which will add a row of data to one of my database tables - which contains Date fields.
    My problem is that I can update the text fields, but not Date fields - every time I try my program throws an exception:
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement
    My simplified code reads as:
    try {
    Statement insertStatement = databaseConnection.createStatement();
    String query = "INSERT INTO myTable(jobId, employeeId, date) VALUES('11', '1', " + "'13/11/2006'" + ");";
    insertStatement.execute(query);
    } //close, etc. etc.
    If I remove the date info from the query, the program executes successfully. I appreciate my problem might be related to the formatting of the date in Access, and if not a 'proper' Java question I give my apologies.
    I have attempted several formats of the date with no success or variation in the exception.
    I am, however, completely stuck and would appreciate any and all help given.
    Regards and thanks
    David

    I have amended my code to use a preparedStatement, but on execution I have the same problem.
    My code is as follows:
    PreparedStatement pstmt = null;
    try {
    String query = "INSERT INTO myTable (jobId, employeeId, date) VALUES(?, ?, ?);";
    pstmt = databaseConnection.prepareStatement(query);
    pstmt.setString(1, "11");
    pstmt.setString(2, "1");
    java.sql.Date sqlDate = getCurrentJavaSqlDate();
    pstmt.setDate(3, sqlDate);
    // execute query, and return number of rows created
    int rowCount = pstmt.executeUpdate();
    System.out.println("rowCount=" + rowCount);
    pstmt.close();
    catch, etc. etc.
    Any ideas or help most welcome
    Regards
    David

  • Viewset does not have data passed from GenIL

    Hi All,
    We have a custom component in which data is not getting passed from a ViewSet to the Overview page. The details of the issue are given below:
    There is a detail view zsoEF and a table view zsoChild. These 2 views are housed in a viewset zsoVS. This view set has an event Eh_OnBack which requires the data from views zsoEF and zsoChild to be passed to overview view zsoOV.
    We recently upgraded to CRM 7.0. After the upgrade, the values entered on the views zsoEF and zsoChild are processed in the ZGenIL. The context nodes and the custom controllers are filled correctly with the screen values and some auto added data based on validations..
    When we click on the Back button, then Eh_OnBack does not have data in the Custom Controller. I am not able to pin point the reason for this missing data in the Back event. From the way i understand, when we do data binding in the views, we don't have to do that in ViewSet. Has there been any change in this design in CRM 7.0?
    I would like to know if there is any workaround for this issue.
    Thanks,
    Rini

    Hi Rini,
        Did you try to bind the context nodes with the component controller. Can give it a try whether it resolves the problem. Any way it is difficult to say anything as we don't have an idea what exactly you did in the component. Lets take it forward. In the mean time have a look in the below link.
    History navigation and context initialization calls - CRM - SCN Wiki
    Thanks,
    Javed.

  • Data Control from Java Class

    Using JDev 11gPS4
    I have a java class that i want to use as a DC:
    (simplified)
    public class AccountDC {
        public AccountDC() {
            super();
        public void insertAccount(Account account){
            //Do some things
    }Account:
    public class Account {
        private String name,alias;
        public Account() {
            super();
        public void setName(String name) {
            this.name = name;
        public String getName() {
            return name;
        public void setAlias(String alias) {
            this.alias = alias;
        public String getAlias() {
            return alias;
    }When I create the data control from the first class, i get the insertAccount operation.
    When i drop the account parameter on my JSPX page, JDev suggest an ADF Form which is fine.
    When I drop the insertAccount method below the form, JDev suggest an ADF Button which is also fine.
    JDeveloper doesn't seem to know that the values provided in the above form should be mapped to an Account object for the insertAccount.
    How should I do this?
    In the bindings I do have the individual attributeValues for each attribute but I don't seem to have a reference to an Account object. Do i need to add something to my DC?
    Another question... Is it maybe better to create a VO with only transient attributes and an Application Module where i expose my own custom createInsert method?
    It's all custom code. It does not write anything to a database.

    You should have an object that represent your method's parameter in your data control - if you'll drag it into your page you'll get the fields needed.
    Similar to the way it is done in this example:
    http://blogs.oracle.com/shay/entry/updateinsert_with_adf_web_serv

  • How to modify a parameter in C++ passed from java (structure Newbie)

    Hi,
    I'm a brand new to Java (basically a C+ programmer). I have a C++ DLL that takes a structure as parameter from Java and I want to change (or populate) it in C++ DLL.
    Here is what I'm trying...
    // Java Code...
    public class CSMSample
        public static class MyDetails
            String myName;
            long myAge;
            byte[] myBinaryData;
        public native static long SMGetMyDetails(MyDetails myDetails);
        public static void main(String[] args)
            MyDetails myDetails = new MyDetails();
            SMGetMyDetails(myDetails);
            System.out.println("My Name is " + myDetails.myName + " and I am " + myDetails.myAge + " years old");
        static
            try
                System.loadLibrary("SMSample"); //SMSample.DLL
            catch (Exception e)
                // Handle exception here ...
    // C++ code
    JNIEXPORT jlong JNICALL Java_CSMSample_SMGetMyDetails(
         JNIEnv* env, jclass, jobject jMyDetails)
        long error = 0;
        // I need to modify jMyDetails here and my Java program should be able to read the changes!
        return error;
    }Can someone help me please!?
    Thanks in advance,
    John.

    Hi
    I'm doing the following:
    // Java class...
    public static class BYTE_ARRAY
         public long     Length;
         public byte[]     Data;
    JNIEXPORT jlong JNICALL Java_CSMSample_SMGetCode(
         JNIEnv* env, jclass, jobject jByteArrayCode)
         BYTE_ARRAY Code;
         Code.Length = 8;
         Code.Data = new BYTE[Code.Length];
         Code.Data[0] = 'a'; Code.Data[1] = 'b'; Code.Data[2] = 'c'; Code.Data[3] = 'd';
         Code.Data[4] = 'e'; Code.Data[5] = 'f'; Code.Data[6] = 'g'; Code.Data[7] = '\0';
         jbyteArray code_data = env->NewByteArray (Code.Length);
         env->SetByteArrayRegion(code_data, 0, Code.Length, (const jbyte*) Code.Data);
         jclass cls = env->GetObjectClass(jByteArrayCode);
         jfieldID fid_Data = env->GetFieldID(cls, "Data", "[B");
         jfieldID fid_Length = env->GetFieldID(cls, "Length", "J");
         env->SetIntField(jByteArrayCode, fid_Length, Code.Length);
         env->SetObjectField(jByteArrayCode, fid_Data, code_data);
    }Java application gets the Length properly but the data part is garbage (When I print, it gives [B@9304b1, same text even if I change the values of Code.Data). Am I missing something?
    Thanks,
    John.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Parameter passing from java applet

    Hi all.
    currently i'm trying to create online testing applet (like TOEFL exam) for fun.
    i've create basic testing rutine, but i got stuck on showing the results.
    i want to show the results on the HTML so that users can print it out easily. but i donw know how to pass parameter from Java to some other language.
    I've searched for JavaScript, but it seems that it's only possible when using NetScape. Also, I searched for PHP, but it's just not possible. HTML seems that it's only possible from "HTML to Java"...
    if anyone knows how i can do it, and which language i should use, please let me know.
    thanx!

    i want to print out the questions that user have mistaken. print out the question, wrong answer, and right answer.
    all the answers are created by radiobutton so i want to get the only the Strig values, which wouldn' be so difficult.
    I've searched about JSObject, but could u tell me where can i install the package (or SDK)?
    And do users need to install the package as well?
    thanks for your time.

  • Create data control from java class, not see "ADF Parameter Forms" option

    Hi,
    I have created a Fusion Web Application (ADF) in jdev 11g. In the application model project, I created a java class. Inside the java class, I have a public method as below
    public Asset [] searchAsset3(SearchTerm s) // SearchTerm is a java bean. It implements java.io.Serializable.
    I created data control from my java class. After that, I see an xml file generated under the same folder of my java class. Here is the xml content.
    <?xml version="1.0" encoding="UTF-8" ?>
    <JavaBean xmlns="http://xmlns.oracle.com/adfm/beanmodel" version="11.1.1.53.62"
    id="AIAAsset" Package="oracle.apps.aia.oer.model"
    BeanClass="oracle.apps.aia.oer.model.AIAAsset" isJavaBased="true">
    <MethodAccessor IsCollection="true"
    Type="com.flashline.registry.openapi.entity.Asset"
    BeanClass="com.flashline.registry.openapi.entity.Asset"
    id="searchAsset" ReturnNodeName="Asset"
    CollectionBeanClass="UpdateableCollection">
    <ParameterInfo id="name" Type="java.lang.String" isStructured="false"/>
    <ParameterInfo id="version" Type="java.lang.String" isStructured="false"/>
    <ParameterInfo id="description" Type="java.lang.String"
    isStructured="false"/>
    </MethodAccessor>
    <MethodAccessor IsCollection="true"
    Type="com.flashline.registry.openapi.entity.AssetSummary"
    BeanClass="com.flashline.registry.openapi.entity.AssetSummary"
    id="searchAssetSummary" ReturnNodeName="AssetSummary"
    CollectionBeanClass="UpdateableCollection">
    <ParameterInfo id="name" Type="java.lang.String" isStructured="false"/>
    <ParameterInfo id="version" Type="java.lang.String" isStructured="false"/>
    <ParameterInfo id="description" Type="java.lang.String"
    isStructured="false"/>
    <ParameterInfo id="type" Type="java.lang.String" isStructured="false"/>
    </MethodAccessor>
    <MethodAccessor IsCollection="true"
    Type="com.flashline.registry.openapi.entity.Asset"
    BeanClass="com.flashline.registry.openapi.entity.Asset"
    id="searchAsset3" ReturnNodeName="Asset"
    CollectionBeanClass="UpdateableCollection">
    <ParameterInfo id="s" Type="com.flashline.registry.openapi.query.SearchTerm"
    isStructured="true"/>
    </MethodAccessor>
    <ConstructorMethod IsCollection="true"
    Type="oracle.apps.aia.oer.model.AIAAsset"
    BeanClass="oracle.apps.aia.oer.model.AIAAsset"
    id="AIAAsset"/>
    </JavaBean>
    Then, in application user interface project, I created a JSPX page. From the data controls palette, I want to drag and drop the searchAsset3 onto my page. However, I don't see an option for me to choose "Create -> Parameters -> ADF Parameter Form". I only see "Create -> Methods". Unlike other public methods (e.g.searchAssetSummary and searchAsset) which have simple data type as input, I can see the "Create -> Parameters -> ADF Parameter Form" option when I drag and drop to my jspx page. Is that something I missed while creating data controls?
    Thanks.
    Arnold.

    Then, my other question is how do you do the bindings? I drag and drop the attributes from SearchTerm bean. Now the pagedef file has the AttributeValues added but my method is actually expecting one input parameter of type SearchTerm. How do you bind the attributes to the input of the method? Thanks.
    See below of my pagedef xml file.
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
    version="11.1.1.53.62" id="SearchAssetBySearchTerm1PageDef"
    Package="oracle.apps.aia.oer.view.pageDefs">
    <parameters/>
    <executables>
    <variableIterator id="variables"/>
    <methodIterator Binds="SearchTerm.result" DataControl="AIAAsset"
    RangeSize="25"
    BeanClass="com.flashline.registry.openapi.query.SearchTerm"
    id="SearchTermIterator"/>
    </executables>
    <bindings>
    <methodAction id="SearchTerm" RequiresUpdateModel="true"
    Action="invokeMethod" MethodName="SearchTerm"
    IsViewObjectMethod="false" DataControl="AIAAsset"
    ClassName="com.flashline.registry.openapi.query.SearchTerm"
    ReturnName="AIAAsset.methodResults.SearchTerm_AIAAsset_SearchTerm_result"/>
    <attributeValues IterBinding="SearchTermIterator" id="key">
    <AttrNames>
    <Item Value="key"/>
    </AttrNames>
    </attributeValues>
    <attributeValues IterBinding="SearchTermIterator" id="operator">
    <AttrNames>
    <Item Value="operator"/>
    </AttrNames>
    </attributeValues>
    <attributeValues IterBinding="SearchTermIterator" id="value">
    <AttrNames>
    <Item Value="value"/>
    </AttrNames>
    </attributeValues>
    <methodAction id="searchAsset3" RequiresUpdateModel="true"
    Action="invokeMethod" MethodName="searchAsset3"
    IsViewObjectMethod="false" DataControl="AIAAsset"
    InstanceName="AIAAsset.dataProvider"
    ReturnName="AIAAsset.methodResults.searchAsset3_AIAAsset_dataProvider_searchAsset3_result">
    *<NamedData NDName="s"*
    NDType="com.flashline.registry.openapi.query.SearchTerm"/>+
    </methodAction>
    </bindings>
    </pageDefinition>

  • Regexpr from java not working in SQL

    Hello I have a complicated regexpr coming from java but when I try to use it with oracle RGEXPR_SUBSTR, it's seems to be buggy as I'm not having all the result (only partial)
    Here is my regexpr for oracle and below the Java version
    Oracle version:
    ^([A-Z0-9]{3})(\d{4,6})([A-Z]{2})(\d{2})\-(\d{2})([A-Z]{2})(?:\-(GA|CA|DEC|INFR|INF|CAC|DECC)?(\d{1,3})?)?(?:\-(\d{2})?((?:C|A|R|FIN|PC|APC|APCFIN|DEF|VO)+[0-9]*)?)?(?:\-(AV|CP|D|LP|NI|OJ|PF|PV|RA|RAS))?(?:\-(\d{1,}))?(?:\-([^\s]{1,}))?\-(OR|ORAN|RELU|TR|TRAN)(\.\w*)?$Java version
    ^([A-Z0-9]{3})(\\d{4,6})([A-Z]{2})(\\d{2})\\-(\\d{2})([A-Z]{2})(?:\\-(GA|CA|DEC|INFR|INF|CAC|DECC)?(\\d{1,3})?)?(?:\\-(\\d{2})?((?:C|A|R|FIN|PC|APC|APCFIN|DEF|VO)+[0-9]*)?)?(?:\\-(AV|CP|D|LP|NI|OJ|PF|PV|RA|RAS))?(?:\\-(\\d{1,}))?(?:\\-([^\\s]{1,}))?\\-(OR|ORAN|RELU|TR|TRAN)(\\.\\w*)?$I simply changed double backslashing \\ to simple backslashing \
    Is my conversion wrong ?
    Here are some test values
    Value                                                          JAVA          ORACLE
    FG1000054EL01-06PP-OR.pdf                                 OK          OK
    SGL005738FR01-09PP-DEC127-09-OR.doc                            OK          NOK
    FED004721EN08-09PP-DEC115-09APCFINC1-RA-Word2007_docx_renamed_back-OR.doc  OK          NOK
    FG1000054EL01-06PP-RELU.pdf                                 OK          NOK
    toto                                                      NOK          NOKThanks for help
    Edited by: Liandra Flaris on Oct 14, 2009 3:35 PM

    Hi,
    Sorry, I can't understand your message.
    Whenever you post code or formatted text on this sit, type
    &#123;code&#125;
    (small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing, and to keep brackets (which are common in regular expressions) from being treated as markup.
    Format and coimmnet your code. For example:
    SELECT  REGEXP_REPLACE ( '&txt'
                     , '(^|[^t[:blank:]|[:space:]])'     ||     -- \1 = Begining or some character other than t or space
                           '([[:blank:][:space:]]*)'     ||     -- \2 =     optional space
                      '(create)'               ||     -- \3 = 'create'
                    '[[:blank:][:space:]]+'     ||     --      at least 1 space
                    '(materialized)'               -- \4 = 'materialized'
                     , '\1\2\3 OR REPLACE /*ADDED*/ \4'
                     , 1
                     , 0
                     , 'i'
    FROM    dual;Not everyone is familiar with regular expressions in Java. Can you explain what you code is supposed to do?
    Why did you double the \ characters?
    Use &#123;code&#125; tags around the output, too, so that people can tell what's in each column.
    Are the results in the Java column correct?

  • Passing #COLUMN_VALUE# as parameter to pl/sql function in column template

    Hi all,
    I want to color negative amounts in red in sql report using column template.
    I created a pl/sql function"isNegativeNum" which returns 1 or -1.
    create or replace function isNegativeNum(p_column_value varchar2) return number
    as
    l_dummy number;
    begin
          l_dummy := to_number(p_column_value,'999G999G990D00PR');
          IF l_dummy < 0
             THEN
                RETURN 1;
          else
                return -1;
          END IF;
    exception
    when others then
       RETURN -1;
    end;Below is column template.
    Column Template 1
    <td class="t3dataalt" #ALIGNMENT#><p color=red>#COLUMN_VALUE#</p></td>Column Template 1 Condition
    isNegativeNum('#COLUMN_VALUE#') = -1The issue is #COLUMN_VALUE# value is not being passed to the function, Insert statement in function reveals p_column_value as a string "#COLUMN_VALUE#". When I try without quotes like isNegativeNum(#COLUMN_VALUE#) = -1, I get below error.
    ORA-06550: line 1, column 48: PLS-00103: Encountered the symbol "#" when expecting one of the following: ( ) - + case mod new not null others select table avg count current exists max min prior sql stddev sum variance execute multiset the both leading trailing forall merge year month DAY_ hour minute second timezone_hour timezone_minute timezone_region timezone_abbr time timestamp interval date
         Error      ERR-1025 Error processing PLSQL expression. isNegativeNum(#COLUMN_VALUE#) = 1
    Any help is appreciated.
    Kishore

    Hi Kishore,
    using #COLUMN_VALUE# would probably not make much sense, because normally a report has multiple columns and not just the numeric column which you want to verify if it's negative. But APEX will fire the template condition for each column, because the report template is a column cell template.
    What you can do to make it more generic is to use for example
    #CHECK_AMOUNT#
    in the template and provide a not displayed column in your SQL statement which contains your value which is named CHECK_AMOUNT. For example:
    SELECT NAME
         , BALANCE
         , BALANCE AS CHECK_AMOUNT
    FROM XXX;Because this CHECK_AMOUNT column would be a generic name, you can use this template in all your reports as long as you provide this column.
    Thope that helps
    Patrick

Maybe you are looking for