V function and dates

I'm very much new to APEX and I've been looking into a performance issue our external APEX app is having, so if someone has any advice I would be very grateful.
I've narrowed the issue down to one page which uses a report region. This report runs an unrestricted select from a database view, the view is coded to use the v () function to get session values from items in the page at runtime to retrieve the relevant records. This should take sub second to retrieve the records and does so when we run the sql outside of apex when not using the v() function. running in APEX it is taking over 10 seconds to execute, it seems that this is purely related to using v() to retrieve from and to date values from items in the page and using these as range values. If I take the range restriction out of the view and add it to the select in the source of the page it is less than a second to execute.
Is this a know bug, has anyone come across this before?
this is using version 2.02 I believe.

Hi,
as Lev has already pointed out by referencing the forum thread, rewrite your view to wrap the V calls with a "scalar subquery". eg:
WHERE WAREHOUSE_ID = (SELECT V('P5_WAREHOUSE_ID') FROM DUAL)For an explanation see http://inside-apex.blogspot.com/2006/11/caution-when-using-plsql-functions-in.html and also check out http://inside-apex.blogspot.com/2006/12/drop-in-replacement-for-v-and-nv.html
Patrick
My APEX Blog: http://inside-apex.blogspot.com
The ApexLib Framework: http://apexlib.sourceforge.net
The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/

Similar Messages

  • Functional and data differences between W_GL_BALANCE_F and W_GL_OTHER_F

    Hi:
    Can some explain what the functional and data-source differences are between W_GL_BALANCE_F and W_GL_OTHER_F? Both seem to group by GROUP_ACCOUNT_NUM.
    Thanks.

    That is not possible; all transaction in GL Other will end up in GL Balance.
    The two tables are essentially having the same data but at different grain. Two main differences:
    - GL Other have individual journal transactions; GL Balance have them summarized to the account level.
    - GL Other is truly additive since its just individual journal transactions. i.e. you can just sum() any number of transactions and wont double count a trx; GL Balance is a monthly snapshot table. i.e. it provides account balance for all accounts for every month end, so you can never add two snapshots.

  • How to invoke functions and data type( ex. sflight structure ) that is in t

    Hi,experts,
    I create a funcion(zz_test) that return sflight table type data. I need to invoke the function in the Webdynpro for java application.
    I think I would import the funtion to local.
    But I don't know how to import the function and the data type using SAP NetWeaver Developer Studio?
    But I don't know how to invoke functions and data type( ex. sflight structure ) that is in the R/3 in the WDJ?
    Do you give me some hints?
    Thanks a lot!
    Best regards,
    tao

    Hi Wang Tao,
    For achieving this you need to user Adaptive RFC models.
    This link explains you on the same :
    http://help.sap.com/saphelp_nw70/helpdata/EN/6a/11f1f29526944e8580c5e59333d96d/frameset.htm
    Thanks
    Namrata

  • Decode function and dates

    I have the following query:
    select of_coy,of_div,
    max(DECODE(of_takeon_date, 'MON', 1,0)) JAN,
    max(DECODE(of_takeon_date, 'MON', 1,0)) FEB,
    max(DECODE(of_takeon_date, 'MON', 1,0)) MAR,
    max(DECODE(of_takeon_date, 'MON', 1,0)) APR,
    max(DECODE(of_takeon_date, 'MON', 1,0)) MAY,
    max(DECODE(of_takeon_date, 'MON', 1,0)) JUN,
    max(DECODE(of_takeon_date, 'MON', 1,0)) JUL,
    max(DECODE(of_takeon_date, 'MON', 1,0)) AUG,
    max(DECODE(of_takeon_date, 'MON', 1,0)) SEP,
    max(DECODE(of_takeon_date, 'MON', 1,0)) OCT,
    max(DECODE(of_takeon_date, 'MON', 1,0)) NOV,
    max(DECODE(of_takeon_date, 'MON', 1,0)) DEC
    from mac.oprfile
    where of_takeon_date > to_date('01-01-2010','DD-MM-YYYY')
    GROUP BY of_coy,of_div
    order by 1;
    The output displayed is not what i want as it displays just zeros, what about the counts for the months of JAN,FEB,MAR
    "OF_COY"     "OF_DIV"     "JAN"     "FEB"     "MAR"     "APR"     "MAY"     "JUN"     "JUL"     "AUG"     "SEP"     "OCT"     "NOV"     "DEC"
    01     01     0     0     0     0     0     0     0     0     0     0     0     0
    01     02     0     0     0     0     0     0     0     0     0     0     0     0
    01     03     0     0     0     0     0     0     0     0     0     0     0     0
    01     04     0     0     0     0     0     0     0     0     0     0     0     0
    01     07     0     0     0     0     0     0     0     0     0     0     0     0
    01     08     0     0     0     0     0     0     0     0     0     0     0     0
    01     09     0     0     0     0     0     0     0     0     0     0     0     0
    01     12     0     0     0     0     0     0     0     0     0     0     0     0
    01     22     0     0     0     0     0     0     0     0     0     0     0     0
    02     01     0     0     0     0     0     0     0     0     0     0     0     0
    04     01     0     0     0     0     0     0     0     0     0     0     0     0
    please assist in fixing the sql query

    Hi,
    Use the following query for taking the sum based on the month.
    select of_coy,of_div,
    sum(max(DECODE(of_takeon_date, 'MON', 1,0))) JAN,
    sum(max(DECODE(of_takeon_date, 'MON', 1,0))) FEB,
    sum(max(DECODE(of_takeon_date, 'MON', 1,0))) MAR,
    sum(max(DECODE(of_takeon_date, 'MON', 1,0))) APR,
    sum(max(DECODE(of_takeon_date, 'MON', 1,0))) MAY,
    sum(max(DECODE(of_takeon_date, 'MON', 1,0))) JUN,
    sum(max(DECODE(of_takeon_date, 'MON', 1,0))) JUL,
    sum(max(DECODE(of_takeon_date, 'MON', 1,0))) AUG,
    sum(max(DECODE(of_takeon_date, 'MON', 1,0))) SEP,
    sum(max(DECODE(of_takeon_date, 'MON', 1,0))) OCT,
    sum(max(DECODE(of_takeon_date, 'MON', 1,0))) NOV,
    sum(max(DECODE(of_takeon_date, 'MON', 1,0))) DEC
    from mac.oprfile
    where of_takeon_date > to_date('01-01-2010','DD-MM-YYYY')
    GROUP BY of_coy,of_div
    order by 1;
    ex :- select first_name,department_id,
    sum(decode(to_char(HIRE_DATE,'MON'),'JAN',1,0)) "JAN",
    sum(decode(to_char(HIRE_DATE,'MON'),'FEB',1,0)) "FEB",
    sum(decode(to_char(HIRE_DATE,'MON'),'MAR',1,0)) "MAR",
    sum(decode(to_char(HIRE_DATE,'MON'),'APR',1,0)) "APR",
    sum(decode(to_char(HIRE_DATE,'MON'),'MAY',1,0)) "MAY",
    sum(decode(to_char(HIRE_DATE,'MON'),'JUN',1,0)) "JUN",
    sum(decode(to_char(HIRE_DATE,'MON'),'JUL',1,0)) "JUL",
    sum(decode(to_char(HIRE_DATE,'MON'),'AUG',1,0)) "AUG"
    from emp
    GROUP BY first_name,department_id
    ORDER BY 1;
    Regards,
    NTR

  • The find function (Ctl+F) , doesn't not expanding the xml file , to search for given search. If the the xml file is expanded , then find function finds the tag and data. How to fix this.

    The find function doesn't expanding the xml nodes to search. If the xml is expanded , then find function highlights both matching tag and data. how to fix this.
    == This happened ==
    Every time Firefox opened

    <xsl:value-of select="x"/> produces a string that consists of all text nodes in x.
    <xsl:copy-of select="x"/> produces an exact copy of x.
    Go to http://www.zvon.org/ for more information like this.

  • Function module to display the time and date in the report-sy-udate And s

    Hi.
    wish to have a function module which can display the system time and date through function module.
    the format that this function module should display should be like this:
    if its today-date and time then:
    05-Jan-08 01.25.57 PM
    please note that i want them to be in one single row in the top-of page
    kinldy help on this.
    thanks!

    hi,
    check this.
    https://forums.sdn.sap.com/click.jspa?searchID=19175181&messageID=4628668
    Thanks

  • Data dcitioany view and function and procedures insure a package

    I need the run a query on the Data dcitioany, to get a list of packages as well as a list for procedures and functions inside on Oracle 10g

    I use DBA_SOURCE,
    I used like this
      SELECT v.owner,
           (CASE V.type
            WHEN 'FUNCTION'  THEN NULL
            WHEN 'PROCEDURE' THEN NULL
            ELSE v.name
            END
           )PACKAGE_NAME ,
            UPPER(
            SUBSTR
            TRANSLATE(
            LTRIM(REPLACE(SUBSTR(ltrim(v.text),LENGTH('PROCEDURE')+1),'"',''),' '),
            '+++'
            ),---TEXT TO BE SEARCH
            1,---STARTING POSITION
            INSTR(
            TRANSLATE(
            LTRIM(REPLACE(SUBSTR(ltrim(v.text),LENGTH('PROCEDURE')+1),'"',''),' '),
            '+++'
            ||'+'
            '+'
            )-1 ---lENGTH
            )OBJECT_NAME
            TRIM(SUBSTR(ltrim(v.text),1,LENGTH('PROCEDURE')))"TYPE"
    FROM dba_source v
    WHERE (TRIM(ltrim(v.text)) LIKE ('FUNCTION%') OR TRIM(ltrim(v.text)) LIKE ('PROCEDURE%')) AND
                v.type IN ('PACKAGE','FUNCTION','PROCEDURE')
    ORDER BY V.OWNER,V.name,v.text;Note: the translate, substr, etc function can be simplified based on your needs
    in my case, how developers created the function and procedure is quite messy.
    thanks

  • How to find function and SP from data dictionary?

    For example:
    create or replace package SPK_A is
    lv_empno number;
    lv_deptno number;
    function FUN_A(in_empno number) return varchar2;
    function SP_A(in_deptno number) return varchar2;
    end;
    Then, how can i to find FUN_A and SP_A from data dictionary.
    and mark the former is a function, the latter is a stored procedure.
    I have tried to use the following 2 views, but i cannot give me the answer.
    (1)dba_procedures: it can only find the sole function or sole stored procedure, which is not define in a package.
    and it can not distinguish between function and SP.
    For example, it can only find the function or SP as below:
    create or replace function FUN_OUT return number is
    begin
    null;
    end;
    (2)all_arguments: it can list all function or SP which has varibles, but can not distinguish between function and SP.
    Can anyone help me?
    Any ideas appreciated.
    Merry Chirstmas!

    Is this what you mean?
    SQL> connect test/test
    Connected.
    SQL> create or replace package SPK_A is
      2  lv_empno number;
      3  lv_deptno number;
      4  function FUN_A(in_empno number) return varchar2;
      5  function SP_A(in_deptno number) return varchar2;
      6  end;
      7  /
    Package created.
    SQL> create or replace function FUN_OUT return number is
      2  begin
      3  null;
      4  end;
      5  /
    Function created.
    SQL> select object_type, object_name from user_objects;
    OBJECT_TYPE
    OBJECT_NAME
    TABLE
    ABC
    PACKAGE
    SPK_A
    FUNCTION
    FUN_OUT

  • Hi. Can you tell me if using the sat nav functionality on the in-built maps app on my iphone 5, uses just GPS (hence no cost) or GPS and data roaming, hence a running cost for the extent of my journey?

    Hi
    As the tile says, I am looking to find out if I need to purchase an actual Sat-nav app or if I can use the inbuilt functionality and not incur additional data charges
    Thanks

    The built in Maps apps requires a data connection to download mapping data. So, if you want to avoid data costs, you need to purchase a navigation app that stores the data locally on your phone.

  • User Data like Function and Department

    Dear all
    I have to do a 1 time extraction of the user data. I need to know as in SU01 the Name, firstname, Function and Department.
    I can not find in which table I can find the function and department.
    Can somebody tell me where this information is stored and how the link to the user is made?
    thank you
    Herbert

    Hi Herbert,
    I found the data element for the function field (AD_FNCTN) from the screen and did a where-used to get table ADCP.  This is keyed on Person number and Address number.  You'll get these from table USR21.
    There may also be a function module to get this data, but these are the tables you need.
    Regards,
    Nick

  • I turned off cellular data, and data roaming while traveling abroad.  I turned them back on upon arriving back home, but now only the wi-fi features works when trying to connect to the internet.   Texting works, no internet function works unless wi-fi???

    I turned off my cellula data and data roaming while abroad.  I turned them back on when returning home.  But now I can only access internet and mail functions when on wi-fi.  texting works.  The 3G access to the internet isn't working now.  3g is on.  What do I need to do to restore non-wi-fi internet function.  Roaming is on s well.  ?????

    Try to reset your iPhone:
    Settings>>General>>Reset>>Reset All Settings
    You will need to rejoin all wi-fi and/or bluetooth connections
    You will need to set up your settings of your choice.
    Information (such as contacts and Calendars) and meida (such as music, videos, apps) are NOT affected.

  • Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems n

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

  • Qty and Date Variance using Purchasing InfoCube

    Using Purchasing Cube, I want to find out the Qty Variance and Date variance,
    Iu2019m calculating these using GR Posting date and Requested Delivery Date and GR Qty and Qty in UoM.
    Iu2019ve the following doubts:
    1.     In order to calculate the Variance, do we need to filter the data pertaining to any particular BW Transaction Key (0PROCESSKEY) since we donu2019t want Goods Issues (can be Purchase Returns or intra company Stock Transfers ), If so what are the values for the Process Key to be considered for filter.
    2.     Though the Qty key figure matches the Requested Qty, the PO status is u2018Openu2019. What could be the possible reasons?
    3.     The qty. and days variance for the POs already received can be calculated. But what should be done incase of POs for which Goods are not yet received? Again in that scenario, we can have two cases: Delivery Past Due and Delivery Date in Future. How to tackle these 2 cases. As per our Requirement, we have to calculate the difference between System date and Requested Delivery Date incase of Past Delivery Date so that we can have the variance as of System Date. Like If the Delivery Date is 25th Nov, if we run the Query on 28th, it should show 3 days late and if run on 29th, it has to be 4 days if still undelivered. Please give me the code to be written in Transformations.
    We have not yet decided what has to be done in the second case i.e. Future Delivery Date. Please guide me what is the best option in that case.
    Thanks,
    Aryaman

    Hi,
    1. In order to calculate the Variance, do we need to filter the data pertaining to any particular BW Transaction Key (0PROCESSKEY) since we donu2019t want Goods Issues (can be Purchase Returns or intra company Stock Transfers ), If so what are the values for the Process Key to be considered for filter.
    You need to add Z-Keyfigures and then write Routines based on Process Keys in Update Rules/Transformations and filter the required Process Keys, you need to find required Process Keys in ECC, SPRO-->Reference IMG an dthen search for BW Transactional Key and see it disuss with MM FUnctional COnsultant and Identify it.
    2. Though the Qty key figure matches the Requested Qty, the PO status is u2018Openu2019. What could be the possible reasons?
    I faced the problem with 2LIS_02_* datasources so I created new generic data source and used it.  Just take only one record with that you track in ECC. You must take MM Consultants help, they will guide you.
    3. The qty. and days variance for the POs already received can be calculated. But what should be done incase of POs for which Goods are not yet received? Again in that scenario, we can have two cases: Delivery Past Due and Delivery Date in Future. How to tackle these 2 cases. As per our Requirement, we have to calculate the difference between System date and Requested Delivery Date incase of Past Delivery Date so that we can have the variance as of System Date. Like If the Delivery Date is 25th Nov, if we run the Query on 28th, it should show 3 days late and if run on 29th, it has to be 4 days if still undelivered. Please give me the code to be written in Transformations.
    We have not yet decided what has to be done in the second case i.e. Future Delivery Date. Please guide me what is the best option in that case.
    Once you have Qty and Dates from Transactional Data then it is easy to calculate the Date Varience and Qty varience, see the follwoing URL it is having one article How to Calculate Meterial Aging whcih will give how to calculate the differnce..
    http://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
    Thanks
    Reddy

  • Current day and date

    I've created a fairly simple website in which I've inserted
    the day and date and want it to update automatically according to
    my location, which is the same as the server. Currently, it is in
    the following format: Friday, March 14, 2008. I've not been able to
    find a simple, clear, step by step answer in my online searches. I
    am not a programmer so if you tell me about code you may need to
    provide a little extra detail. Do I need to create an html or shtml
    page for this code instruction or can I simply insert some magic
    code into my current html page? Thanks for your time and help with
    this!

    DJenae wrote:
    > <script>
    > document.write(new Date());
    > </script>
    >
    > Mick
    >
    >
    > Thanks Mick but this didn't work either. It must be the
    placement. Please read
    > the 2 posts before yours to see how I inserted the code
    suggestions. This is
    > that section of code that includes what you sent me.
    >
    > <tr>
    > <td width="558" height="33" valign="middle"
    class="style1"><script><br />
    > document.write(new Date());<br />
    > </script></td>
    > </tr>
    >
    <tr>
    <td width="558" height="33" valign="middle"
    class="style1">
    <script>
    document.write(new Date());
    </script>
    </td>
    </tr>
    Note removal of breaks, and BTW "height" is an illegal
    attribute for <td>
    Another way:
    <script>
    Date.prototype.normal=function(){
    return
    ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][this.getDay()]+
    ", "+
    ["Jan","Feb","Mar","Apr","May","Jun",
    "Jul","Aug","Sep","Oct","Nov","Dec"][this.getMonth()]+
    " "+
    this.getDate()+
    ", "+this.getFullYear();
    </script>
    <tr>
    <td width="558" height="33" valign="middle"
    class="style1">
    <script>
    document.write(new Date().normal());
    </script>
    </td>
    </tr>
    Mick

  • Weird problem with mysql query and data table buttons !!!!

    Hi,
    I'm using jsc 2 update 1 on windows and mysql 4.1 . I have a page with a data table. One column of the data table contains "Details" buttons.
    Source query for the table is :
    SELECT tbl_tesserati.idtbl_tesserati idTesserato,
    tbl_tesserati.num_tessera,
    tbl_tesserati.nome,
    tbl_societa.codice_meccanografico
    FROM tbl_tesserati
    INNER JOIN tbl_rel_tesserato_discipline_societa ON tbl_tesserati.idtbl_tesserati = tbl_rel_tesserato_discipline_societa.id_tesserato
    INNER JOIN tbl_cariche ON      tbl_rel_tesserato_discipline_societa.id_carica = tbl_cariche.idtbl_cariche
    INNER JOIN tbl_qualifiche ON      tbl_rel_tesserato_discipline_societa.id_qualifica = tbl_qualifiche.idtbl_qualifiche
    INNER JOIN tbl_discipline ON      tbl_rel_tesserato_discipline_societa.id_disciplina = tbl_discipline.idtbl_discipline
    INNER JOIN tbl_societa ON      tbl_rel_tesserato_discipline_societa.id_societa = tbl_societa.idtbl_societa
    LEFT JOIN tbl_province ON tbl_societa.provincia_sede_sociale = tbl_province.idtbl_province
    LEFT JOIN tbl_comuni ON tbl_societa.comune_sede_sociale = tbl_comuni.idtbl_comuni
    LEFT JOIN tbl_rel_tesserato_discipline_praticate ON tbl_rel_tesserato_discipline_praticate.tessera_id=
    tbl_rel_tesserato_discipline_societa.idtbl_rel_tesserato_discipline
    LEFT JOIN tbl_discipline_praticate ON tbl_discipline_praticate.idtbl_disciplina_praticate=tbl_rel_tesserato_discipline_praticate.disciplina_praticata_id
    WHERE
    tbl_tesserati.cognome LIKE ?
    AND tbl_tesserati.nome LIKE ?
    AND tbl_rel_tesserato_discipline_societa.id_societa LIKE ?
    AND tbl_tesserati.idtbl_tesserati LIKE ?
    AND tbl_cariche.idtbl_cariche LIKE ?
    AND tbl_qualifiche.idtbl_qualifiche LIKE ?
    AND tbl_tesserati.data_nascita >= ?
    AND tbl_tesserati.data_nascita<= ?
    AND tbl_discipline.idtbl_discipline LIKE ?
    AND codice_affiliazione LIKE ?
    AND tbl_societa.denominazione LIKE ?
    AND YEAR(tbl_rel_tesserato_discipline_societa.data_scadenza) LIKE ?
    AND (tbl_province.nome LIKE ? OR tbl_province.nome IS NULL)
    AND ( tbl_comuni.nome LIKE ? OR tbl_comuni.nome IS NULL)
    The tbl_tesserati.data_nascita is a mysql date field.
    The click event handler code for the "Details" Button is:
    public String btnModificaTesserato_action() {
            try{
                TableRowDataProvider rowData= (TableRowDataProvider)getBean("currentRowTesserati");
                getRequestBean1().setId_tesserato((Long)rowData.getValue("idTesserato"));          
            } catch(Exception ex) {
                log("errore nella query",ex);
            return "dettaglioTesseratoSocieta";
        }When i run the project and open the page the table is correctly rendered and populated with some rows. But when i click on details button nothing happens, the page is simply reloaded.
    If i set a breakpoint in the code line   TableRowDataProvider rowData= (TableRowDataProvider)getBean("currentRowTesserati");the debbuger does not stop the code execution ! As if the button was never clicked!
    I tried to modify the source query to :
    SELECT tbl_tesserati.idtbl_tesserati idTesserato,
    tbl_tesserati.num_tessera,
    tbl_tesserati.nome,
    tbl_societa.codice_meccanografico
    FROM tbl_tesserati
    INNER JOIN tbl_rel_tesserato_discipline_societa ON tbl_tesserati.idtbl_tesserati = tbl_rel_tesserato_discipline_societa.id_tesserato
    INNER JOIN tbl_cariche ON      tbl_rel_tesserato_discipline_societa.id_carica = tbl_cariche.idtbl_cariche
    INNER JOIN tbl_qualifiche ON      tbl_rel_tesserato_discipline_societa.id_qualifica = tbl_qualifiche.idtbl_qualifiche
    INNER JOIN tbl_discipline ON      tbl_rel_tesserato_discipline_societa.id_disciplina = tbl_discipline.idtbl_discipline
    INNER JOIN tbl_societa ON      tbl_rel_tesserato_discipline_societa.id_societa = tbl_societa.idtbl_societa
    LEFT JOIN tbl_province ON tbl_societa.provincia_sede_sociale = tbl_province.idtbl_province
    LEFT JOIN tbl_comuni ON tbl_societa.comune_sede_sociale = tbl_comuni.idtbl_comuni
    LEFT JOIN tbl_rel_tesserato_discipline_praticate ON tbl_rel_tesserato_discipline_praticate.tessera_id=
    tbl_rel_tesserato_discipline_societa.idtbl_rel_tesserato_discipline
    LEFT JOIN tbl_discipline_praticate ON tbl_discipline_praticate.idtbl_disciplina_praticate=tbl_rel_tesserato_discipline_praticate.disciplina_praticata_id
    WHERE
    tbl_tesserati.cognome LIKE ?
    AND tbl_tesserati.nome LIKE ?
    AND tbl_rel_tesserato_discipline_societa.id_societa LIKE ?
    AND tbl_tesserati.idtbl_tesserati LIKE ?
    AND tbl_cariche.idtbl_cariche LIKE ?
    AND tbl_qualifiche.idtbl_qualifiche LIKE ?
    AND tbl_tesserati.data_nascita >= ?
    OR tbl_tesserati.data_nascita<= ?
    AND tbl_discipline.idtbl_discipline LIKE ?
    AND codice_affiliazione LIKE ?
    AND tbl_societa.denominazione LIKE ?
    AND YEAR(tbl_rel_tesserato_discipline_societa.data_scadenza) LIKE ?
    AND (tbl_province.nome LIKE ? OR tbl_province.nome IS NULL)
    AND ( tbl_comuni.nome LIKE ? OR tbl_comuni.nome IS NULL)
    Using this query everything works well !! The click handler works and the debugger too !!
    I changed only the AND in OR !!!
    I also tried to change mysql-x-x-connector driver but without solving my problem.
    Can someone help me ?
    Thanks
    Giorgio

    You'll find that it is more to do with the way MySql deals with dates than anything else! Depending on how your date field is setup, then try using a BETWEEN statement for those 2 lines in your first query e.g.
    AND ( tbl_tesserati.data_nascita BETWEEN ? AND ?)
    The date column needs to be in the ISO format to work. If you examine your second query output, you might discover that the output is only going to refer to one parameter (probably the OR one). Did you manage to view the output logs from the application server? You would have got an idea from there with a message like stating a conversion error'.
    Alternatively, you could try using the to_days() function and convert it directly to a number which would be a lot easier to deal with. For example:
    AND to_days(tbl_tesserati.data_nascita >= ? )
    AND to_days( tbl_tesserati.data_nascita<= ? )
    Or try the BETWEEN version with to_days() and see what you get.
    More info about date formatting (v5) here:
    http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_to-days
    Before I forget, sometimes you may need to treat dates as Strings rather 'Long' as you did.
    As a matter of interest, did you try your query in a different piece of software?
    If my queries are a little more complicated, I tend to try MySql queries out in the free MySql query browser and also double check in another to verify certain issues. I found it easier to develop SQL in a seperate program then import the final version to JSC making the required modifications for parameters.
    Message was edited by:
    aerostra

Maybe you are looking for

  • Error with define substitution variable in SQL

    Hi there, I am using PL/SQL developer and trying to define a substitution variable as follows: define freq = 'Weekly' Then later on, in my SQL statement, I used this variable in WHERE statement as follows: WHERE ... (&freq = 'Weekly') and ... But I g

  • ORA-02068: following severe error from LNK -(Prob with HS ODBC pls. help)

    HI Every one... Please help me out... Problem in d/b link using generic connectivity of oracle to connect MS Access here are the details ... ORACLE VERSION - Oracle8i Release 8.1.7.0.0 OS - WINDOWS 2000 Service Pack 3 MSAccess 2000 I sussessfully cre

  • How to connect turntable to Macbook pro?

    Hello, I have a turntable that has a Y cable and want to know how I can hook it up to my Macbook pro laptop. I don't want to record anything or save anything I simply want to play my records on my laptop. I don't have a receiver.. THANKS so much!

  • Html:select inside logic:iterate

    hi, I am having a string type corresponding to the select attribute in my form bean. Since this select tag is inside the logic:iterate all the names of the select boxes are same. i.e myLabel in this context. So, how can i set the value to select box.

  • Making existing frequency become zero frequency

    Hye. Help me, I got a probem on making the existing frequency from read from measurement data become zero. Is that possible? Because the data should have 0Hz of its frequency. For now it have around 0.05Hz, so i want it to become 0. I has attach my s