Problem in a query

I have got a typical requirement. There is a table having the details of the employees this table also consists the employee code of their boss. I got to write a query which gives me the employee's code, name, designation, and the name of the bosses till the last level. I mean the name of the immediate boss, then the next one above him and so on
I have got the table structure as follows,
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NOT NULL NUMBER(2)
HRA NUMBER(6,2)
I have tried using self joining but the problem is that if the number of designation changes then the query will not work
please help
thanks

What you need is a HIERARCHICAL query that uses the LEVEL pseudocolumn and START WITH and CONNECT BY PRIOR. If you search the Oracle on-line documentation and/or these forums for the words that I put in upper case in the previous sentence, you will find plenty of examples and explanations for how to do this. For example, the following section in the on-line documentation:
http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a85397/state21b.htm#2066379
contains the following example, which you should be able to do adapt for your purposes:
SELECT     LPAD(' ',2*(LEVEL-1)) || ename org_chart,
           empno, mgr, job
FROM       emp
START WITH job = 'PRESIDENT'
CONNECT BY PRIOR empno = mgr;
ORG_CHART    EMPNO      MGR        JOB
KING               7839            PRESIDENT
  JONES            7566       7839 MANAGER
    SCOTT          7788       7566 ANALYST
      ADAMS        7876       7788 CLERK
    FORD           7902       7566 ANALYST
      SMITH        7369       7902 CLERK
  BLAKE            7698       7839 MANAGER
    ALLEN          7499       7698 SALESMAN
    WARD           7521       7698 SALESMAN
    MARTIN         7654       7698 SALESMAN
    TURNER         7844       7698 SALESMAN
      JAMES        7900       7698 CLERK
CLARK             7782       7839 MANAGER
   MILLER          7934       7782 CLERK

Similar Messages

  • Problem in Adhoc Query's set operation functionality.

    Hi Experts,
    I am facing problem executing Adhoc Query's set operation functionality.
    In Selection Tab, following operations are performed :-
    Execute a query and mark it as 'Set A'.(Say Hit list = X)
    Execute another query and mark it as 'Set B'.(Say Hit list = Y)
    In Set operation Tab, following operations are performed :-:-
    Carry out an Operations 'Set A minus Set B'.
    which results in Resulting Set = Z.
    Transfer the resulting set 'in hit list' and press the copy resulting set button.
    In Selection Tab, Hit list is populated with Z.
    And when output button is pressed, I get to see 'Y' list and not 'Z' list.
    Kindly help.
    Thanks.
    Yogesh

    Hi Experts,
    I am facing problem executing Adhoc Query's set operation functionality.
    In Selection Tab, following operations are performed :-
    Execute a query and mark it as 'Set A'.(Say Hit list = X)
    Execute another query and mark it as 'Set B'.(Say Hit list = Y)
    In Set operation Tab, following operations are performed :-:-
    Carry out an Operations 'Set A minus Set B'.
    which results in Resulting Set = Z.
    Transfer the resulting set 'in hit list' and press the copy resulting set button.
    In Selection Tab, Hit list is populated with Z.
    And when output button is pressed, I get to see 'Y' list and not 'Z' list.
    Kindly help.
    Thanks.
    Yogesh

  • Problems in SQL Query

    Dear All,
    I am having some problem in SQL query. I am trying to get total sum of one inventory using the following query it works fine:
    sum(case when mt.transaction_quantity > 0 then (mt.transaction_quantity) else 0 end) "TOT_IN"
    ,sum(case when mt.transaction_quantity >= 0 then 0 else (abs(mt.transaction_quantity)) end) "TOT_OUT"
    But when I breakup the total sum into monthly breakup it fails to return the correct some could any one help what is wrong in the following query which is returning incorrect monthly sum. Following is that query. Your help in this regard would highly be appreciated.
    sum(case when mt.transaction_quantity > 0 then (decode (floor (floor (to_date('17-MAR-2009')- mt.transaction_date) / 30), 0, mt.transaction_quantity, null)) else 0 end) "MONTH1_IN"
    ,sum(case when mt.transaction_quantity >= 0 then 0 else (decode (floor (floor (to_date('17-MAR-2009')- mt.transaction_date) / 30), 0, abs(mt.transaction_quantity), null)) end) "MONTH1_OUT"
    Thanks

    Hi,
    Sorry, I don't really understand what you want.
    Whenever you have a question, it helps to post:
    (1) The version of Oracle (and any other relevant software) you're using
    (2) A little sample data (just enough to show what the problem is) from all the relevant tables
    (3) The results you want from that data
    (4) Your best attempt so far (formatted)
    (5) The full error message (if any), including line number
    Executable SQL statements (like "CREATE TABLE AS ..." or "INSERT ..." statements) are best for (2).
    If you can present your problem using commonly available tables (for example, tables in scott schema, or views in the data dictionary), then you can omit (2).
    Formatted tabular output is okay for (3). Type these 6 characters
    {code}
    (small letters only, inside curly brackets) before and after the tabular text, to preserve spacing.
    What exactly do you mean by "monthly breakup"?
    If you want separate figures for each calendar month, Blushadow's suggestion (TRUNC (mt.transaction_date, 'MM')) is what you want.
    If you want separate figures for the last 30 days before today, then something like what you posted ("FLOOR ((:target_date - mt.transaction_date) / 30)": the extra FLOOR doesn't help any) should work, so if you ran the query on March 17, 2009, the first "month" would be February 16 through March 17.
    In a CASE statement, there's rarely any need to use DECODE. The following is equivalent to the last line of code you posted:
    ,       SUM ( CASE
                WHEN  mt.transaction_quantity >= 0
                THEN  0
                WHEN  TO_DATE ('17-MAR-2009', 'DD-MON-YYYY') - mt.transaction_date
                        BETWEEN 0
                        AND     29.99999  -- 30 days minus a fraction of a second
                THEN  ABS (mt.transaction_quantity)
               END
             )          AS month1_outDon't you find this easier to understand (and debug)?

  • Problem with a query with a BLOB data type

    Hi i've a problem with this query in 11g. R1
    SELECT
          LOGTIMESTAMP,
          LOGTIMEMILLIS,
          MSGID,
          XMLTYPE(MESSAGEBODY, nls_charset_id('AL32UTF8')).getClobVal()  as LLamada
    FROM
        vordel.AUDIT_MESSAGE_PAYLOAD,
        vordel.AUDIT_LOG_POINTS
    WHERE
        AUDIT_LOG_POINTS.LOGPOINTSPK = AUDIT_MESSAGE_PAYLOAD.MP_LOGPOINTSPK AND
        LOGTIMESTAMP between TO_TIMESTAMP('03-12-2011 00:00','DD-MM-YYYY HH24:MI') and  TO_TIMESTAMP('03-12-2011 12:00','DD-MM-YYYY HH24:MI')
         and filtertype = 'LogMessagePayloadFilter'
      and filtername like 'Log Llamada%'MESSAGEBODY: data type of the Column is BLOB
    throw this error after execute the query
    Error:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00200: could not convert from encoding UTF-8 to UCS2
    Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 283
    ORA-06512: at line 1

    Could you check the BLOB really contains UTF-8 encoded XML?
    What's your database character set?The BLOB contains UTF-8 Encoded
    and the database where i am connectes have AL32UTF8 character set, but my internal instance have "AMERICAN_AMERICA.WE8ISO8859P1"
    that is a problem?
    How could I change the character set of the oracle local client to the character set of the remote oracle data base?

  • Strange problem in a query

    Hello all,
    I'm facing a non-sense problem in a query, I hope you could help me.
    I have defined a structure in the rows of my query. Inside the structure, I have defined several selections and formulas. Selections are basically account intervals and formulas are additions of some selections.
    Some formulas are correct, adding amounts properly but others aren't. Instead of the addition, a * appears.
    Even if I copy and paste now one correct formula and show both in the execution, the first one appears correctly and the second one shows a *. How is it possible?
    I need some suggestions about what to do. Thank you in advance. I will assign points.

    Thank you for your answers!
    I have followed Mustafa advice in SPRO and now I don't see any *.
    But there is a thing I can't understand now. As said before, I created a formula based on selections and it shows correctly the amount and the unit.
    Then I have copied the formula and pasted after the first one. Both of them show the same value but only the first one is showing the amount.
    What do you think? How is it possible if both have been defined identically?

  • Problem in parameter query.

    Post Author: eaglesoft
    CA Forum: Data Connectivity and SQL
    I'm using Crystal reports xi. I have problem on parameter fields.    field name-EmployeeCode, datatype-String.In report,I kept the following query in selection expert,(EmployeeTable.EmployeeCode) like "" +{?employeeCode}  employeeCode-String Parameter,(while selecting Single option,it'll display in report that particular employeecode only), like "" (while selecting All option  in Jsp page,it'll display All employeecodes from database).Now, I have changed my EmployeeCode datatype as integerfield name-EmployeeCode, datatype-String.In Slection Expert, I'm facing problem on previous query "String required" ,though I kept employeeCode as number.(It should fit for Single and All Option)Pls help me on Previous query with integer datatype.

    Post Author: jlspublic
    CA Forum: Data Connectivity and SQL
    It appears that your problem comes from using "+" as the concatenation operator.  From the documentation for this operator:If you want to include a value from a numeric field (for example, an account
    balance), you must first convert that value to a text string using the ToText function:
    "Your account balance is " + ToText({file.BALANCE}) + "."
    Instead of casting, you could also switch to the "&" concatenation operator which gives the added benefit of avoiding subtle bugs when attempting to concatenate strings of numbers.

  • Problem in xml query

    Hi
    I am working on BLS and having problem in xml query.I want to perform some calculation over xml columns.Than total of this as a new column.I can do this part in logic editor itself but can i do these both task by XSLT.
    Can be made our own XSLT for this ?
    I am feeling kind of fear to xslt. Can anybody help me in this.
    Thanks a lot in advance
    thomas

    Ram,
    In xMII there is a list of predefined xslt transforms that do something similar to what you are explaining.  The 3 that I think may be what you are looking for are
    they are under Calculation Transformations and Subtotal Transformation take a look at these and tell me if they are doing what you want to accomplish.  In the xMII help file do a search on Inline Transforms or navigate to Advanced Topics -> Inline Transforms -> Predefined Inline Transforms.  In this section there are examples of how to use these transforms and apply them in the query templates.  If this is not what you are looking for can you explain in a little more detail along with a simple example of how you want this transform to work.  Also why do you want to use xslt if you can already accomplish this in BLS?
    Regards,
    Erik

  • Navigational Attribute Problem in Input Query

    Hi,
    I am having a problem in input query implementation which uses a navigational attribute. I have, for eg, only one char 'customer' in rows; i want to exclude the customers with the status D (deleted) from displaying (Status is nav. attr. of customer).  I tried this by restricting in filter, Status D-"exclude". But as soon as I do this, query no longer remains input ready! (I also tried putting the same restriction in Default Values area rather than Filter, but ended with the same result )
    I discovered that if, furthermore, I put Status in rows (with the above said restriction still remaining), query is again input ready.
    Can't we exclude values in the filter on an input query? I want to know if this is a restriction with IP or a bug?

    Hi Gregor,
    Thanks for the explanation. But this makes me wonder, because due to this restriction one of the BIG advantages queries had over the planning layouts of BPS, seems to be gone. I mean, using navigational attributes for filtering; if we have to always have a single value restriction on a nav. attr., this will really be restricting. Is it expected that this will be changed in a later SP?
    And there is another problem that is coming due to this. When I use the exclude filter and also the nav. attr. Status in rows, then the query becomes input ready, but there are warning messges displaying when the query opens saying -
    Characteristic Customer has no master data for "C1"
    Characteristic Customer has no master data for "C2"
    etc... (these are the customers with status D). We are on SP15.
    Please suggest what should I do to get rid of these messages?
    Edited by: Mayank Gupta on Apr 10, 2008

  • Problem in update Query of  MySQL

    Hi
    I have a large amounts of records in a teble & i want to update the records in a particular condition but it takes time in updating.
    I have also used batch update but it's also not going to solve my problem.
    can anyone help what should i do to frequently update in a large amount of data.
    I am using MySQL along with core java.

    It's not a Java question but more of a database profiling question. Try to post your description of the problem and the query in a MySQL forum.
    Kaj

  • Problem With The Query

    Hi gurus,
    I have a problem in a query
    I have a lot of records that are the same and I don’t want to sum the value of them more than once. How can this be done??
    The following table should illustrate my problem:
    DEPT--MONTHCFBID----SCORE
    ALST--APR100--
    3
    ALST--MAY100--
    3
    ALST--JUN101--
    4
    ALST--APR102--
    5
    Overall Score 15
    I want the Overall Score to be 12. (only summing up unique records Of CFBID).
    Any help will be greatly appreciated.
    Regards
    Supraja.K

    Hi,
    I had Done with Formula with Excveption Aggregation as Average And reference charecterstic as CFBID
    DEPT--MONTHCFBID----SCORE
    ALST--APR100--
    3
    ALST--MAY100--
    3
    ALST--JUN101--
    4
    ALST--APR102--
    5
    Overall Score 15
    I want the Average Score12/3 = 4.
    but I am getting as 15/3 = 5
    What to Do any other Solution please

  • Problem with Hierarchical query

    Gurus,
    I have a problem with hierarchical query, which I am pasting below.
    select sys_connect_by_path (Fname,'/')"PATH",Fname,id,level
    ,(SELECT COUNT(ID)-1 FROM (SELECT CONNECT_BY_ROOT LNAME LNAME,ID FROM CMT_PERSON
    START WITH ID = 'emplo000000000126009'
    CONNECT BY PRIOR ID=MANAGER_ID)
    GROUP BY FNAME)"COUNT"
    from CMT_PERSON
    WHERE
    LEVEL <= 4
    ----And ID='emplo000000000001877'
    CONNECT BY PRIOR id=manager_id
    ----AND NOT LEVEL > 3
    START WITH ID='emplo000000000126009'
    As per the result, count is getting repeated for all the levels. That is, count is coming 16100 for every level, Can you please help where exactly I am going wrong
    Regards

    You do not say anything about what count you want to get?
    A wild guess could be:
    select
       sys_connect_by_path (p1.fname, '/') "PATH",
       p1.fname,
       p1.id,
       level,
       (select count (id) - 1
        from
           (select connect_by_root p2.lname lname, p2.id
            from cmt_person p2
            start with p2.id = p1.id
            connect by prior p2.id = p2.manager_id)
        ) "COUNT"
    from cmt_person p1
    where level <= 4
    connect by prior p1.id = p1.manager_id
    start with p1.id = 'emplo000000000126009';Since your inner query simply starts with the hardcoded employee id, naturally it will give you the same count.
    My guess is your inner query should start with the person id from the outer query?
    If that is not the case - please state in plain english what you are trying to accomplish ;-)
    (Oh, and please paste code within tags so we can read it more easily...)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Problem with af:query

    Hi,
    I have a problem with af:query. Here's what I do:
    1. create a VO, define view criteria
    2. drag and drop view criteria from data controls to an empty form, choosing query and table
    3. When I run the page and click any of the buttons, I get: "Because of inactivity, your session has timed out and is no longer active...."
    I see no exceptions in output window. What am I doing wrong?
    Here is my view defenition:
    <?xml version="1.0" encoding="windows-1250" ?>
    <!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
    <!---->
    <ViewObject
    xmlns="http://xmlns.oracle.com/bc4j"
    Name="EmployeesView"
    Version="11.1.1.49.49"
    SelectList="Employees.EMPLOYEE_ID,
    Employees.FIRST_NAME,
    Employees.LAST_NAME,
    Employees.EMAIL,
    Employees.PHONE_NUMBER,
    Employees.HIRE_DATE,
    Employees.JOB_ID,
    Employees.SALARY,
    Employees.COMMISSION_PCT,
    Employees.MANAGER_ID,
    Employees.DEPARTMENT_ID"
    FromList="EMPLOYEES Employees"
    BindingStyle="OracleName"
    CustomQuery="false"
    PageIterMode="Full"
    UseGlueCode="false">
    <DesignTime>
    <Attr Name="_codeGenFlag2" Value="Access|VarAccess"/>
    </DesignTime>
    <Variable
    Name="firstName"
    Kind="viewcriteria"
    Type="java.lang.String"
    DefaultValue="0"/>
    <EntityUsage
    Name="Employees"
    Entity="project3.Employees"
    JoinType="INNER JOIN"/>
    <ViewAttribute
    Name="EmployeeId"
    IsNotNull="true"
    PrecisionRule="true"
    EntityAttrName="EmployeeId"
    EntityUsage="Employees"
    AliasName="EMPLOYEE_ID"/>
    <ViewAttribute
    Name="FirstName"
    PrecisionRule="true"
    EntityAttrName="FirstName"
    EntityUsage="Employees"
    AliasName="FIRST_NAME"/>
    <ViewAttribute
    Name="LastName"
    IsNotNull="true"
    PrecisionRule="true"
    EntityAttrName="LastName"
    EntityUsage="Employees"
    AliasName="LAST_NAME"/>
    <ViewAttribute
    Name="Email"
    IsUnique="true"
    IsNotNull="true"
    PrecisionRule="true"
    EntityAttrName="Email"
    EntityUsage="Employees"
    AliasName="EMAIL"/>
    <ViewAttribute
    Name="PhoneNumber"
    PrecisionRule="true"
    EntityAttrName="PhoneNumber"
    EntityUsage="Employees"
    AliasName="PHONE_NUMBER"/>
    <ViewAttribute
    Name="HireDate"
    IsNotNull="true"
    PrecisionRule="true"
    EntityAttrName="HireDate"
    EntityUsage="Employees"
    AliasName="HIRE_DATE"/>
    <ViewAttribute
    Name="JobId"
    IsNotNull="true"
    PrecisionRule="true"
    EntityAttrName="JobId"
    EntityUsage="Employees"
    AliasName="JOB_ID"/>
    <ViewAttribute
    Name="Salary"
    PrecisionRule="true"
    EntityAttrName="Salary"
    EntityUsage="Employees"
    AliasName="SALARY"/>
    <ViewAttribute
    Name="CommissionPct"
    PrecisionRule="true"
    EntityAttrName="CommissionPct"
    EntityUsage="Employees"
    AliasName="COMMISSION_PCT"/>
    <ViewAttribute
    Name="ManagerId"
    PrecisionRule="true"
    EntityAttrName="ManagerId"
    EntityUsage="Employees"
    AliasName="MANAGER_ID"/>
    <ViewAttribute
    Name="DepartmentId"
    PrecisionRule="true"
    EntityAttrName="DepartmentId"
    EntityUsage="Employees"
    AliasName="DEPARTMENT_ID"/>
    <ViewCriteria
    Name="EmployeesViewCriteria"
    ViewObjectName="project3.EmployeesView"
    Conjunction="AND">
    <Properties>
    <CustomProperties>
    <Property
    Name="mode"
    Value="Basic"/>
    <Property
    Name="allowConjunctionOverride"
    Value="true"/>
    <Property
    Name="autoExecute"
    Value="false"/>
    <Property
    Name="showInList"
    Value="true"/>
    <Property
    Name="displayOperators"
    Value="InAdvancedMode"/>
    </CustomProperties>
    </Properties>
    <ViewCriteriaRow
    Name="vcrow24"
    UpperColumns="1">
    <ViewCriteriaItem
    Name="FirstName"
    ViewAttribute="FirstName"
    Operator="STARTSWITH"
    Conjunction="AND"
    UpperColumns="0"
    Required="Optional">
    <ViewCriteriaItemValue
    Name="EmployeesViewCriteria_vcrow24_EmployeeId_vcval0"
    Value=":firstName"
    IsBindVarValue="true"/>
    </ViewCriteriaItem>
    </ViewCriteriaRow>
    </ViewCriteria>
    <ViewLinkAccessor
    Name="EmployeesView"
    ViewLink="project3.EmpManagerFkLink"
    Type="oracle.jbo.RowIterator"
    IsUpdateable="false"/>
    </ViewObject>
    And JSF page:
    <af:panelGroupLayout layout="vertical">
    <af:panelHeader text="Employees">
    <af:query id="employeesViewCriteriaQueryId" headerText="Search"
    disclosed="true"
    resultComponentId="employeesViewCriteriaQueryResultId"
    value="#{bindings.EmployeesViewCriteriaQuery.queryDescriptor}"
    model="#{bindings.EmployeesViewCriteriaQuery.queryModel}"
    queryListener="#{bindings.EmployeesViewCriteriaQuery.processQuery}"
    queryOperationListener="#{bindings.EmployeesViewCriteriaQuery.processQueryOperation}"/>
    </af:panelHeader>
    <af:table value="#{bindings.EmployeesView1.collectionModel}" var="row"
    rows="#{bindings.EmployeesView1.rangeSize}"
    emptyText="#{bindings.EmployeesView1.viewable ? 'No rows yet.' : 'Access Denied.'}"
    fetchSize="#{bindings.EmployeesView1.rangeSize}"
    id="employeesViewCriteriaQueryResultId">
    <af:column sortProperty="EmployeeId" sortable="false"
    headerText="#{bindings.EmployeesView1.hints.EmployeeId.label}">
    <af:outputText value="#{row.EmployeeId}">
    <af:convertNumber groupingUsed="false"
    pattern="#{bindings.EmployeesView1.hints.EmployeeId.format}"/>
    </af:outputText>
    </af:column>
    <af:column sortProperty="FirstName" sortable="false"
    headerText="#{bindings.EmployeesView1.hints.FirstName.label}">
    <af:outputText value="#{row.FirstName}"/>
    </af:column>
    <af:column sortProperty="LastName" sortable="false"
    headerText="#{bindings.EmployeesView1.hints.LastName.label}">
    <af:outputText value="#{row.LastName}"/>
    </af:column>
    </af:table>
    </af:panelGroupLayout>
    Regards
    Jernej
    Message was edited by:
    Jernej Kase

    It also seems that quick queries don't work with SQL92 sqlBuilder.
    I get the following error:
    Messages for this page are listed below.
    Error     
    SQL error during statement preparation. Statement: SELECT Employees.EMPLOYEE_ID, Employees.FIRST_NAME, Employees.LAST_NAME, Employees.EMAIL, Employees.PHONE_NUMBER, Employees.HIRE_DATE, Employees.JOB_ID, Employees.SALARY, Employees.COMMISSION_PCT, Employees.MANAGER_ID, Employees.DEPARTMENT_ID FROM EMPLOYEES Employees WHERE (( ( ( UPPER(Employees.FIRST_NAME) LIKE UPPER(:vc_temp_1) ) OR ( ? IS NULL ) ) ) )
    Error     
    Missing IN or OUT parameter at index:: 2
    Is this a bug or this doesn't work by design?
    Edit: and if I create named query I get the following error:
    Caused by: oracle.jbo.NoDefException: JBO-25058: Definition fn of type Attribute not found in EmployeesView1
         at oracle.jbo.server.ViewObjectImpl.findAttributeDef(ViewObjectImpl.java:5634)
         at oracle.jbo.uicli.binding.JUSearchBindingCustomizer.getQuickSearchVC(JUSearchBindingCustomizer.java:847)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding.processQuery(FacesCtrlSearchBinding.java:222)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
         ... 47 more
    I think just ran out of options...
    Message was edited by:
    Jernej Kase

  • Problem with update-query

    Hallo,
    i have a problem with following query. I wanna update the columns in the nutzung table. There are 7 columns but my query updates the geometry that in all columns is the same geometry or I can not update because the query gives more than 1 row in the subquery.
    update nutzung
    set geometrie=(SELECT F1840_GEOM FROM UG_F1840_GEOM,Nutzung WHERE NUTZUNG.OBJNR=UG_F1840_GEOM.F1840_OBJNR AND GETFEATUREID(UG_F1840_GEOM.F1840_FID) IN(SELECT MSLINK FROM FEATURE WHERE FCODE like '%0000'));
    Maybe I need the ug_f1840_geom table in the update query. Don't know how to change the query.
    Regards, Katrin

    hi it's me again .I am getting error for this
    statement
    if(numOfUsers>0)
    stmt.executeUpdate("update defaultchatrooms set
    s set nodename =
    '"+chatTopic+"'('"+numOfUsers+"')'");
    1. Your update string looks like this:
    update defaultchatrooms set nodename = 'someChatTopic'('0')'
    Does that look right to you?
    2. This will update the column nodename in every row in the table defaultchatrooms. Aren't you missing a "where" condition?

  • Problem with jump query

    Hello ,
       iam having problem with jump query when i execute the web report but the same jump query is working fine in Bex analyzer.i think there are some settings need to be done in SAP WAS for web report. if it so can anybody tell me how to maintain these settings so that i can execute the my web report.
    Regards
    Komal

    Hi Komal,
    What is the problem you are facing while executing the report.
    Are you working on WAD? Explain clearly about your problem you are facing.
    Regards,
    KK.

  • Sort problem on dynamic query !!

    Hi,
    I have a dynamic query written in pl/sql, when I check "Sort" for each field in Report Attribute, error message raised up as "ORA-01785: ORDER BY item must be the number of a SELECT-list expression".
    If I do not check Sort, it works fine. In my apps I need all fields sorted by user, how to fix this problem?
    My query as below:
    declare
    query varchar2(2000):='select';
    s_class varchar2(1000);
    cursor c1 is select * from demo_preference;
    begin
    for c1_val in c1 loop
    if c1_val.login is not null then
    query := query ||' ' || 'login' || ',';
    end if;
    if c1_val.id is not null then
    query := query ||' ' || 'id' || ',';
    end if;
    end loop;
    query := SUBSTR(query, 1, length(query)-1);
    s_class := '(NVL(:P2_class, ''%'' || ''null%'') = ''%'' || ''null%'' OR
    EXISTS (SELECT 1 FROM apex_collections WHERE collection_name = ''P2CLASSCOL'' AND c001 = class))';
    query := query ||' ' || 'from ming.reg_report_view1 where'
    || ' ' || s_class;
    return(query);
    end;

    Maybe the internally mapped column used when you clicked on sort is not shown in the report. Try using aliases when you construct the query string, it could help apex internally in identifying a column even if its order changes for a different user. After all the column order in the code is dynamic and I guess even the no of columns displayed might vary both of which could make sorting on a column identified with a number, invalid.
    How about displaying the report query somewhere, so that you know what is the exact query being processed, it might give you better information about the problem.
    If the problem persists, then use a collection that is fetched those record using the same query string and change the report to refer the collection and then set column sorting on. This way apex would get confused on what columns are being sorted and it would just sort on a c001..c050 column as though it was a string(yes problems with number columns sorting when you do this).

  • [Execute SQL Task] Error: Executing the query "DECLARE_@XMLA nvarchar(3000) ,__@DateSerial nvarch..." failed with the following error: "Incorrect syntax near '-'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly,

    Hi
    DECLARE @XMLA nvarchar(3000)
    , @DateSerial nvarchar(35);
    -- Change date to format YYYYMMDDHHMMSS
    SET @DateSerial = CAST(GETDATE() AS DATE);
    --SELECT @DateSerial
    Set @XMLA = 
    N' <Batch xmlns="http://schemas.microsoft.com/analysis services/2003/engine">
     <ErrorConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2"
    xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200"
    xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200">
    <KeyErrorLimit>-1</KeyErrorLimit>
    <KeyNotFound>IgnoreError</KeyNotFound>
    <NullKeyNotAllowed>IgnoreError</NullKeyNotAllowed>
     </ErrorConfiguration>
     <Parallel>
    <Process xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2"
    xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200"
    xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300">
     <Object>
     <DatabaseID>MultidimensionalProject5</DatabaseID>
     <CubeID>giri</CubeID>
     <MeasureGroupID>Fact Internet Sales</MeasureGroupID>
     </Object>
     <Type>ProcessFull</Type>
     <WriteBackTableCreation>UseExisting</WriteBackTableCreation>
     </Process>
      </Parallel>
    </Batch>';
    EXEC (@XMLA) At SHALL-PCAdventureWorksDw ;
     iam executive the    query when iam getting below error.
      [Execute SQL Task] Error: Executing the query "DECLARE
    @XMLA nvarchar(3000)
    , @DateSerial nvarch..." failed with the following error: "Incorrect syntax near '-'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set
    correctly, or connection not established correctly. 
     how to solve this error;
     please help me

    What are you trying to do? What sort of data source is  SHALL-PCAdventureWorksDw?
    When you use EXEC() AT, I would execpt to see an SQL string to be passed to EXEC(), but you are passing an XML string????
    If you explain why you think this would work in the first place, maybe we can help you.
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for

  • Oracle Application server 10g on vista

    Hi Freinds, AMD 64 bit processor running os vista 34 bit. I want to install oracle application server 10g on windows Vista. when i run the set up its giving me an error but oracle certification table shows its vertified on vista. erro message: Checki

  • IPod Touch is being detected by Windows Vista but not iTunes

    After updating iTunes to 9.0.1 my iPod Touch is being detected as a camera by my Windows Vista computer, but iTunes is unable to detect my iPod. I have all ready tried using different USB ports and a different USB cable with no success. I have also t

  • Get File by modified date and extension then copy to location

    Hello, Ill give a brief description of what I am trying to accomplish. We have a bunch of files that are sitting on a deduplication box (Exagrid), we want to try and copy certain files off of this dedup box, however, if we copy EVERYTHING this will f

  • Editing iTune Playlists online from desktop (without iPhone) Help?

    Hi - so new at this - help!?  Long story short - iPhone gone (now have a Droid).  I need to get into my music ONLINE (from my desktop) to delete like several 100 songs before I transfer to my new phone. Had no prob transfering thru an app from one to

  • Where does the PCR code start in SAP

    When the User clicks on PCR on the web page . The webpage control has to be transferred to SAP. Can any body tell me what is starting Point of code for SAP like a transaction or Prg name ( I need the name pls ) from the web page ? After getting throu