JPA Problem using alias for columns in a query

Hello, I am having some problems with a query that I am trying to use in my JEE project. This query doesnt return an entity but a group of values. I created a class representing the result and a query with the jpa constructor expression but it is not working.
The problem is that in the query I added some alias to the results, and when I try to run the project it says that it cannot parse the query.
My Query:
Query query = em.createQuery("SELECT NEW vo.VOOperacionesAgrupadas (o.nemotecnico as nemotecnico, o.esCompra as esCompra, i.equivUltimo as equivUltimo, sum(o.saldo) as saldo, sum(o.utilidad) as utilidad, sum(o.tasaCompraVenta)/count(o.nemotecnico) as promedioTasaCompra, (i.equivUltimo-sum(o.tasaCompraVenta)/count(o.nemotecnico))*100 as puntosBasicos) FROM Operaciones o, Instrumentos i WHERE o.idUsuario = :idUsuario AND o.nemotecnico = i.nemotecnico AND o.estaCerrada = 'false' Group by o.nemotecnico, o.esCompra, i.equivUltimo"); When I use that the server returns :
Exception Description: Syntax error parsing the query [SELECT NEW vo.VOOperacionesAgrupadas (o.nemotecnico as nemotecnico, o.esCompra as esCompra, i.equivUltimo as equivUltimo, sum(o.saldo) as saldo, sum(o.utilidad) as utilidad, sum(o.tasaCompraVenta)/count(o.nemotecnico) as promedioTasaCompra, (i.equivUltimo-sum(o.tasaCompraVenta)/count(o.nemotecnico))*100 as puntosBasicos) FROM Operaciones o, Instrumentos i WHERE o.idUsuario = :idUsuario AND o.nemotecnico = i.nemotecnico AND o.estaCerrada = 'false' Group by o.nemotecnico, o.esCompra, i.equivUltimo], line 1, column 53: syntax error at [as].
Internal Exception: MismatchedTokenException(8!=82)
GRAVE: java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
Exception Description: Syntax error parsing the query [SELECT NEW vo.VOOperacionesAgrupadas (o.nemotecnico as nemotecnico, o.esCompra as esCompra, i.equivUltimo as equivUltimo, sum(o.saldo) as saldo, sum(o.utilidad) as utilidad, sum(o.tasaCompraVenta)/count(o.nemotecnico) as promedioTasaCompra, (i.equivUltimo-sum(o.tasaCompraVenta)/count(o.nemotecnico))*100 as puntosBasicos) FROM Operaciones o, Instrumentos i WHERE o.idUsuario = :idUsuario AND o.nemotecnico = i.nemotecnico AND o.estaCerrada = 'false' Group by o.nemotecnico, o.esCompra, i.equivUltimo], line 1, column 53: syntax error at [as].
Internal Exception: MismatchedTokenException(8!=82)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
Caused by: Exception [EclipseLink-8024] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Syntax error parsing the query [SELECT NEW vo.VOOperacionesAgrupadas (o.nemotecnico as nemotecnico, o.esCompra as esCompra, i.equivUltimo as equivUltimo, sum(o.saldo) as saldo, sum(o.utilidad) as utilidad, sum(o.tasaCompraVenta)/count(o.nemotecnico) as promedioTasaCompra, (i.equivUltimo-sum(o.tasaCompraVenta)/count(o.nemotecnico))*100 as puntosBasicos) FROM Operaciones o, Instrumentos i WHERE o.idUsuario = :idUsuario AND o.nemotecnico = i.nemotecnico AND o.estaCerrada = 'false' Group by o.nemotecnico, o.esCompra, i.equivUltimo], line 1, column 53: syntax error at [as].
Internal Exception: MismatchedTokenException(8!=82)
at org.eclipse.persistence.exceptions.JPQLException.syntaxErrorAt(JPQLException.java:362)
at org.eclipse.persistence.internal.jpa.parsing.jpql.JPQLParser.handleRecognitionException(JPQLParser.java:304)
at org.eclipse.persistence.internal.jpa.parsing.jpql.JPQLParser.addError(JPQLParser.java:245)
at org.eclipse.persistence.internal.jpa.parsing.jpql.JPQLParser.reportError(JPQLParser.java:362)
at org.eclipse.persistence.internal.libraries.antlr.runtime.BaseRecognizer.recoverFromMismatchedElement(Unknown Source)
at org.eclipse.persistence.internal.libraries.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(Unknown Source)
at org.eclipse.persistence.internal.libraries.antlr.runtime.BaseRecognizer.mismatch(Unknown Source)
at org.eclipse.persistence.internal.libraries.antlr.runtime.BaseRecognizer.match(Unknown Source)
at org.eclipse.persistence.internal.jpa.parsing.jpql.antlr.JPQLParser.constructorExpression(JPQLParser.java:2635)
at org.eclipse.persistence.internal.jpa.parsing.jpql.antlr.JPQLParser.selectExpression(JPQLParser.java:2045)
at org.eclipse.persistence.internal.jpa.parsing.jpql.antlr.JPQLParser.selectItem(JPQLParser.java:1351)
at org.eclipse.persistence.internal.jpa.parsing.jpql.antlr.JPQLParser.selectClause(JPQLParser.java:1266)
at org.eclipse.persistence.internal.jpa.parsing.jpql.antlr.JPQLParser.selectStatement(JPQLParser.java:352)
at org.eclipse.persistence.internal.jpa.parsing.jpql.antlr.JPQLParser.document(JPQLParser.java:276)
at org.eclipse.persist
GRAVE: ence.internal.jpa.parsing.jpql.JPQLParser.parse(JPQLParser.java:133)
at org.eclipse.persistence.internal.jpa.parsing.jpql.JPQLParser.buildParseTree(JPQLParser.java:94)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:198)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:173)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:125)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:109)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1326)
... 59 more
Caused by: MismatchedTokenException(8!=82)
... 74 more
What can I do?? I have been stuck in this problem for 2 weeks :s I have tried almost everything..
Thanks in advance for your help!

SELECT tmp.contract_no, tmp.Actual, tmp.Actual - tmp.NbHours
FROM ( SELECT t.contract_no, sum(l.hrs) AS Actual, (c.labour_hours * c.labour_progress_per) / 100 AS NbHours
FROM TASK_DELEGATION t
INNER JOIN COST_CODE c
ON t.cost_code = c.cost_code AND t.contract_no = c.contract_no AND t.is_inactive=0
INNER JOIN Labour.dbo.LABOURALLOT l
ON l.contractNo = c.contract_no AND l.costcode = c.cost_code AND l.pm = 'N'
GROUP BY t.contract_no, c.labour_hours, c.labour_progress_per
) tmp

Similar Messages

  • Cannot use alias for dynamic column name in SELECT statement

    Hi,
    I want to retrieve values from several tables by using dynamic column & table name as below:
    DATA: tbl_name(30) TYPE c VALUE '/bic/tbi_srcsys',  " staticly initialized for this example
               col_name(30) TYPE c VALUE '/bic/bi_srcsys'.  " staticly initialized for this example
    SELECT (col_name) INTO CORRESPONDING FIELDS OF TABLE it_values FROM (tbl_name).
    The internal table "it_values" does not contain a field named "/bic/bi_srcsys", instead it has another generic field "value" so that the above code can be applied to other tables. I tried to use alias (AS) as below:
    SELECT (col_name) AS value INTO CORRESPONDING FIELDS OF TABLE it_values FROM (tbl_name).
    But this cannot work. I know that there are other ways to solve this problem, such as by using a single field in SELECT .. ENDSELECT and subsequently appending it to the work area and internal table as below:
    SELECT (col_name)  INTO (lv_value) FROM (tbl_name).
      wa_value-value = lv_value.
      APPEND wa_value TO it_values.
    ENDSELECT.
    Just wonder if there is any other more elegant workaround, because I might have several other fields instead of only one?
    Thanks.
    Regards,
    Joon Meng

    Hi Suhas,
    thanks for the quick reply.
    Sorry that I have not well described the structure of the internal table "it_values". This internal table contains several other fields (key, type, value, etc.).
    I guess that the following code
    SELECT (col_name) INTO TABLE it_values FROM (tbl_name).
    works if the internal table only has one field (value) or the field "value" is in the first position, right?
    In this case, I need to fill the "value" field of internal table it_values (ignore the other fields like type, key) with values retrieved from (col_name) of the DDIC table.
    Looking forward to your reply.
    BR,
    Joon Meng

  • Using Alias for the table column

    Dear all,
       Can we use alias name for the table column while developing zreport.
    ie.,
      without using standard  table column name ( like mara-matnr ), i wish to use mat_num for matnr. So that, one can easily understand the column.
    Could you help me out in this regard.
    Thanks in Advance,
    S.Sridhar.

    yes you can declare in ur internal table like
    material_number like mara-matnr.

  • Alias for Columns

    Hello,
    I am using Oracle Database 11g Enterprise Edition Release 11.1.0.6.0.
    I would like to have an Alias for my columns in a query.
    The main column value is a date like 201204 the Alias which should appear as column heading when the query is run should be like Apr-2012
    So I would like my output to be like
    Apr-12 May-12 Jun-12
    201204 201205 2012-06
    I am using a query like
    select '2001204'||' "'||to_char(to_date('201204','yyyymm'),'Mon-yy')||'"'
    from dual;
    This does not seem to give me the correct results. Am I doing something wrong ?
    Thanks
    fm

    IQ wrote:
    Hello,
    I am using Oracle Database 11g Enterprise Edition Release 11.1.0.6.0.
    I would like to have an Alias for my columns in a query.
    The main column value is a date like 201204 the Alias which should appear as column heading when the query is run should be like Apr-2012
    So I would like my output to be like
    Apr-12 May-12 Jun-12
    201204 201205 2012-06
    I am using a query like
    select '2001204'||' "'||to_char(to_date('201204','yyyymm'),'Mon-yy')||'"'
    from dual;
    This does not seem to give me the correct results. Am I doing something wrong ?
    Thanks
    fmThe names/datatypes/sizes and number of columns from a query is called the "projection" and is determined at parse time; therefore it cannot be determined by the data without using 2 passes of the data (one to determine what the projection should look like and a dynamic one to query the data again with that dynamically generated projection).
    Essentially what you are trying to do is abuse the SQL engine, and it is really something that is best done by reporting tools that query the data and then process it to format the output based on the data itself.
    {thread:id=2309172}

  • XSQL: problems using id-attribute-column

    Hi,
    I want to use id-attribute-column to put the records from a specific column in an attribute of an generated element of the same xsql:query. It works, but the query returns not only the attibutevalue in the attribute, bit also in an element.
    How can I get rid o that extra element.
    Can you please help me with this?
    Greetings, Martijn

    The attribute "id" is set properly but isn't shown in html
    because there is no html-element corresponding to UIColumn.

  • Facing problem with a date column in select query

    Hi,
    I am facing problem with a date column. Below is my query and its fainling with " invalid number format model" .
    Query: SELECT *
    FROM EMP
    WHERE trunc(LAST_UPDATED) >= to_date(to_char(22-05-2009,'dd-mm-yyyy'),'dd-mm-yyyy')
    LAST_UPDATED column is "DATE" data type.
    Please help me Thanks

    Radhakrishna Sarma wrote:
    SeánMacGC wrote:
    WHERE LAST_UPDATED >= to_date('22-05-2009','dd-mm-yyyy');
    You do not need the TRUNC here in any case.
    I don't think so. What if the user wants only data for 22nd May and the table has records with date later than 22nd also? In that case your query willl not work. In order for the Index to work, I think the query can be written like this I think Sean is right though. Use of TRUNC Function is quiet useless based on the condition given here, since the to_date Function used by OP will always point to midnight of the specified date, in this case 22-05-2009 00:00:00.
    Regards,
    Jo
    Edit: I think Sean proved his point... ;)

  • Using AppleScript for launch a raw-query Spotlight search?

    As per usual with my limited scripting skills, I am finding the apparently simple stuff rather difficult to achieve.
    My problem with Spotlight is that I want to use the same type of raw query repeatedly, but I want to avoid the tedium of having to:
    1) open my saved search
    2) choose "Show Criteria" to make the saved raw query visible
    3) edit the text field containing the raw query, where the visible stuff is not what I want to edit, so I have to scroll to the right within that tiny field
    So my idea would be to design a simple UI with AppleScript that
    1) pops up a dialog asking for a phrase to search
    2) launches a Spotlight search using the raw query:
    kMDItemTextContent=="xxx*"
    where "xxx" is the phrase that I am searching for, and opens a Finder window with the results of that search.
    My reason for wanting to do this is that, by default, a search for an exact phrase with Spotlight fails to return matches that contain the plural form when the searched phrase is a singular.
    See:
    http://www.betalogue.com/2010/05/07/spotlight-plural/
    http://www.betalogue.com/2010/05/11/spotlight-phrase/
    for more information about the background for this.
    Would this be relatively easy to do with AppleScript?
    Thanks in advance.
    Pierre

    Hi
    Pierre Igot wrote:
    Am I correct in assuming that this means that what I wanted could not just be achieved with AppleScript and required a Perl script?
    Message was edited by: Pierre Igot
    A smart folder is an XML file (PLIST), you can edit it in many ways.
    It's possible with other shell commands (sed or awk).
    But perl works seamlessly with extended characters (ASCII > 127)
    Also it's possible with AppleScript commands (open for access, read, write, close access), or with *property list file* in System events
    But it requires more lines of code.
    Here's the script :
    global a_text
    set smartFolder to "/Users/jack/Library/Saved Searches/Recherche dans “Bureau”.savedSearch"
    set a_text to text returned of (display dialog "Enter a phrase to search" default answer "")
    if a_text contains """ then
    set a_text to findAndReplace(""", "\"", a_text)
    end if
    tell application "System Events"
    set TheXML to property list file smartFolder
    repeat with i in (get property list items of contents of TheXML)
    set t_name to name of i
    if t_name is "RawQuery" then
    tell i to set value to my replace_text(get value)
    else if t_name is "SearchCriteria" then
    tell property list item 2 of property list item "displayValues" of property list item 1 of property list item "FXCriteriaSlices" of i to set value to my replace_text(get value)
    else if t_name is "RawQueryDict" then
    tell property list item "RawQuery" of i to set value to my replace_text(get value)
    end if
    end repeat
    end tell
    set smartFolder to ((POSIX file smartFolder) as alias)
    tell application "Finder"
    activate
    open smartFolder
    end tell
    on replace_text(t)
    set x to the offset of "kMDItemTextContent==" in t
    set L to length of t
    repeat with i from L to 1 by -1
    if character i of t = """ then
    set y to i
    exit repeat
    end if
    end repeat
    return (text 1 thru (x + 20) of t) & a_text & (text y thru -1 of t)
    end replace_text
    on findAndReplace(tofind, toreplace, t)
    set ditd to text item delimiters
    set text item delimiters to tofind
    set t to text items of t
    set text item delimiters to toreplace
    set t to t as string
    set text item delimiters to ditd
    return t
    end findAndReplace

  • Problem using alias field names in a sql query

    Hello,
    I have a question regarding a simple Oracle database SQL query writeup:
    In the following (badly written but properly working) SQL query:
    Query 1:
    select
    soe.field1,
    (soe.field2 + soe.field3) as field4,
    (soe.field5 - (soe.field2 + soe.field3)) as field6,
    (select comp.parValue*soe.field7
    from
    CompTable comp) as parValue,
    (select soe.field8 - (comp.parValue*soe.field7+ soe.field9)
    from
    CompTable comp) as field10
    from
    SomeTable soe
    PROBLEM 1:
    I am re writing the code (soe.field2 + soe.field3) to get the alias field4 or column name field4 that I have created on the fly in the previously for use with the following fields. Can't I rewrite the query as follows. There is something simple missing!
    Query 2:
    select
    soe.field1,
    (soe.field2 + soe.field3) as field4,
    soe.field5 - field4 as field6, <<< field4 does not work here
    (select
    comp.parValue*soe.field7
    from
    CompTable comp) as parValue,
    (select
    soe.field8 - (comp.parValue*soe.field7+ soe.field9)
    from
    CompTable comp) as field10
    from
    SomeTable soe
    PROBLEM 2:
    Similar to the above problem, I was thinking to get a field parValue out of the CompTable table and re-use many times rather than the code shown in Query 1:
    Query 3:
    select
    soe.field1,
    (soe.field2 + soe.field3) as field4,
    soe.field5 - field4 as field6,
    soe.field7* (select comp.parValue from CompTable comp) as parValue1,
    soe.field8 - (parValue1*soe.field7+ soe.field9) as field10      <<<< parvalue1 does not work here
    parValue1*soe.field9 as TaxCondition               <<<< parvalue1 does not work here
    from
    SomeTable soe
    See that the query becomes so simple, but the above query does not work. There is something fundamentally wrong in my usage of the alias field names in creating other fields. The Query1 seems to be the only working option but its very slow as I am redoing and re-writing the whole code again and again to get the parValue field out of the CompTable table for use to create many other fields.
    I will appreciate if you can guide me in the right direction on this issue.
    Thanks and Regards
    Rama

    SELECT tmp.contract_no, tmp.Actual, tmp.Actual - tmp.NbHours
    FROM ( SELECT t.contract_no, sum(l.hrs) AS Actual, (c.labour_hours * c.labour_progress_per) / 100 AS NbHours
    FROM TASK_DELEGATION t
    INNER JOIN COST_CODE c
    ON t.cost_code = c.cost_code AND t.contract_no = c.contract_no AND t.is_inactive=0
    INNER JOIN Labour.dbo.LABOURALLOT l
    ON l.contractNo = c.contract_no AND l.costcode = c.cost_code AND l.pm = 'N'
    GROUP BY t.contract_no, c.labour_hours, c.labour_progress_per
    ) tmp

  • Query help - Using Alias in column equation

    Hi All,
    I have selected some data as an alias and would like to refer to the alias in another equation column. I cannot figure out how to do this correctly.
    Here is my full query below, with a NULL called '3 Mnth Average' column because I am unsure how to reference the Alias and data type correctly for the required equation.
    For example, I want to return the '3 Mnth Average' result being the '3 Mnth Total' Alias divided by 3.  ('3 Mnth Total'  / 3).... Every time I try... i fail.
    Any help would be most appreciated.
    Best regards,
    John
    SELECT T0.ITEMCODE, T0.ITEMNAME,
    Cast((T0.ONHAND - T0.IsCommited) As INT) As 'Available',
    Cast(T0.ONHAND As INT) As 'In Stock', Cast(T0.IsCommited As INT) As 'Committed',
    Cast((SELECT SUM(T1.[Quantity]) FROM INV1 T1 WHERE T1.ITEMCODE = T0.ITEMCODE
    AND DATEPART(mm,T1.[DocDate])  >= DATEPART(mm,getdate())-3
    AND DATEPART(mm,T1.[DocDate]) <= DATEPART(mm,getdate())) As INT) As '3 Mnth Total',
    (NULL) As '3 Mnth Average',
    CAST ((SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 1 AND T1.ITEMCODE =
    T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) As INT) AS 'JAN QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE =
    T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'FEB QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 3 AND T1.ITEMCODE =
    T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'MAR QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 4 AND T1.ITEMCODE =
    T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'APR QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 5 AND T1.ITEMCODE =
    T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'MAY QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 6 AND T1.ITEMCODE =
    T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'JUN QTY',
    CAST ((SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 7 AND T1.ITEMCODE =
    T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) As INT) AS 'JUL QTY',
    CAST ((SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 8 AND T1.ITEMCODE =
    T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS INT) AS 'AUG QTY',
    CAST ((SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 9 AND T1.ITEMCODE =
    T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) As INT) AS 'SEP QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 10 AND T1.ITEMCODE =
    T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'OCT QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 11 AND T1.ITEMCODE =
    T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'NOV QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 12 AND T1.ITEMCODE =
    T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'DEC QTY'
    FROM dbo.OITM T0
    LEFT JOIN dbo.INV1 T1 ON T1.ItemCode = T0.ItemCode
    WHERE T0.SellItem = 'Y'
    GROUP BY T0.ItemCode, T0.ItemName, T0.OnHand, T0.IsCommited, YEAR(T1.DOCDATE)
    HAVING YEAR(T1.DOCDATE) = YEAR(GETDATE())
    ORDER BY T0. ITEMCODE

    Hi John,
    If you are not using temporary table, you have to rewrite complete formula to get 3 month average. There is no way to reference within the same query.
    Thanks,
    Gordon

  • Using Highlight for columns in data tables

    Hi, I'm using the "Highlight" function of SpryEffects in
    combination with the sorting features. My HTML structure is a
    simple data table, with a repeating region on the table row, so it
    pulls in as many rows there are pieces in the attached XML file.
    When I sort by one of the column headers at the top, I want to
    highlight that whole column, so users can see what they're sorting
    by. I'm able to get the first row of the data table highlighted,
    but none of the following rows work. I'm pretty sure the problem is
    that the highlight function only works when you use an id to define
    the element that you want highlighted. If it's in a repeating row,
    it sees many ids on the page, and only applies the highlight to the
    first one. I want to change the id to a class, so I can put
    multiple ones on the page and have it work, but I can't see how to
    do that in the SpryEffects.js file.
    Can anyone tell me if it's possible to do this? Thanks.
    Here's the portion of the .js file:
    function setupHighlight(element, effect)
    Spry.Effect.setStyleProp(element, 'background-image',
    'none');
    function finishHighlight(element, effect)
    Spry.Effect.setStyleProp(element, 'background-image',
    effect.options.restoreBackgroundImage);
    if (effect.direction == Spry.forwards)
    Spry.Effect.setStyleProp(element, 'background-color',
    effect.options.restoreColor);
    Spry.Effect.Highlight = function (element, options)
    var durationInMilliseconds = 1000;
    var toColor = "#ffffff";
    var doToggle = false;
    var kindOfTransition = Spry.sinusoidalTransition;
    var setupCallback = setupHighlight;
    var finishCallback = finishHighlight;
    var element = Spry.Effect.getElement(element);
    var fromColor = Spry.Effect.getStyleProp(element,
    "background-color");
    var restoreColor = fromColor;
    if (fromColor == "transparent") fromColor = "#ffff99";
    var optionFrom = options ? options.from : '#ffff00';
    var optionTo = options ? options.to : '#0000ff';
    if (options)
    if (options.duration != null) durationInMilliseconds =
    options.duration;
    if (options.from != null) fromColor = options.from;
    if (options.to != null) toColor = options.to;
    if (options.restoreColor) restoreColor =
    options.restoreColor;
    if (options.toggle != null) doToggle = options.toggle;
    if (options.transition != null) kindOfTransition =
    options.transition;
    if (options.setup != null) setupCallback = options.setup;
    if (options.finish != null) finishCallback = options.finish;
    var restoreBackgroundImage =
    Spry.Effect.getStyleProp(element, 'background-image');
    options = {duration: durationInMilliseconds, toggle:
    doToggle, transition: kindOfTransition, setup: setupCallback,
    finish: finishCallback, restoreColor: restoreColor,
    restoreBackgroundImage: restoreBackgroundImage, from: optionFrom,
    to: optionTo};
    var highlightEffect = new Spry.Effect.Color(element,
    fromColor, toColor, options);
    highlightEffect.name = 'Highlight';
    var registeredEffect =
    SpryRegistry.getRegisteredEffect(element, highlightEffect);
    registeredEffect.start();
    return registeredEffect;

    Hi Philip, Thanks a lot for puting this enhancement request through.
    Just downloaded the latest Patch upgrading to v 3.1.2-704 and confirmed that this functionality is not available yet.
    Keeping your experience in mind what kind of expectation to you have for the approval and realization of your request?
    Most likely this will take a couple of month – right? Or is there a beta version of 3.2 already available we could use.
    Thanks a lot. Cheers Stefan

  • Alias for column names : Urgent

    Hi ,
    I want alias names for my columns.
    I'm writing query like this
    inquiryBean.setQueryStatement("SELECT CDE AS "New Code", TXT AS "New Text" FROM TNR004_PY_METH");
    But it is giving me an error because there is space between New and Code also double quote problem is there.
    In short I don't know how to write this query statement ?
    Can anybody help me ?
    Thanks,
    -priya

    Try to do this:
    inquiryBean.setQueryStatement("SELECT CDE AS [New Code], TXT AS [New Text] FROM TNR004_PY_METH");

  • Using variables for column headings in REUSE_ALV_GRID_DISPLAY

    Hi Everyone,
               Is it possible for me to display the column heading in REUSE_ALV_GRID_DISPLAY using a variable?
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos         =   13.
      ls_fieldcat-reptext_ddic      =  LWOP1.  " <===Here is my variable for my
                                                                          column heading
      ls_fieldcat-tabname           =  'ITAB'.
      ls_fieldcat-fieldname         =  'LWOP2'.
      ls_fieldcat-datatype          =  'CURR'.
      ls_fieldcat-outputlen       =  15.
      APPEND ls_fieldcat TO rt_fieldcat.
    Please help me.  Thanks in advance.

    for me isfielldcat-seltext_l = v_heading. working properly .
    i think you cant give
    ls_fieldcat-reptext_ddic = LWOP1.
    but i m not sure.
    regards
    shiba dutta

  • Using VPD for Column Masking

    Hi ,
    Arup nanda demostrate [http://www.oracle.com/technology/pub/articles/10gdba/week14_10gdba.html]
    how to use Column Masking using VPD.
    I would like to use TDE+VPD for PCI DSS requirements.
    In order to protect the data from been stolen i am going to use TDE.
    Regarding the VPD , i need to allow few user to see the entire credir card number , and for some user to see just
    the last 4 digits of the credit card.
    As far as i understood from the link above , all i can do is to mask column valus to null value.
    I thought using dbms_crypto , but Tom Kyte suggested hir
    [http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1631574900346651898]
    not to do it.
    My question is if it somehow possible to see just the last 4 digit using VPD.
    Thanks

    No you can't, Column level VPD is not ment to give a masking solution, I have filled a request to oracle to enhance VPD to support this feature, I didn't get any answer for it.
    You will have to find a nother way, VPD is not it.
    I suggest you to add another column to your tables that holds the credit card number, the new column will hold the masked value of the credit card - write PL/SQL function to do it, and update the table, then use simple views to control what data each user will see.
    Oded
    [www.dbsnaps.com]
    [www.orbiumsoftware.com]

  • [Solved] Problem using kdebindings for ruby

    As a weekend project I was going to look into using ruby as language for developing KDE plasma widgets.
    I have kdebindings-ruby 4.6.0-1 along with the required kdebindings-smoke 4.6.0-1.
    When trying:
    require "plasma_applet"
    I get the error:
    LoadError: libsmokebase.so.3: cannot open shared object file: No such file or directory - /usr/lib/ruby/site_ruby/1.9.1/x86_64-linux/plasma_applet.so
    However when checking the directory
    /usr/lib/ruby/site_ruby/1.9.1/x86_64-linux/
    32K plasma_applet.so
    shows up clear as day.
    So what gives? I haved tried to find an answer here on the forums and on google but perhaps my google foo is too weak.
    Thanks
    Edit: With some more google foo I found this: https://github.com/pcapriotti/kaya/issu … ed#issue/3
    Where this statement is made:
    Kdebindings-smoke does not provide anymore libsmokebase.so.3, either in chakra-Linux or Arch Linux, was available in kde 4.5.5 but no in 4.6.0
    Does this need to be submitted as a bug?
    Last edited by ilpianista (2011-02-25 13:22:49)

    Hi, i know this is solved but i have similar problem with kdebindings-qtruby 4.7.0-1
    i start irb. and when i type require "Qt"
    irb(main):003:0> require "Qt"
    LoadError: libsmokebase.so.3: cannot open shared object file: No such file or directory - /usr/lib/ruby/site_ruby/1.9.1/x86_64-linux/qtruby4.so
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from /usr/lib/ruby/site_ruby/1.9.1/Qt.rb:1:in `<top (required)>'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from (irb):3
    from /usr/bin/irb:12:in `<main>'
    same when i try require "qtruby4" or somethink like this.
    but file /usr/lib/ruby/site_ruby/1.9.1/x86_64-linux/qtruby4.so exist

  • Problem using QuickTime for iPhone

    Hi Everybody,
    I am a developer and i program an application for the iPhone. I want to know if it is possible to block the controller in the Quicktime player for iPhone ?
    I use the embed code with the "<param name='controller' value='false'>" but the controller is always here.
    I want to stream a video, where the user can't paused the video.
    Can you help me ?
    Thanks a lot

    I had this same problem and solved it when I realized that the software upgrade download was about 600MB, but I had less free space available on the iPhone.
    So I deleted some large music files to make space available, then started the upgrade again and it worked fine.
    One caveat: since I had "Automatically fill free space with songs" checked in iTunes, under the iPhone "Music" tab, simply deleting songs from the iPhone's playlist did not clear up the space.  Other songs got loaded to fill up the space.  I had to uncheck "Automatically fill free space with songs" as well as delete songs in order to free up the space.
    Hope this helps.

Maybe you are looking for

  • How to change the opening page, when we open a new tab?

    When I open a new tab, it opens the babylon search (which is annoying). How to change it to the thumbnail view showing most visited pages? PS: I have not installed anything Babylon related to my PC. I checked the control panel nothing Babylon related

  • No_ams_auth / qtn_swins_note messages with nokia 6600

    I get no_ams_auth and qtn_swins_note deploying application to 6600. Within the emulator (from nokia) it works. Oliver

  • Intel Galileo and Bluetooth(Master)

    Hello Everyone, How would you go about bluetooth usage on the Galileo? I bought an Intel 6235 and I also bought and arudino bluetooth shield. For the bluetooth shield It seems though if you want to use it as a master it does not work.  Whenever I rea

  • Adobe Air and Vista SP2

    Hi, I am trying to help somebody to view the advents calendar by Jacquie Lawson, which requires Adobe Air.  The lady has Vista SP2.  Ad obe Air is installed, but will not run.  I realize that it is a known problem, but has anybody found a way of deal

  • Would anyone with InDesign CS2 be willing to convert my file??

    I have InDesign CS3 on my work computer and need to take a file home to work on but I have only CS on my home computer. Would anyone with CS2 be willing to take my INX file and resave again in CS2 as an INX file  and send it back to me so I can open