Trouble with query

hi all,
I had DEPT and EMP tables.
Each Department contains more than 2 Employees.
now i need a query to retrieve EMPID in the first row of each Department
thanks in advance
rampa

And have you coded anything yet for this homework assignment?
HINT: search for 'pivot table' or 'crosstab query'

Similar Messages

  • Trouble with query on Reports

    Hi,
    I am having trouble with a query which results from a join of 4 tables, of which, one table is shortened by grouping it along one column.
    for example
    A join B join C join (D grouped by D.S)
    In MS Access I had used a separate query to represent this and done a join with the remaining tables to generate my report.
    Any one has any idea about how this can be done using just one query, or any way I can store the sub-result elsewhere like in Access.
    Thanks!

    Not usre this is a reports issue, but:
    I think you are trying to select from tables and queries in one.
    IN your SQL statement try
    SELECT data,etc
    FROM
    A,
    B,
    C
    , (select distinct S from D) Q_D
    where
    A join B join C join Q_D
    Note that I don't think you can use sub queries like this in Access

  • Trouble With Query Between Dates:

    Hello Again,
    The query below is giving some trouble in that the line where 'CURRENT_DATE' is between 'START_DATE' and 'END_DATE.
    The query returns records close to those dates but some missing on the END_DATE. I was wondering if there is 'time at play here? How is only the date component used for the search?
    select * from (
    SELECT TO_CHAR (LEAVE.START_DATE, 'DD-MON-YY') AS Start_Date,
    TO_CHAR (LEAVE.END_DATE, 'DD-MON-YY') AS end_date,
    TO_CHAR (CURRENT_DATE, 'DD-MON-YY')AS CURRENT_DATE,
    LEAVE.NAME as NAME,
    LEAVE.ID as ID,
    LEAVE.DAYS as Days,
    LEAVE.SUPERVISOR as Supervisor,
    LEAVE.LEAVE_TYPE,
    FROM "LEAVE"
    WHERE CURRENT_DATE BETWEEN start_date AND end_date
    Kind Regards,
    Steve Welch

    Hi Steve,
    You should be aware that the Oracle datatype DATE also includes a time component.
    select to_char(current_date,'DD-MON-YYYY HH24:MI:SS') date_and_time from dual;
    DATE_AND_TIME       
    18-AUG-2011 13:29:49 Could it be that you are missing some records because they have a time which falls outside your condition?
    Regards
    Andre

  • Having trouble with query

    I am trying to query for a report to list aircraft by manufacturer, model name, aircraft number, destinations flown, miler per charter and the total revenue per charter, as well as total amount of revenue generated and total number of mile flown for each aircraft. This is what I have so far, I keep getting stumped when I try to sum I get error that certain lines is not single-group group function.
    -----DATA
    3 tables:
    Aircraft {PK} ac_number
    {FK} mod_code
    ac_ttaf
    ac_ttel
    ac_tter
    Model {PK} mod_code
    mod_manufacturer
    mod_name
    mod_seats
    mod_chg_mile
    Charter {PK} char_trip
    char_date
    {FK2} ac_number
    char_destination
    char_hours_flown
    char_hours_wait
    char_fuel_gallons
    char_oil_qts
    FK1} cus_code
    ---code written so far--
    --program Unit 5 Q4 Reprot of Aircraft By Renvue                         
    --author Barbara Forget                                                  
    --date February 24.2008                                                  
    --purpose to list aircraft by revenue, model, manufacturer and number    
    SELECT m.mod_manufacturer "MANUFACTURER",
    m.mod_name "A/C NAME",
    a.ac_number "A/C #",
    c.destination "AIRPORT",
    c.char_distance "TOTALMILEAGE"
    FROM hartmar.model m,
    hartmar.aircraft a,
    hartmar.charter c
    WHERE m.mod_code = a.mod_code (+)
    AND a.ac_number = c.ac_number (+)
    ORDER BY m.mod_name
    Can someone give me a little input as to how to accomplish this, I get the report as such
    MANUFACTURER A/C NAME A/C # AIR TOTALMILEAGE
    Piper Axtec 1484P BNA 352
    Piper Axtec 1484P STL 508
    Piper Axtec 1484P TYS 644
    Piper Axtec 1484P STL 472
    Piper Axtec 1484P STL 508
    Piper Axtec 1484P TYS 644
    Piper Axtec 1484P BNA 352
    Piper Axtec 1484P STL 472
    Piper Axtec 1484P STL 508
    Cessna Citation Mustang 1234C
    Cessna Citation Sovereign 2345C
    MANUFACTURER A/C NAME A/C # AIR TOTALMILEAGE
    Beechcraft KingAir 2289L GNV 1645
    Beechcraft KingAir 2289L ATL 1023
    Beechcraft KingAir 2289L GNV 1645
    Beechcraft KingAir 2289L GNV 1574
    Beechcraft KingAir 2289L ATL 936
    Beechcraft KingAir 2289L ATL 936
    Beechcraft KingAir 2289L GNV 1574
    Beechcraft KingAir 2289L ATL 1023
    Beechcraft KingAir 2289L GNV 1574
    Beechcraft KingAir 2289L GNV 1574
    Piper Navajo Chieftain 2278V GNV 1574
    MANUFACTURER A/C NAME A/C # AIR TOTALMILEAGE
    Piper Navajo Chieftain 4278Y TYS 644
    Piper Navajo Chieftain 2278V BNA 320
    Piper Navajo Chieftain 4278Y GNV 1574
    Piper Navajo Chieftain 4278Y GNV 1574
    Piper Navajo Chieftain 4278Y STL 472
    Piper Navajo Chieftain 2278V GNV 1574
    Piper Navajo Chieftain 2278V BNA 320
    Piper Navajo Chieftain 4278Y ATL 998
    Piper Navajo Chieftain 4278Y TYS 644
    Piper Navajo Chieftain 2278V MOB 884
    Piper Navajo Chieftain 4278Y TYS 646
    MANUFACTURER A/C NAME A/C # AIR TOTALMILEAGE
    Piper Navajo Chieftain 4278Y ATL 936
    Piper Navajo Chieftain 2278V MQY 312
    Piper Navajo Chieftain 2278V MQY 312
    Piper Navajo Chieftain 4278Y ATL 936
    Piper Navajo Chieftain 4278Y TYS 646
    Piper Navajo Chieftain 2278V MOB 884
    Piper Navajo Chieftain 4278Y ATL 998
    Piper Navajo Chieftain 4278Y STL 472
    Piper Navajo Chieftain 4278Y ATL 998
    Piper Navajo Chieftain 4278Y GNV 1574
    Piper Navajo Chieftain 2278V BNA 320
    MANUFACTURER A/C NAME A/C # AIR TOTALMILEAGE
    Piper Navajo Chieftain 4278Y TYS 644
    Piper Navajo Chieftain 4278Y ATL 936
    Piper Navajo Chieftain 4278Y TYS 646
    47 rows selected.
    but, I need each a/c to be listed once with charter number total miles flown and total revenue generated.
    Any suggestions?

    Here's what I could fathom:
    test@ORA10G>
    test@ORA10G> with model as (
      2    select 1 as mod_code, 'Cessna' as mod_manufacturer, 'Citation Mustang' as mod_name, 0.1 as mod_chg_mile from dual union all
      3    select 2,'Piper',     'Axtec',             0.2 from dual union all
      4    select 3,'Piper',     'Navajo Chieftain',  0.3 from dual union all
      5    select 4,'Beechcraft','KingAir',           0.1 from dual union all
      6    select 5,'Cessna',    'Citation Sovereign',0.5 from dual),
      7  aircraft as (
      8    select '1234C' as ac_number, 1 as mod_code from dual union all
      9    select '1484P', 2 from dual union all
    10    select '2278V', 3 from dual union all
    11    select '2289L', 4 from dual union all
    12    select '2345C', 5 from dual union all
    13    select '4278Y', 3 from dual),
    14  charter as (
    15    select 1 as char_trip, '1234C' as ac_number, null as destination, null as char_distance from dual union all
    16    select 2, '1484P', 'BNA', 10     from dual union all
    17    select 3, '1484P', 'STL', 10     from dual union all
    18    select 4, '1484P', 'STL', 20     from dual union all
    19    select 5, '1484P', 'TYS', 100    from dual union all
    20    select 6, '2278V', 'BNA', 20     from dual union all
    21    select 7, '2278V', 'GNV', 30     from dual union all
    22    select 8, '2278V', 'MOB', 40     from dual union all
    23    select 9, '2278V', 'MQY', 50     from dual union all
    24    select 10, '2289L', 'ATL', 10    from dual union all
    25    select 11, '2289L', 'ATL', 20    from dual union all
    26    select 12, '2289L', 'GNV', 15    from dual union all
    27    select 13, '2289L', 'GNV', 25    from dual union all
    28    select 14, '2345C',  null, null  from dual union all
    29 select 15, '4278Y', 'ATL', 10 from dual union all
    30 select 16, '4278Y', 'ATL', 25 from dual union all
    31    select 17, '4278Y', 'GNV', 35    from dual union all
    32    select 18, '4278Y', 'STL', 20    from dual union all
    33    select 19, '4278Y', 'TYS', 40    from dual union all
    34    select 20, '4278Y', 'TYS', 50    from dual)
    35  --
    36  SELECT
    37    m.mod_manufacturer as manufacturer,
    38    m.mod_name as ac_name,
    39    a.ac_number as ac_num,
    40    c.destination as airport,
    41    sum(c.char_distance) as total_mileage,
    42    to_char(sum(c.char_distance*m.mod_chg_mile*0.035),'$99,990.99') as trip_charge
    43  FROM
    44    model m,
    45    aircraft a,
    46    charter c
    47  WHERE m.mod_code = a.mod_code(+)
    48  AND a.ac_number = c.ac_number(+)
    49  GROUP BY m.mod_manufacturer,
    50           m.mod_name,
    51           a.ac_number,
    52           c.destination;
    MANUFACTUR AC_NAME            AC_NU AIR TOTAL_MILEAGE TRIP_CHARGE
    Piper      Axtec              1484P BNA            10       $0.07
    Piper      Navajo Chieftain   2278V BNA            20       $0.21
    Piper      Navajo Chieftain   2278V MQY            50       $0.53
    Piper      Navajo Chieftain   4278Y TYS            90       $0.95
    Piper      Navajo Chieftain   4278Y GNV            35       $0.37
    Cessna     Citation Mustang   1234C
    Piper      Navajo Chieftain   2278V MOB            40       $0.42
    Piper      Axtec              1484P STL            30       $0.21
    Piper      Axtec              1484P TYS           100       $0.70
    Piper      Navajo Chieftain   4278Y STL            20       $0.21
    Piper      Navajo Chieftain   2278V GNV            30       $0.32
    Beechcraft KingAir            2289L ATL            30       $0.11
    Cessna     Citation Sovereign 2345C
    Beechcraft KingAir            2289L GNV            40       $0.14
    Piper Navajo Chieftain 4278Y ATL 35 $0.37
    15 rows selected.
    test@ORA10G>
    test@ORA10G>Notes:
    (1) Lines 29 and 30 (in bold) show that '4278Y', which corresponds to mod_code = 3 i.e. "Piper Navajo Chieftain", flew to ATL twice traveling 10 and 20 miles respectively.
    (2) The last line of the resultset (in bold) shows the total miles for "Piper Navajo Chieftain" i.e. 35 miles.
    The trip charge, consequently, is 35 miles * 0.3 * 0.035 = 0.3675
    where 0.3 is the mod_chg_mile for "Piper Navajo Chieftain".
    (3) Note the change in the columns that constitute the GROUP BY clause. What it does is - for every combination of:
        (i)    m.mod_manufacturer
        (ii)   m.mod_name
        (iii)  a.ac_number
        (iv)   c.destinationit sums up the c.char_distance and multiplies it with the product of m.mod_chg_mile and 0.035.
    (4) Also note that you can use aggregate functions (sum, in this case) more than once in the SELECT <column_list> part of the query. You need to include the rest of the columns (the 4 above) in the GROUP BY clause.
    Hope that helps.
    cheers,
    pratz

  • Trouble with query and parse in nstrument i/o assistant

    I am setting up instrument i/o assistant to communicate with a simple serial instrument.  Labview is communicating effectively with my instrument (instrument responds to on/off commands sent by labview) but am not reading data from the instrument.
    Here is the problem:
    I send a command "=RV" followed by carraige return.
    The instrument should be sending back two lines of information:
    "=RV
    V=n.n-mm"
    where n and m are numbers, giving me a vacuum pressure.
    When I run "Query and Parse" I get back:
    "=RVc"
    But, the information I really need is in the second line, and is missing for some reason.  Is there some reason I am not reading the full string of information from the instrument, and how can I change it to get the data I need???
    Thanks to anyone who can help.

    In the Instrument I/O Assistant's query and parse step, set your termination character to none. Your instrument is sending a CR, LF, or both and with a termination character enabled, the read will terminate as soon as that character is read. Therefore, you only get the first line of data.

  • Having alot of trouble with a query

    Hey, I'm having trouble with a query for an assignment. The questions states
    Find the name of the highest earning employee in each location, excluding managers, salespeople and the president
    The problem I'm having is that my query returns the highest earning employee from each location perfectly, but one of those returned is a salesperson, so the next highest earning person in that location should be returned.
    We are also not allowed to create a temporary table
    Here's my code so far
    select
    e.first_name,
    e.last_name,
    e.salary,
    l.regional_group
    from employee e
    inner join department d
    on d.department_id = e.department_id
    inner join location l
    on l.location_id = d.location_id
    where e.salary = (select max(e2.salary) from employee e2
    inner join department d2
    on d2.department_id = e2.department_id
    inner join location l2
    on l2.location_id = d2.location_id
    where l2.location_id = l.location_id
    and e.job_id !=672;
    the job_id refers to what job title they have
    and here's the schema below
    Schema
    Any help you could give me on this would be fantastic as I have been pulling my hair out over this for the last day.
    Edited by: 837562 on 17-Feb-2011 02:14

    Maybe you can try the below:
    with job_location as
    select 1 location_id, 'loc1' regional_group from dual
    union
    select 2 location_id, 'loc2' regional_group from dual
    department as
    select 1 department_id, 'dept1' dept_name, 1 location_id from dual
    union
    select 2 department_id, 'dept2' dept_name, 2 location_id from dual
    job_FUNCTION as
    select 1 job_id, 'MANAGER' job_function from dual
    UNION
    select 2 job_id, 'SALES' job_function from dual
    UNION
    select 3 job_id, 'PRESIDENT' job_function from dual
    UNION
    select 4 job_id, 'REST_1' job_function from dual
    UNION
    select 5 job_id, 'REST_2' job_function from dual
    employee as
    select 1 employee_id, 'a' last_name, 100 salary, 1 department_id, 4 JOB_ID from dual union
    select 2 employee_id, 'b' last_name, 200 salary,1, 5 from dual union
    select 3 employee_id, 'c' last_name, 300 salary,1, 2 from dual union
    select 4 employee_id, 'd' last_name, 400 salary,1, 2 from dual union
    select 5 employee_id, 'e' last_name, 500 salary,2, 3 from dual union
    select 6 employee_id, 'f' last_name, 600 salary,2, 3 from dual union
    select 7 employee_id, 'g' last_name, 700 salary,2, 4 from dual union
    select 8 employee_id, 'h' last_name, 800 salary,2, 4 from dual
    select
    regional_group, employee_id, max_salary
    from
    select e.regional_group, b.department_id, employee_id, salary, max(b.salary) over (partition by b.department_id order by b.department_id) max_salary
    from
    employee b,
    job_function c,
    department d,
    job_location e
    where
    b.job_id = c.job_id and
    b.department_id = d.department_id and
    e.location_id = d.location_id and
    c.job_id not in (1,2,3) 
    ) where salary = max_salary;
    "REGIONAL_GROUP"     "EMPLOYEE_ID"     "MAX_SALARY"
    "loc1"     "2"     "200"
    "loc2"     "8"     "800"

  • Trouble with city, state in Mysql Query

    Hello,
    I am having trouble with a query I am trying to setup.  Basically, I want the user to type in their city.  Then I want the system to ask them which city,state combo is theirs.  So if they enter "Washington" the system will return:
    Select your city/state:
    Washington, NJ
    Washington, PA
    Washington, DE
    City and state are stored as two fields in my mysql DB.  I was considering using 'select distinct' but I wasnt sure how it would work in relation to two fields.  So how would I go about making sure washington, nj only appears once (its in a database where there will be multiple washington, NJ listed).
    So anyone have any ideas or code samples they have used to do something like this?
    Thanks in advance,
    Mark

    davella wrote:
    City and state are stored as two fields in my mysql DB.  I was considering using 'select distinct' but I wasnt sure how it would work in relation to two fields.  So how would I go about making sure washington, nj only appears once (its in a database where there will be multiple washington, NJ listed).
    DISTINCT works the same way for single field or multiple fields.  It returns all distinct combinations of the values in the columns you have listed.
    SELECT  DISTINCT City, State
    FROM     Table
    WHERE  City = 'Washington'
    (Data) City, State
    Washington, NJ
    Washington, PA
    Washington, NJ
    Washington, DE
    Washington, NJ
    Washington, PA
    So for your two columns it would distinct combinations of the "City" and "State" values.  But why are there multiple "Washington, NJ" records? Are they actually different cities or duplicate records?
    (Results)
    Washington, NJ
    Washington, PA
    Washington, DE

  • Trouble with OR in where clause

    Hello,
    I'm having trouble with execution speed. The problem seems to be with using OR in my where clause.
    Here's the meat of the function where i_pledge_number is an input parm:
    BEGIN
    SELECT /*+ INDEX (pp) */ SUM(pp.prim_pledge_amount)
    INTO return_amount
    FROM
    primary_pledge pp
    WHERE
    -- Get total if multiple allocations
    pp.prim_pledge_number IN
    (SELECT pc.pledge_number
    FROM pledge_codes pc
    WHERE pc.pledge_code_type = 'M'
    AND pc.pledge_code = 'AC'
    AND lpad(pc.pledge_comment,10,'0') = i_pledge_number)
    -- Get total if single allocation
    OR pp.prim_pledge_number = i_pledge_number;
    RETURN return_amount;
    END;
    If I comment out either half of the OR statement (either the subquery or the pp.prim_pledge_number = i_pledge_number half) the function returns a value in .02 seconds. If I leave the OR in, it takes 2.764 seconds to execute?? Can someone please show me a better way (faster) to do this? I tried using nvl() around the subquery but couldn't get it to compile.
    Thanks

    These things are difficult to diagnose remotely, but here is something you can try....
    SELECT */ SUM(pp.prim_pledge_amount)
    INTO return_amount
    FROM   primary_pledge pp
    WHERE  pp.prim_pledge_number IN (SELECT pc.pledge_number
                                     FROM pledge_codes pc
                                     WHERE pc.pledge_code_type = 'M'
                                     AND pc.pledge_code = 'AC'
                                     AND lpad(pc.pledge_comment,10,'0') = i_pledge_number
    UNION ALL
    SELECT i_pledge_number FROM dual)
       RETURN return_amount;
    END;If that doesn't do anything (and it might well not) there are a large number of different ways we can recast this query. To save us further guessing please give us more details: execution plans, database version number, volumetrics.
    Cheers, APC

  • A trouble with "LIKE" in a select statement

    Hi!
    I'm having trouble with "LIKE" in a select statement...
    With Access I can make the following and everything works well:
    SELECT name, birthday
    FROM client
    WHERE birthday LIKE '*/02/*';
    but if try to do it in my application (it uses Access), it doesn't work - I just can't understand that!!!
    In my application the "month" is always the currently month taken from the "System". Look what I'm doing...
    String query1 = "SELECT name, birthday " +
              "FROM client " +
              "WHERE birthday " +
              "LIKE '*/" +
              pMonth +
              "/*' " +
              "ORDER BY birthday ASC ";
    ResultSet rs = statement1.executeQuery(consulta1);
    boolean moreRecords = rs.next();
    The variable "moreRecords" is always "false", the query returns nothing although the table "client" has records that attend the query.
    Please, anyone can help me?! It's a little bit urgent.
    Thanks,
    Katia.

    Hi Katia,
    I'll bet the problem lies with the characters you're using to escape the LIKE clause. You're using the ones that Access likes to see, but that's not necessarily what's built into the JDBC-ODBC driver class.
    You can find out what the correct escape wildcard characters are from the java.sql.DatabaseMetaData.getSearchStringEscape() method. It'll tell you what to use in the LIKE clause.
    I'm not 100% sure about your code. It doesn't use query1 anywhere. I'd do this:
    String query = "SELECT name, birthday FROM client WHERE birthday LIKE ? ORDER BY birthday ASC";
    PreparedStatement statement = connection.createStatement(query);
    String escape = connection.getMetaData().getSearchStringEscape();
    String test = escape + '/' + pMonth + '/' + escape;
    statement.setString(1, test);
    ResultSet rs = statement.executeQuery();
    while (rs.hasNext())
    // load your data into a data structure to pass back.
    rs.close();
    statement.close();Let me know if that works. - MOD

  • Trouble with export and import

    I am having trouble with export and import
    here is what I did...
    exp "'/ as sysdba'" PARFILE=parfile.txt
    PAFILE
    TABLES=user1.Table1
    file=Table1_1006.dmp
    LOG=Table1_1006.log
    query="where to_char(processeddate,'YYYYMMDDHHMISS') between to_char(to_timestamp('1911-01-01 00:00:00','YYYY-MM-DD HH24:MI:SS'),'YYYYMMDDHHMISS') and to_char(to_timestamp('2011-10-06 16:46:26','YYYY-MM-DD HH24:MI:SS'),'YYYYMMDDHHMISS')"here is my log from export
    set and AL16UTF16 NCHAR character set
    About to export specified tables via Conventional Path ...
    Current user changed to user1
    . . exporting table               Table1   16019049 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    Export terminated successfully with warnings.Then I started importing
    /database2/rdbm15> imp "'/ as sysdba'" file=Table1_1006.dmp fromuser=user1 touser=user1 tables=Table1 log=imp_Table1_1006.log
    Import: Release 10.2.0.5.0 - Production on Thu Oct 6 19:57:01 2011
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Export file created by EXPORT:V10.02.01 via conventional path
    import done in US7ASCII character set and AL16UTF16 NCHAR character set
    . importing user1's objects into user1
    IMP-00015: following statement failed because the object already exists:
    "CREATE TABLE "Table1" ("APPROVALTRACEID" VARCHAR2(64), "REQUESTOR"
    "EID" VARCHAR2(9), "EID" VARCHAR2(9), "FIRSTNAME" VARCHAR2(32), "LASTNAME" V"
    "ARCHAR2(32), "MIDDLEINITIAL" VARCHAR2(8), "TIER" VARCHAR2(3), "JOBTITLE" VA"
    "RCHAR2(64), "JOBCODE" VARCHAR2(10), "EMPLOYEETYPE" VARCHAR2(2), "CONTRACTOR"
    "TYPE" VARCHAR2(2), "EMPLOYEESTATUS" VARCHAR2(2), "COSTCENTER" VARCHAR2(10),"
    " "COSTCENTERDESCRIPTION" VARCHAR2(50), "CONTRACTENDINGDATE" VARCHAR2(8), "A"
    "CCOUNTSTATUS" VARCHAR2(2), "LOGINID" VARCHAR2(70), "APPLICATIONGROUP" VARCH"
    "AR2(50), "APPLICATIONNAME" VARCHAR2(50), "APPLICATIONID" VARCHAR2(12), "LEV"
    "EL1" VARCHAR2(512), "LEVEL2" VARCHAR2(512), "LEVEL3" VARCHAR2(512), "LEVEL4"
    "" VARCHAR2(512), "LEVEL5" VARCHAR2(512), "PROFILECODE" VARCHAR2(50), "PROCE"
    "SSEDDATE" DATE, "APPROVERMANAGEREID" VARCHAR2(9), "APPROVERMANAGERDELEGATEE"
    "ID" VARCHAR2(9), "APPROVERT4MANAGEREEID" VARCHAR2(9), "APPROVERT4MANAGERDEL"
    "EGATEEID" VARCHAR2(9), "APPROVERAPPOWNEREID" VARCHAR2(9), "APPROVERAPPOWNER"
    "DELEGATEEID" VARCHAR2(9), "PERFORMEREID" VARCHAR2(9), "NATIONALID" VARCHAR2"
    "(30), "COUNTRYCODE" VARCHAR2(9), "PASSPORTID" VARCHAR2(20), "DATEOFBIRTH" V"
    "ARCHAR2(15), "CITYOFBIRTH" VARCHAR2(15), "VENDORNAME" VARCHAR2(50), "VENDOR"
    "MANAGERNAME" VARCHAR2(50), "VENDORMANAGERID" VARCHAR2(9), "VENDORADDRESS1" "
    "VARCHAR2(100), "VENDORADDRESS2" VARCHAR2(100), "VENDORSTATEPROVINCE" VARCHA"
    "R2(15), "VENDORCOUNTRYCODE" VARCHAR2(9), "VENDORZIPPOSTALCODE" VARCHAR2(9))"
    "  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 4076863488 "
    "NEXT 1048576 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)            "
    "                   LOGGING NOCOMPRESS"
    Import terminated successfully with warnings.but I did not get rows to database2
    [server1]database2
    /database2/rdbm15> sqlplus / as sysdba
    SQL*Plus: Release 10.2.0.5.0 - Production on Thu Oct 6 19:59:17 2011
    Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> select count(*) from user1.Table1;
      COUNT(*)
             0
    SQL> exit
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE    10.2.0.5.0      Production
    TNS for HPUX: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - ProductionEdited by: user3636719 on Oct 6, 2011 5:23 PM

    user3636719 wrote:
    Thanks for the reply...
    Old EXP IMP doesnt have capability to append the row, since you're using 10g use datapump instead. use option TABLE_EXISTS_ACTION=APPENDso my import should be like this
    imp "'/ as sysdba'" file=Table1_1006.dmp fromuser=user1 touser=user1 tables=Table1 log=imp_Table1_1006.log TABLE_EXISTS_ACTION=APPEND
    Did you look up the command line syntax and control options for imp?
    You should make it a habit that whenever anyone - especially a stranger on the web - gives you a bit of code or references a command or init parm or any some such, the VERY FIRST thin you should ALWAYS do is look it up for yourself and see exactly where and how it is used and what it means. That is how you grow beyond having to be spoon fed every little thing and become more self-sufficient.
    If you had, you would have seen that there is no TABLE_EXISTS_ACTION option for imp and seen that it is an option for impdp. And realized that exp and imp are NOT the same thing as expdp and impdp.
    =================================================
    Learning how to look things up in the documentation is time well spent investing in your career. To that end, you should drop everything else you are doing and do the following:
    Go to tahiti.oracle.com.
    Drill down to your product and version.
    <b><i><u>BOOKMARK THAT LOCATION</u></i></b>
    Spend a few minutes just getting familiar with what is available here. Take special note of the "books" and "search" tabs. Under the "books" tab you will find the complete documentation library.
    Spend a few minutes just getting familiar with what <b><i><u>kind</u></i></b> of documentation is available there by simply browsing the titles under the "Books" tab.
    Open the Reference Manual and spend a few minutes looking through the table of contents to get familiar with what <b><i><u>kind</u></i></b> of information is available there.
    Do the same with the SQL Reference Manual.
    Do the same with the Utilities manual.
    You don't have to read the above in depth. They are <b><i><u>reference</b></i></u> manuals. Just get familiar with <b><i><u>what</b></i></u> is there to <b><i><u>be</b></i></u> referenced. Ninety percent of the questions asked on this forum can be answered in less than 5 minutes by simply searching one of the above manuals.
    Then set yourself a plan to dig deeper.
    - Read a chapter a day from the Concepts Manual.
    - Take a look in your alert log. One of the first things listed at startup is the initialization parms with non-default values. Read up on each one of them (listed in your alert log) in the Reference Manual.
    - Take a look at your listener.ora, tnsnames.ora, and sqlnet.ora files. Go to the Network Administrators manual and read up on everything you see in those files.
    - When you have finished reading the Concepts Manual, do it again.
    Give a man a fish and he eats for a day. Teach a man to fish and he eats for a lifetime.
    =================================

  • Trouble with FormatPercent in SSRS

    Hi All,
    I am working on SSRS and I am having trouble with FormatPercent function.I have two columns which are units
     and another column representing corresponding values.Units column contains %, kg  and so on. the row 
    containing % as unit should have value
    in this format 'value%'
    For example
    1.%   4
    2.%   3
    3.kg  2
    This should look like
    1.%  4%
    2.%  3%
    3.kg  2
    I am writing this query "=IIF(Fields!units.value="%',FormatPercent((Fields!CURRENT_VALUE.Value/100),2),Fields!CURRENT_VALUE.Value)"
    in TextProperties->Set Number formatting options.
    when I execute this I am getting
    1.%  400%
    2.%  300%
    3.kg 2
    I would be thankful,if anyone can help me to solve this issue asap.
    Regards,
    Arjun

    Hi Arjun,
    Per my understanding that you are using the expression in the custom format of the "Text Box properties" right?
    I have tested on my local environment, if so, it will cause the result not correct, I recommended you to just use the expression in the field by right click the field and select the "Expression":
    Or you can modify the expression as below to use in the custom format:
    =IIF(Fields!units.value="%',FormatPercent((Fields!CURRENT_VALUE.Value/100),0),Fields!CURRENT_VALUE.Value)
    You can also use method below to achieve this:
    Add expression of the field:
    =IIF(Fields!units.value="%', Fields!CURRENT_VALUE.Value/100,Fields!CURRENT_VALUE.Value)
    Then add this expression in the custom format:
    =IIF(Fields!units.value="%',"P2",nothing)
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Trouble with popup not initialized until addPopUp is called

    I am having troubles with initialization.  I have a class given below.  I new() it at the start and use PopUpManager.addPopUp to display it.
    My problem is that the line query:QueryWIthOption id="filterComp" is a class with a lot of variables.  However, if I try to set any of them before I call addPopUp, it doesn't work because filterComp is null.
    I therefore either need to initialize filterComp earlier, store the data until AddToPopup is called, or change the way I am implementing this.  If I store the data in variables, I have to add a whole bunch either to the class below or to the calling class.
    Doing this once is managable, but I have other similar examples with a similar problem. This code was flex 3 before where filterComp was always initialized.
    Is there any good way to do this?  I guess I am interested in both the way to do this in a minimal way, and what is the best way to code to avoid this issue (if I am adding something new in the future).
    Jay
    QueryWithOptionWrapper class:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
                    xmlns:s="library://ns.adobe.com/flex/spark"
                    xmlns:mx="library://ns.adobe.com/flex/mx"
                    xmlns:query="com.niksun.dashboard.components.query.*">
        <fx:Script>
            <![CDATA[
                import com.niksun.common.managers.ResourceManager;           
            ]]>
        </fx:Script>
        <mx:VBox horizontalAlign="center" width="100%" height="100%" paddingTop="5">
            <query:QueryWithOption id="filterComp" showFilter="true"/>
            <mx:HBox width="100%" horizontalAlign="center" horizontalGap="10">
                <!-- enabled="{!ModelLocator.getInstance().progress}" -->
                <mx:Button id="update" label="{ResourceManager.getString('Update')}"
                           horizontalCenter="0"/>
                <mx:Button id="reset" label="{ResourceManager.getString('Reset')}"/>
                <mx:Button id="cancel" label="{ResourceManager.getString('Cancel')}"/>
            </mx:HBox>
        </mx:VBox>
    </mx:TitleWindow>

    I was thinking about what I would want and came up with the following suggested enhancement for Flex 4.
    Add a preinitialize="true/false" type flag for UI type Components that indicates whether to initialize everything like was done in Flex 3, or whether to hold off initialization until used like is currently done.  It would default to false.
    Is there a way I can ask for/suggest this enhancement for a later version of Flex 4? 
    This change would greatly reduce the time needed to convert from flex 3 to flex 4.

  • Errors with querying a query table using non-QoQ query and QoQ query

    HELP ! ! !  Going into testing soon. I need this to work to get correct report results ! ! ! !
    My issue seems similar to the one just answered about Query of Queries RunTime Error
    and the reply from lawhite01 caught my eye.
    This is a 2 parter. The second part is the QoQ part, but the 1st part has a line in the query that is similar to the QoQ one and it uses the same data. Part 1 also throws an error.
    PART # 1.
    I'm trying to use a query table created through QueryNew and then query it.
    I need multiple columns in the query table I create:
    <cfscript>
            tot_AllCurrentDraftListing = QueryNew("AnnounceNum, JP_PDLoc, JP_JS_Title, JP_JS, JP_KW_1, JP_JobTitle, JP_Open, JP_Close, JP_CloseType, JP_CloseName, JP_PosNeed, JP_DirectHire, JP_Desc, JP_Draft, JP_Archived, JP_State, JP_AreaName, JP_AreaID, JP_AreaAlias, JP_Fac_SU, JP_Fac_Facility, JP_FAC_ID, JP_Grade1, JP_sal_low1, JP_sal_high1, JP_Grade2, JP_sal_low2, JP_sal_high2, JP_Grade3, JP_sal_low3, JP_sal_high3, JP_Grade4, JP_sal_low4, JP_sal_high4, JP_Grade5, JP_sal_low5, JP_sal_high5, JP_Posted, JP_TypeHire, JP_HRemail");
        </cfscript>
    Then I populate all the cells of the query table.
    Then I set up to use the created query table.
    I do this first:
        <cfquery name="qAltPostID" datasource="#at_datasource#">
             SELECT AltPoster, fk_Job_AnnounceNum
             from JOB_JPContacts
             Where AltJPContactType = 'AltPosterID'
             and AltPoster = '#session.IHSUID#'
             </cfquery>
    Then, in my first query using the created query, I expect to need to choose from multiple values, so I'm using this line in the query (this is NOT a QoQ query):
                and AnnounceNum IN (<cfqueryparam cfsqltype="CF_SQL_varchar" value="#ValueList(qAltPostID.fk_Job_AnnounceNum)#">)
    I've also tried:
                   and AnnounceNum IN (#ValueList(qAltPostID.fk_Job_AnnounceNum)#)   
    and:
                   and JOB_AnnounceNum IN
                    SELECT fk_Job_AnnounceNum
                    from JOB_JPContacts
                    Where AltJPContactType = 'AltPosterID'
                    and AltPoster = '#session.IHSUID#'
    ERROR is: one record should return. I get 0.
    PART # 2: Here's the QoQ part.
    I get the error:
    Query Of Queries runtime error.
    Comparison exception while executing IN.
    Unsupported Type Comparison Exception: The IN operator does not support comparison between the following types:
    Left hand side expression type = "LONG".
    Right hand side expression type = "STRING".
    A tutorial I found gave an example using only one column for this part of the fix:
         tot_AllCurrentDraftListing = QueryNew("AnnounceNum", "CF_SQL_VARCHAR")
    How would I set up the query with the datatype when I'm using multiple columns:
    <cfscript>
            tot_AllCurrentDraftListing = QueryNew("AnnounceNum, JP_PDLoc, JP_JS_Title, JP_JS, JP_KW_1, JP_JobTitle, JP_Open, JP_Close, JP_CloseType, JP_CloseName, JP_PosNeed, JP_DirectHire, JP_Desc, JP_Draft, JP_Archived, JP_State, JP_AreaName, JP_AreaID, JP_AreaAlias, JP_Fac_SU, JP_Fac_Facility, JP_FAC_ID, JP_Grade1, JP_sal_low1, JP_sal_high1, JP_Grade2, JP_sal_low2, JP_sal_high2, JP_Grade3, JP_sal_low3, JP_sal_high3, JP_Grade4, JP_sal_low4, JP_sal_high4, JP_Grade5, JP_sal_low5, JP_sal_high5, JP_Posted, JP_TypeHire, JP_HRemail");
        </cfscript>
    I used this code after all the cells contained values and before running my QoQ query:
            <cfloop index="intID" from="1" to="#tot_AllCurrentDraftListing.recordcount#" step="1">
                <cfset tot_AllCurrentDraftListing["AnnounceNum"] [intID] = JavaCast("string", intID) />
            </cfloop>
              Is that correct?
    Thanks.
    Whoever can help me with this should be awarded extra points ! ! ! !

                and AnnounceNum IN (<cfqueryparam cfsqltype="CF_SQL_varchar" value="#ValueList(qAltPostID.fk_Job_AnnounceNum)#">)
    If you're passing a list as a param, you need to tell <cfqueryparam> it's a list.  Read:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_p-q_18.html#1102474
    ERROR is: one record should return. I get 0.
    It's a bit hard to comment on this sort of thing without knowing the data involved.
    A tutorial I found gave an example using only one column for this part of the fix:     tot_AllCurrentDraftListing = QueryNew("AnnounceNum", "CF_SQL_VARCHAR")
    How would I set up the query with the datatype when I'm using multiple columns:
    Again, this is a matter of reading the relevant docs:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/functions_m-r_19.html#292759
    As a general rule, if you're having trouble with the syntax of a CFML statement, look it up in the docs.
    Adam

  • I have been having a lot of trouble with the latest itunes update and my ipod classic 80Gb i.e. being unable to sync songs, but now i have no files at all on my ipod, it is completely blank when i view it from my computer. I need help, please, anybody.

    As it says above, i have been having a lot f trouble with my ipod classic and the latest itunes update, i was unable to sync songs or anything to it and have tried every conceivable 'fix' i could find. i have run an itunes diagnostic and the results are posted below. a major problem is that when i try and view my ipod through my computer it displays nothing at all on the ipod, no files or anything, this may be the problem but i have no idea how it has happened or how i could resolve it.
    This ipod holds huge sentimental value and i am loathe to buy a new one! If anybody can help it is greatly appreciated, than kyou in advanced.
    Microsoft Windows 7 x64 Home Premium Edition Service Pack 1 (Build 7601)
    ASUSTeK Computer Inc. K50IJ
    iTunes 11.1.5.5
    QuickTime not available
    FairPlay 2.5.16
    Apple Application Support 3.0.1
    iPod Updater Library 11.1f5
    CD Driver 2.2.3.0
    CD Driver DLL 2.1.3.1
    Apple Mobile Device 7.1.1.3
    Apple Mobile Device Driver 1.64.0.0
    Bonjour 3.0.0.10 (333.10)
    Gracenote SDK 1.9.6.502
    Gracenote MusicID 1.9.6.115
    Gracenote Submit 1.9.6.143
    Gracenote DSP 1.9.6.45
    iTunes Serial Number 0038B8600B98D1E0
    Current user is not an administrator.
    The current local date and time is 2014-03-21 16:52:39.
    iTunes is not running in safe mode.
    WebKit accelerated compositing is enabled.
    HDCP is not supported.
    Core Media is supported.
    Video Display Information
    Intel Corporation, Mobile Intel(R) 4 Series Express Chipset Family
    Intel Corporation, Mobile Intel(R) 4 Series Express Chipset Family
    **** External Plug-ins Information ****
    No external plug-ins installed.
    Genius ID: 2fd81a1f13cf3ff25a8b4f0e8e725116
    **** Device Connectivity Tests ****
    iPodService 11.1.5.5 (x64) is currently running.
    iTunesHelper 11.1.5.5 is currently running.
    Apple Mobile Device service 3.3.0.0 is currently running.
    Universal Serial Bus Controllers:
    Intel(R) ICH9 Family USB Universal Host Controller - 2934.  Device is working properly.
    Intel(R) ICH9 Family USB Universal Host Controller - 2935.  Device is working properly.
    Intel(R) ICH9 Family USB Universal Host Controller - 2936.  Device is working properly.
    Intel(R) ICH9 Family USB Universal Host Controller - 2937.  Device is working properly.
    Intel(R) ICH9 Family USB Universal Host Controller - 2938.  Device is working properly.
    Intel(R) ICH9 Family USB Universal Host Controller - 2939.  Device is working properly.
    Intel(R) ICH9 Family USB2 Enhanced Host Controller - 293A.  Device is working properly.
    Intel(R) ICH9 Family USB2 Enhanced Host Controller - 293C.  Device is working properly.
    No FireWire (IEEE 1394) Host Controller found.

    Here is what worked for me:
      My usb hub, being usb2, was too fast. I moved the wire to a usb port directory on my pc. That is a usb1 port which is slow enough to run your snyc.

  • Trouble with Toshiba built-in webcam: "unable to enumerate USB device"

    I am running archlinux on a Toshiba Satellite L70-B-12H laptop, and having troubles with the Webcam. *Once in a while*, everything goes well and I get
    # lsusb
    Bus 004 Device 002: ID 8087:8000 Intel Corp.
    Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 003 Device 004: ID 04f2:b448 Chicony Electronics Co., Ltd
    Bus 003 Device 003: ID 8087:07dc Intel Corp.
    Bus 003 Device 002: ID 8087:8008 Intel Corp.
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    # dmesg
    [ 3433.456115] usb 3-1.3: new high-speed USB device number 4 using ehci-pci
    [ 3433.781119] media: Linux media interface: v0.10
    [ 3433.809842] Linux video capture interface: v2.00
    [ 3433.826889] uvcvideo: Found UVC 1.00 device TOSHIBA Web Camera - HD (04f2:b448)
    [ 3433.835893] input: TOSHIBA Web Camera - HD as /devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.3/3-1.3:1.0/input/input15
    [ 3433.835976] usbcore: registered new interface driver uvcvideo
    [ 3433.835977] USB Video Class driver (1.1.1)
    Unfortunately, *most of the time* the camera seems invisible to my system, and I get
    # lsusb
    Bus 004 Device 002: ID 8087:8000 Intel Corp.
    Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 003 Device 003: ID 8087:07dc Intel Corp.
    Bus 003 Device 002: ID 8087:8008 Intel Corp.
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    (note the missing "04f2:b448 Chicony Electronics Co., Ltd" device), and
    # dmesg
    [ 480.104252] usb 3-1.3: new full-speed USB device number 4 using ehci-pci
    [ 480.171097] usb 3-1.3: device descriptor read/64, error -32
    [ 480.341235] usb 3-1.3: device descriptor read/64, error -32
    [ 480.511375] usb 3-1.3: new full-speed USB device number 5 using ehci-pci
    [ 480.578007] usb 3-1.3: device descriptor read/64, error -32
    [ 480.748151] usb 3-1.3: device descriptor read/64, error -32
    [ 480.918282] usb 3-1.3: new full-speed USB device number 6 using ehci-pci
    [ 481.325196] usb 3-1.3: device not accepting address 6, error -32
    [ 481.392091] usb 3-1.3: new full-speed USB device number 7 using ehci-pci
    [ 481.798926] usb 3-1.3: device not accepting address 7, error -32
    [ 481.799166] hub 3-1:1.0: unable to enumerate USB device on port 3
    Searching on the web, most results I found lead to this page, where it is said that the problem is due to badly tuned overcurrent protection, and advocated that unplugging and switching off the computer for a little while gets things back into normal. This does not really work for me; the problem seems to occur more randomly, unfortunately with high probability (my camera is available after less than one boot out of ten).
    I tried to ensure that the ehci-hcd module is loaded at boot with the ignore-oc option (with a file in /etc/module-load.d/), to no avail.
    I also wrote a script which alternatively removes and reloads the ehci-pci driver until my device is found in lsusb. It is sometimes helpful, but usually not. And even when my device is found that way, it can only be used for a while before disappearing again.
    Anyway, such a hack is unacceptable... So, my questions are:
    is it indeed related to overcurrent protection ?
    is there anything else I can try ?
    should I file somewhere an other of the numerous bug reports about "unable to enumerate USB device" already existing ?
    If of any importance, I am running linux 3.15.7, because at the time I installed my system, I couldn't get the hybrid graphic card Intel/AMD working under 3.16.
    Last edited by $nake (2014-10-18 16:29:06)

    uname -a
    Linux libra 3.9.4-1-ARCH #1 SMP PREEMPT Sat May 25 16:14:55 CEST 2013 x86_64 GNU/Linux
    pacman -Qi linux
    Name : linux
    Version : 3.9.4-1
    Description : The linux kernel and modules
    Architecture : x86_64
    URL : http://www.kernel.org/
    Licences : GPL2
    Groups : base
    Provides : kernel26=3.9.4
    Depends On : coreutils linux-firmware kmod mkinitcpio>=0.7
    Optional Deps : crda: to set the correct wireless channels of your country
    Required By : nvidia
    Optional For : None
    Conflicts With : kernel26
    Replaces : kernel26
    Installed Size : 65562.00 KiB
    Packager : Tobias Powalowski <[email protected]>
    Build Date : Sat 25 May 2013 16:28:17 CEST
    Install Date : Sun 02 Jun 2013 15:30:35 CEST
    Install Reason : Explicitly installed
    Install Script : Yes
    Validated By : Signature

Maybe you are looking for

  • RegisterClassAlias not working :(

    Ok something that has me pulling my hair out!! I've got a localConnection between two swf's working fine, I can pass the allowed data types between them no problem.  However I need to send objects of a custom class through.  I thought I had a solutio

  • LiveCycle 8  - Preview PDF

    I have just installed Adobe Professional version 8 and found that even though Acrobat reader (the pro version) is loading fine with documents either locally or through a browser, LiveCycle 8 will not allow the use of the Preview PDF in the view setti

  • Hibernate Oracle nested CURSOR

    Hi All, I'm connecting to an Oracle database, and accessing a function that returns a SYS_REFCURSOR. I can succesfully map the function using the following syntax: @NamedNativeQuery( name = "blah_list" , query = "{ call blah__function(?,?,?,?,?,?,?,?

  • Encore CS5 interpreting footage incorrectly.

    Hi! I'm trying to use QTs in Encore CS5, and they are 720x486, given that all the sistems we use are 720x486, Flame, Smoke, Media Composer, Aja Cards, Decklink Cards, they are all 486 in NTSC not 480, but DVDs are 480, so I'm trying to make a preset

  • Plz point me on ODI documentation regarding production implementation ?

    Hi First of all,i am very thankful to u for your kind reply. i also need ODI Development Documentation for understanding the migration mechanism from Development to production Implementation. Hope for your reply. With Warm Regards, Ankush