Level and connect by in query

Hi Friends,
I have table TEST_REP  with below data
DA                     SUMA                  
2011                   2                     
2011                   3                     
2011                   5                     
2012                   2                     
2012                   7                     
2014                   2                     
2014                   10                    
2015                   2                     
2016                   33                    
2015                   26                    
2017                   21                    
2017                   2                     
2018                   23                    
13 rows selected
I have used following query to get the below output:
select
         br_mat MAT_YEAR,
         sum(br_par)  TOTAL
from    (
(select to_char(da) br_mat,suma br_par from test_rep)
UNION ALL
            select to_char(seeddate + level-1),0
                from dual d, (select min(da) min_maturity_year,
                              max(da) max_maturity_year,
                              TO_Number(TO_CHAR(sysdate,'YYYY')) seeddate
                                                           from test_rep
                                ) t
                connect by level <= (t.max_maturity_year - t.min_maturity_year) + 1
group by br_mat
order by br_mat;
Output :
MAT_YEAR                                 TOTAL                 
2011                                     10                    
2012                                     9                     
2013                                     0                     
2014                                     12                    
2015                                     28                    
2016                                     33                    
2017                                     23                    
2018                                     23                    
2019                                     0                     
2020                                     0                     
10 rows selected
Expected Output :
MAT_YEAR                                 TOTAL                 
2011                                     10                    
2012                                     9                     
2013                                     0                     
2014                                     12                    
2015                                     28                    
2016                                     33         
2017 and Greater                 46
Please help .

Adapt your query using something like (the following won't list missing years - 2013) NOT TESTED!
select case when da >= :upper_limit
            then :upper_limit || ' and Greater'
            else to_char(da)
       end mat_year,
       sum(sumA) total
  from test_rep
group by case when da >= :upper_limit
               then :upper_limit || ' and Greater'
               else to_char(da)
          end
order by 1
Regards
Etbin

Similar Messages

  • Level and Connect by

    Hello all,
    Can anyone define LEVEL and CONNECT BY as i'm unable to figure out its concept.
    Thank You
    KK

    Perhaps an example may clarify...
    SQL> ed
    Wrote file afiedt.buf
      1  select empno, level, lpad(' ',(level-1)*2,' ')||ename as ename
      2  from emp
      3  connect by mgr = prior empno
      4* start with mgr is null
    SQL> /
         EMPNO      LEVEL ENAME
          7839          1 KING
          7566          2   JONES
          7788          3     SCOTT
          7876          4       ADAMS
          7902          3     FORD
          7369          4       SMITH
          7698          2   BLAKE
          7499          3     ALLEN
          7521          3     WARD
          7654          3     MARTIN
          7844          3     TURNER
          7900          3     JAMES
          7782          2   CLARK
          7934          3     MILLER
    14 rows selected.
    SQL>

  • How to improve the query performance in to report level and designer level

    How to improve the query performance in to report level and designer level......?
    Plz let me know the detail view......

    first its all based on the design of the database, universe and the report.
    at the universe Level, you have to check your Contexts very well to get the optimal performance of the universe and also your joins, keep your joins with key fields, will give you the best performance.
    at the report level, try to make the reports dynamic as much as you can, (Parameters) and so on.
    and when you create a paremeter try to get it match with the key fields in the database.
    good luck
    Amr

  • Powershell use Connection String to query Database and write to Excel

    Right now I have a powershell script that uses ODBC to query SQL Server 2008 / 2012 database and write to EXCEL
    $excel = New-Object -Com Excel.Application
    $excel.Visible = $True
    $wb = $Excel.Workbooks.Add()
    $ws = $wb.Worksheets.Item(1)
    $ws.name = "GUP Download Activity"
    $qt = $ws.QueryTables.Add("ODBC;DSN=$DSN;UID=$username;PWD=$password", $ws.Range("A1"), $SQL_Statement)
    if ($qt.Refresh()){
    $ws.Activate()
    $ws.Select()
    $excel.Rows.Item(1).HorizontalAlignment = $xlCenter
    $excel.Rows.Item(1).VerticalAlignment = $xlTop
    $excel.Rows.Item("1:1").Font.Name = "Calibri"
    $excel.Rows.Item("1:1").Font.Size = 11
    $excel.Rows.Item("1:1").Font.Bold = $true
    $filename = "D:\Script\Reports\Status_$a.xlsx"
    if (test-path $filename ) { rm $filename }
    $wb.SaveAs($filename, $xlOpenXMLWorkbook) #save as an XML Workbook (xslx)
    $wb.Saved = $True #flag it as being saved
    $wb.Close() #close the document
    $Excel.Quit() #and the instance of Excel
    $wb = $Null #set all variables that point to Excel objects to null
    $ws = $Null #makes sure Excel deflates
    $Excel=$Null #let the air out
    I would like to use connection string to query the database and write results to EXCEL, i.e.
    $SQL_Statement = "SELECT ..."
    $conn = New-Object System.Data.SqlClient.SqlConnection
    $conn.ConnectionString = "Server=10.10.10.10;Initial Catalog=mydatabase;User Id=$username;Password=$password;"
    $conn.Open()
    $cmd = New-Object System.Data.SqlClient.SqlCommand($SQL_Statement,$conn)
    do{
    try{
    $rdr = $cmd.ExecuteReader()
    while ($rdr.read()){
    $sql_output += ,@($rdr.GetValue(0), $rdr.GetValue(1))
    $transactionComplete = $true
    catch{
    $transactionComplete = $false
    }until ($transactionComplete)
    $conn.Close()
    How would I read the columns and data for $sql_output into an EXCEL worksheet. Where do I find these tutorials?

    Hi Q.P.Waverly,
    If you mean to export the data in $sql_output to excel document, please try to format the output with psobject:
    $sql_output=@()
    do{
    try{
    $rdr = $cmd.ExecuteReader()
    while ($rdr.read()){
    $sql_output+=New-Object PSObject -Property @{data1 = $rdr.GetValue(0);data2 =$rdr.GetValue(1)}
    $transactionComplete = $true
    catch{
    $transactionComplete = $false
    }until ($transactionComplete)
    $conn.Close()
    Then please try to use the cmdlet "Export-Csv" to export the data to excel like:
    $sql_output | Export-Csv d:\data.csv
    Or you can export to worksheet like:
    $excel = New-Object -ComObject Excel.Application
    $excel.Visible = $true
    $workbook = $excel.Workbooks.Add()
    $sheet = $workbook.ActiveSheet
    $counter = 0
    $sql_output | ForEach-Object {
    $counter++
    $sheet.cells.Item($counter,1) = $_.data1$sheet.cells.Item($counter,2) = $_.data2}
    Refer to:
    PowerShell and Excel: Fast, Safe, and Reliable
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang

  • Connect by complex query

    Hi all,
    I am working creating a hierarchy for a parent-child combination, but grouping by parent group field. I need to find a way to use more than one filter on the connect by clause.
    This is the table that I have :
    HIERID HIER VERID VER DIMPARENT DIMCHILD UNIT PARENTGROUP
    541002 Hierachy01 529012 Version01 0 Hierachy01 0 0
    541002 Hierachy01 529012 Version01 Hierachy01 Alternative Energy 0 1
    541002 Hierachy01 529012 Version01 Alternative Energy Business 1 0 1
    541002 Hierachy01 529012 Version01 Business 1 Australia 0 1
    541002 Hierachy01 529012 Version01 Australia Region 1 1958 1
    541002 Hierachy01 529012 Version01 Hierachy01 Alternative Energy 0 2
    541002 Hierachy01 529012 Version01 Alternative Energy Business 1 0 2
    541002 Hierachy01 529012 Version01 Business 1 Undefined 0 2
    541002 Hierachy01 529012 Version01 Undefined Region 3 2040 2
    541002 Hierachy01 529012 Version01 Hierachy01 Interest 0 3
    541002 Hierachy01 529012 Version01 Interest Business 1 0 3
    541002 Hierachy01 529012 Version01 Business 1 Australia 0 3
    541002 Hierachy01 529012 Version01 Australia Region 1 1964 3
    541002 Hierachy01 529012 Version01 Hierachy01 Interest 0 4
    541002 Hierachy01 529012 Version01 Interest Business 3 0 4
    541002 Hierachy01 529012 Version01 Business 3 Canada 0 4
    541002 Hierachy01 529012 Version01 Canada Region 1 2014 4
    I am running the following query, but is repiting the parent - child combination, because the same child could have multiple parents. Does any one has an idea how can I run my query?? I think I need to use the Parent group field on the connect by statement, but I don't know how to do it. Any idea will be gratefull.
    Select distinct HIER as UnitHierarchy,
    VER as Version,
    DIMVALPARENT as ParentCode,
    dimvalchild as ChildCode,
    level AS HIERLEVEL,
    SYS_CONNECT_BY_PATH(DIMVALCHILD, '/') as Path,
    Unit as UnitID,
    ParentGroup
    from (Select distinct fk_HIERID,HIER,FK_VERID,VER,DIMVALPARENT,DIMVALCHILD,
    UNIT,groupid as ParentGroup
    from HierarchyMap
    where HIER = 'Hierachy01' and ver = 'Version01' order by parentgroup,unit ) ---and (groupid='1'or groupid='0'))--
    start with DIMVALPARENT = '0'
    connect by prior DIMVALCHILD = DIMVALPARENT---- "can I use the one more field with the connect by??"
    order by parentgroup,hierlevel

    make sure you include 2 things in your queries.
    # the row number
    # the level
    for traversing up the tree set
    level = 0 - level and
    row_number = 0 - row_number.
    you than can then do an order by row_number if you union the two queries
    for example:
    ============
    select tbl.child,
    tbl.parent,
    level lvl,
    rownum rn
    from some_table tbl
    start with tbl.parent = 4.1
    connect by prior tbl.child = tbl.parent
    union
    select tbl.child,
    tbl.parent,
    0 - level lvl,
    0 - rownum rn
    from some_table tbl
    start with tbl.child = 4.1
    connect by prior tbl.parent = tbl.child
    order by rn asc

  • Using START WITH and CONNECT BY PRIOR in a report

    Hi - I am using Oracle 9i and reports 10g. Does anyone know of a reason why running my sql in TOAD will produce the correct results, but the report is dropping records? I am using start with and connect by prior to build a hierarchy of linked records. The report is dropping the "child records" and only returning records from the route level.
    Thanks you for your help.

    Hi user574499
    Could u pls share us ur Query...?
    Regards,
    Abdetu...

  • Connect by prior query

    Issue with the below query. The query is not getting filtered for the condition hier_typ_c in('BS') with the connect by prior
    query. query is fetching all the hier_type_c in the table like 'BS', 'CO', 'EC' etc....
    Just wondering how do i restrict the query just to fetch the type_c ='BS' alone? why is it giving all the records??
    Select 
            Level                 as  LEVEL_CODE,
            h.HIER_PRNT_NODE_I    as  PARENT,
            h.HIER_CHLD_NODE_I    as  CHILD,
            h.HIER_CHLD_NODE_X || ' (' || h.HIER_CHLD_NODE_I || ')'   as  ALIAS
            From        (Select  Distinct HIER_CHLD_NODE_I, HIER_PRNT_NODE_I,
                                HIER_CHLD_NODE_X from .HIER_DIMN
                         where hier_typ_c in('BS') and CURR_VER_C = 'Y') h
                         Start with  h.HIER_PRNT_NODE_I = 'ROOT'
            Connect by prior
                   h.HIER_CHLD_NODE_I = h.HIER_PRNT_NODE_I
    Order by    LEVEL_CODE, parent, child

    Hi
    It loks like you're doing it right.
    By basing the CONNECT BY query on a sub-query that has this WHERE clasue:
    where hier_typ_c in('BS') and CURR_VER_C = 'Y') hyou should exclude not only nodes whose hier_typ_c is not 'BS', but also their descendants.
    Post some sample data (CREATE TABLE and INSERT statements) and the results you want from that data.
    Are you sure the query you posted is what you're actually running?
    I would expect the sub-query FROM clause to cause an error because of the '.'.
    from .HIER_DIMNEdited by: Frank Kulash on Sep 29, 2009 11:16 AM

  • Oracle: slow performance with SELECT using ojdbc14 and connection pooling

    Hello,
    i'm working hard the last days to solve a performance problem with our customer using a oracle 10g database. For testing I used our oracle 9.2.0.1.0 database which shows the same symptoms. All doing solved nothing: the performance while using this oracle is much slower than other databases. This result I cannot trust and so I need some advice. What is missing to improve the performance on the java side?
    The webapplication I use runs fast on MySQL 4.x and SQLServer 2000, but on the above mentioned Oracle it was always 4 times slower. The webapplication uses a lot of simple SELECT-Statements without complicated joins and so on (because it should run on many different databases). Doing some days of creating tests within this webapplication, I was not able to find any entrance point for a change. All databases server I'm using, having only the default configurations after a common installation.
    To reduce the complexity I wrote a simple java application with connection pooling using only the latest libraries from apache-commons(dbcp, pool), and the latest ojdbc14 for oracle 9.2.
    First the results than the code: MySQL needed less than 1000 millisecond, SQLServer around 1000 milliseconds and Oracle over 2000 milliseconds. I stopped pooling and the results are for Oracle even worse: over 18000 milliseconds (mysql:2500, sqlserver:4100).
    I changed the classes for Oracle and used the class oracle.jdbc.pool.OracleConnectionCacheImpl from the ojdbc14-library. No difference (around 100 milliseconds more or less).
    The only Select-Statement works on this table, which has one index on HICTGID.
    It contains 259 entrances.:
    CREATE TABLE HIERARCHYCATEGORY (
      HICTGID                 NUMBER (19)   NOT NULL,
      HICTGLEVEL              NUMBER (10)   NOT NULL,
      HICTGEXTID              NUMBER (19)   NOT NULL,
      HICTGEXTPARENTID        NUMBER (19)   NOT NULL,
      HICTGNAME               VARCHAR2(255) NOT NULL
    );The application simply loops through this table using
    SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID = ?, but I always open a connection before this query and closes this connection afterwards. So I use the pooling as much as possible. That's all SQL I'm using.
        protected static DataSource setupDataSource(String sDriver, String sUrl, String sUser, String sPwd) throws SQLException {
            BasicDataSource ds = new BasicDataSource();
            ds.setDriverClassName(sDriver);
            ds.setUsername(sUser);
            ds.setPassword(sPwd);
            ds.setUrl(sUrl);
            // The maximum number of active connections:
            ds.setMaxActive(3);
            // The maximum number of active connections that can remain idle in the pool,
            // without extra ones being released, or zero for no limit:
            ds.setMaxIdle(3);
            // The maximum number of milliseconds that the pool will wait (when there are no available connections)
            // for a connection to be returned before throwing an exception, or -1 to wait indefinitely:
            ds.setMaxWait(3000);    
            return ds;
        }I can switch by using external properties between three databases (oracle, mysql and sqlserver) and if I want I can switch pooling off. And all actions I'm interested are logged by Log4J.
        public static Connection getConnection() throws SQLException {
            Connection result = null;
            String sJdbcDriver = m_oJbProp.getString("jdbcDriver");
            String sJdbcUrl = m_oJbProp.getString("databaseConnection");
            String sJdbcUser = m_oJbProp.getString("dbUsername");
            String sJdbcPwd = m_oJbProp.getString("dbPassword");
                try {
                    if (m_oJbProp.getString("useConnectionPooling").equals("true")) {
                         if (log.isDebugEnabled()) {
                              log.debug("ConnectionPooling true");
                        if(null == m_ds) {
                            m_ds = setupDataSource(sJdbcDriver,sJdbcUrl,sJdbcUser,sJdbcPwd);
                              if (log.isDebugEnabled()) {
                                   log.debug("DataSource created");
                        result = m_ds.getConnection();
                    } else {
                        // No connection pooling:
                         if (log.isDebugEnabled()) {
                              log.debug("ConnectionPooling false");
                        try {
                            Class.forName(sJdbcDriver);
                            result = DriverManager.getConnection(sJdbcUrl, sJdbcUser, sJdbcPwd);
                        } catch (ClassNotFoundException cnf) {
                            log.error("Exception: Class Not Found. ", cnf);
                            System.exit(0);
    (.. ErrorHandling ...)Here is the code fragment which is doing the work:
                     StringBuffer sb = new StringBuffer();
                while (lNextBottom <= lNextCeiling) {
                     con = getConnection();
                     innerSelStmt = con.prepareStatement("SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID = ?");
                     innerSelStmt.setLong(1, lNextBottom);
                     rsInner = innerSelStmt.executeQuery();
                     if ((rsInner != null) && (rsInner.next())) {
                         sb.append(rsInner.getLong(1) + ", " + rsInner.getString(2) + "\r");
                          if (log.isDebugEnabled()) {
                               log.debug("Inner Statement: " + rsInner.getLong(1) + "\r");
                     rsInner.close();
                     con.close();
                     lNextBottom++;
                 if (log.isInfoEnabled()) {
                      log.info("\rResult values: Hictgid, Hictgname \r");
                      log.info(sb.toString());
                 }and the main method:
        public static void main(String[] args) {
            try {
                 long lStartTime = System.currentTimeMillis();
                 JdbcBasic oJb = new JdbcBasic();
                 boolean bSuccess = false;
                 bSuccess = oJb.getHierarchycategories();
                 if (log.isInfoEnabled()) {
                      log.info("Running time: " + (System.currentTimeMillis() - lStartTime));
                 if (null != m_ds) {
                     printDataSourceStats(m_ds);
                      shutdownDataSource(m_ds);
                      if (log.isInfoEnabled()) {
                           log.info("Datasource closed.");
             } catch (SQLException sqe) {
                  log.error("SQLException within  main-method", sqe);
        }My database values are
    databaseConnection=jdbc:oracle:thin:@SERVERDB:1521:ora
    jdbcDriver=oracle.jdbc.driver.OracleDriver
    databaseConnection=jdbc:jtds:sqlserver://SERVERDB:1433/testdb
    jdbcDriver=net.sourceforge.jtds.jdbc.Driver
    databaseConnection=jdbc:mysql://localhost/testdb
    jdbcDriver=com.mysql.jdbc.Driver
    dbUsername=testusr
    dbPassword=testpwdThanks for your reading and maybe for your help.

    A few comments.
    There is of course another difference between your test cases then just the database. There is also the driver. And I suspect that in at least the case with the jtds driver it is helping you along where you are doing something silly and the Oracle driver is not.
    Before I explain the next part I would say the speed differences between MS-SQL and MySQL look about right I think you are aiming here for MS-SQL level performance not MySQL. (For a bunch of reasons MySQL is inherently faster but there are MANY drawbacks as well which have been well discussed on previous threads)
    Here is where I believe your problem lies
    while (lNextBottom <= lNextCeiling) {
                     con = getConnection();
                     innerSelStmt = con.prepareStatement("SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID = ?");
                     innerSelStmt.setLong(1, lNextBottom);
                     rsInner = innerSelStmt.executeQuery();
                     if ((rsInner != null) && (rsInner.next())) {
                         sb.append(rsInner.getLong(1) + ", " + rsInner.getString(2) + "\r");
                          if (log.isDebugEnabled()) {
                               log.debug("Inner Statement: " + rsInner.getLong(1) + "\r");
                     rsInner.close();
                     con.close();
                     lNextBottom++;
                 }There at least four things that are wrong with above.
    1) Why are you preparing the statement INSIDE the loop. Let us for a moment say that the loop will spin 100 times. That means that you are preparing the same statement 100 times. This is bad. It is also very relevant because for example the Jtds driver is going to be caching the prepared statements you make so that actually while you try and prepare it 100 times it only actually does it once... but in Oracle I don't know what it is doing for sure but if it is preparing on each pass well than that bit of it is going take 100 times longer then it should.
    2) You are opening and closing the connection on each pass through the loop... also a terrible idea. You need to fix this first so that you can repeatedly use the same prepared statement.
    3) Why are you looping in the first place? More on this later.
    4) Where do you close the PreparedStatement? It doesn't look like you do.
    Okay so for starters your loop should look a lot more like this...
    code]
    con = getConnection();
    innerSelStmt = con.prepareStatement("SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID = ?");
    while (lNextBottom <= lNextCeiling) {
    innerSelStmt.setLong(1, lNextBottom);
    rsInner = innerSelStmt.executeQuery();
    if ((rsInner != null) && (rsInner.next())) {
    sb.append(rsInner.getLong(1) + ", " + rsInner.getString(2) + "\r");
    rsInner.close();
    lNextBottom++;
    innerSelStmt.close();
    con.close();
    I think the code above (and you can put your debug stuff back if you want) which uses ONE connection and ONE prepared Statement will improve your performance dramatically.
    The other question though I would as is why in the hell you are doing 100 or whatever number of queries anyway. This can be done all in ONE query which again will improve performance.
    Your query and such should look like this I think.
    String sql = "SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID >=? AND HICTGID<=?";
    PreparedStatement ps = conn.prepareStatement(sql);
    ps.setLong(1,lNextBottom );
    ps.setLong(2,lNextCeiling);
    ResultSet rs = ps.executeQuery();
    while(rs.next()){
      // your appending to string buffer code goes here
    }and I can't understand why you're not doing that in the first place.

  • Complex connect by prior query

    I need SQL(for hierarchical tree) for a function which accepts node as input parameter and returns ref cursor.
    Following is a sample tree:
    1
    --2.1
    ----3.1
    ------4.1
    --------5.1
    ----------6.1
    ----------6.2
    ----3.2
    ------4.2
    --------5.2
    --2.2
    ----3.2
    ------4.2
    --------5.2
    ----3.3
    ----3.4
    ------4.1
    --------5.1
    ----------6.1
    ----------6.2
    1 is at the root level and 2.1 & 2.2 are immediate children and so on.
    The output tree should be all related parents and children of the passed node.
    e.g:
    If the input is 4.1, the output tree will be:
    1
    --2.1
    ----3.1
    ------4.1
    --------5.1
    ----------6.1
    ----------6.2
    --2.2
    ----3.4
    ------4.1
    --------5.1
    ----------6.1
    ----------6.2
    If the input is 4.2, the output tree will be:
    1
    --2.1
    ----3.2
    ------4.2
    --------5.2
    --2.2
    ----3.2
    ------4.2
    --------5.2
    The complex part, I guess, is to remove unwanted(not related) branches from the tree.
    Following is the representation of the table RELATIONSHIP
    ID     PARENT     CHILD
    1-------1-------2.1
    2-------1-------2.2
    3-------2.1-----3.1
    4-------2.1-----3.2
    5-------2.2-----3.2
    6-------2.2-----3.3
    7-------2.2-----3.4
    8-------3.1-----4.1
    9-------3.2-----4.2
    10------3.4-----4.1
    11------4.1-----5.1
    12------4.2-----5.2
    13------5.1-----6.1
    14------5.1-----6.2
    Pls. help me out to form this CONNECT BY PRIOR query.
    Thanks in advance.

    make sure you include 2 things in your queries.
    # the row number
    # the level
    for traversing up the tree set
    level = 0 - level and
    row_number = 0 - row_number.
    you than can then do an order by row_number if you union the two queries
    for example:
    ============
    select tbl.child,
    tbl.parent,
    level lvl,
    rownum rn
    from some_table tbl
    start with tbl.parent = 4.1
    connect by prior tbl.child = tbl.parent
    union
    select tbl.child,
    tbl.parent,
    0 - level lvl,
    0 - rownum rn
    from some_table tbl
    start with tbl.child = 4.1
    connect by prior tbl.parent = tbl.child
    order by rn asc

  • I have pluged a portable battery to the USB and my macbook pro stopped working after that, right before it shut down there was a message on the screen that said something like " USB device is withdrawing so much power, please disconnect and connect again?

    I have plugged a portable battery to the USB and my macbook pro stopped working after that, right before it shut down there was a message on the screen that said something like " USB device is withdrawing so much power, please disconnect and connect again?
    if the device I connected have caused this, shouldn't the macbook itself have some type of protection that should prevent this from happening.
    because when I took it to an apple certified maintenance shop, the guy said that now it could only run while connected to the power. it won't run on batteries. and that I have to change the motherboard.
    can I just replace the damaged part only, would apple consider this as a design issue and they could pay for it, or should I just buy a new motherboard for 800$.
    Help.

    BB1B2,
    The problem is in finding a tech shop that will/can do board level repairs on Macs. They are few. And I certainly wouldn't spend $800 on a new logic board - I would replace the computer if I had to pay that much!
    You could call around to a few repair shops and see if they feel competent to isolate the problem and do a board level repair - but I'm afraid, in the end, that your search will be futile.
    Sorry,
    Clinton

  • MCHB,MARD - Stock available at plant level and storage location level

    Hi ,
    How to determine how much stock available at Storage location level and Plant level. (Lot is not maintained).
    In MCHB-Stock at lot level is shown.
    In MARD-Stock at Storage Location level is shown lncluding
    the stock maintaned at the lot level.
    If i want to know the stock which is not maintained in Lot, i.e, Stocks directly maintained at Storage location / Plant.
    Do I need to subtract the MCHB Value from MARD Value ?
    Is there any other way available to find the stocks which is not maintained at lot level.
    Regards
    Prasath

    Hi prashant,
    What do u mean by stock maintained at SL level without batch level.  Do u mean that some materials are subjected to batch management and some or not?
    If that is the case, for all batch managed materials, u can see the stock at batch level and also same is summed up at SL level.  But still what ever u are getting from MARD table isstock at SL level only.
    If u have activated batch management for any material, it will always be shown at lot level also.
    hope this clarfifies query
    award points if found useful

  • OFFICE 2013 - Word could not re-establish a DDE connection to Microsoft Query

    Hi, I have installed office 2013 on a pc and used excel to run a query on a database and created a .qry query so I can use this data in word mail merge.
    The query runs ok and returns the data.
    However, when I go to take the data in through mail merge it comes up with a message "Confirm data source" ( I enabled this after  reading kb article below) so I select "MS query files via DDE(*.qry, *.dqy)" as this is a .dqy I select
    it. It says at the bottom of the screen word is starting query then comes up with the error  "Word could not re-establish a DDE connection to Microsoft Query to complete the current task".
    I have re-did the query from scratch and no difference I tried the recommend kb article 918594 and it still doesn't work.
    I recreated the odbc link and still no joy.
    Has anyone come across this and have they a solution I would be grateful.
    Thanks
    Tom

    Hi,
    Try to check whether the methods listed in the following link is helpful. The link applies to previous versions, but we can refer to it.
    http://support.microsoft.com/kb/813989
    Jaynet Zhang
    TechNet Community Support

  • Facts at different Logical Dimension Level and Default Interaction (Drill)

    I have one Geography Logical Dimension that consists of 3 physical tables snowflaked. The 3 tables are City, State and Country. I have created 3 Level Based Hierarchies.
    I have 2 Facts. Fact_State is at the State grain only (Set the appropriate Content Level). Fact_City is at the City grain (Set the appropriate Content Level).
    When I pull a query with Country and a metric from Fact_State, the default interaction allows me to drill down. I drill into the State values. I would assume that the Drill interaction would stop here since this metric (Fact_State) is only at this level.
    What actually occurs is it allows for a drill into City and when you look at the Physical SQL it is trying to hit the other Fact Table (Fact_City) and pulls back no metrics. I then return no data.
    I would ask does anyone know if this is the expected behaviour? Is there anyway to stop the drill at the State Level when metrics are only pulled from the State Fact?
    Please let me know if more information is needed.

    You need to have a metric sourcing from both Fact_State and Fact_City, provided both facts are as Logical sources for the logical fact table.
    Make sure Fact_State got proper level and Fact_City got detail level.
    When you pull Country or State with metric query should hit Fact_State, when you drill down below the state query should be from Fact_City with proper data.
    Edited by: Srini VEERAVALLI on Mar 28, 2013 2:43 PM
    I can look into your new post only If you update this or older posts. Still you may get responses from others ;)
    Edited by: Srini VEERAVALLI on May 22, 2013 2:00 PM

  • I can't connect to the router in my home.  Things were working fine as usual - I attended school and connected to their WiFi network as usual.  When I returned home I could not connect to my own home router.  The Ipad seeks the network but nothing happens

    I can't connect to the router in my home.  The Ipad seeks the network but nothing happens.  I went to school and connected to their WiFi network as usual with no problems.  When I returned home I could not connect to my home router.  The Ipad seeks the router number but nothing happens.  I rebooted the Ipad a few times in the school.  The numbers identifying the router, etc. on my Ipad no longer appear there. 
    TThe Ipad guide says to connect to the WiFi use setup but I can't find the setup program in the Ipad.
    I reset the network settings to the factory defaults but this doesn't fix the problem.
    What can I do to reconnect to my home router?

    Some things to try first:
    1. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    2. Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    3. Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    4. Go into your router security settings and change from WEP to WPA with AES.
    5.  Renew IP Address: (especially if you are droping internet connection)
        •    Launch Settings app
        •    Tap on Wi-Fi
        •    Tap on the blue arrow of the Wi-Fi network that you connect to from the list
        •    In the window that opens, tap on the Renew Lease button
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    iOS 6 Wifi Problems/Fixes
    How To: Workaround iPad Wi-Fi Issues
    http://www.theipadfan.com/workaround-ipad-wifi-issues/
    Another Fix For iOS 6 WiFi Problems
    http://tabletcrunch.com/2012/10/27/fix-ios-6-wifi-problems-ssid/
    Wifi Doesn't Connect After Waking From Sleep - Sometimes increasing screen brightness prevents the failure to reconnect after waking from sleep. According to Apple, “If brightness is at lowest level, increase it by moving the slider to the right and set auto brightness to off.”
    Fix For iOS 6 WiFi Problems?
    http://tabletcrunch.com/2012/09/27/fix-ios-6-wifi-problems/
    Did iOS 6 Screw Your Wi-Fi? Here’s How to Fix It
    http://gizmodo.com/5944761/does-ios-6-have-a-wi+fi-bug
    How To Fix Wi-Fi Connectivity Issue After Upgrading To iOS 6
    http://www.iphonehacks.com/2012/09/fix-wi-fi-connectivity-issue-after-upgrading- to-ios-6.html
    iOS 6 iPad 3 wi-fi "connection fix" for netgear router
    http://www.youtube.com/watch?v=XsWS4ha-dn0
    Apple's iOS 6 Wi-Fi problems
    http://www.zdnet.com/apples-ios-6-wi-fi-problems-linger-on-7000004799/
    ~~~~~~~~~~~~~~~~~~~~~~~
    How to Fix a Poor Wi-Fi Signal on Your iPad
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Fix-A-Poor-Wi-Fi-Signal-O n-Your-iPad.htm
    iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    WiFi Connecting/Troubleshooting http://www.apple.com/support/ipad/wifi/
    How to Fix: My iPad Won't Connect to WiFi
    http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-My-Ipad-Wont-Connect -To-Wi-Fi.htm
    iOS: Connecting to the Internet http://support.apple.com/kb/HT1695
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Connect iPad to Wi-Fi (with troubleshooting info)
    http://thehowto.wikidot.com/wifi-connect-ipad
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    How To Fix iPhone, iPad, iPod Touch Wi-Fi Connectivity Issue http://tinyurl.com/7nvxbmz
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • Will an iPhone automatically turn off location services.  If it goes below a certain battery power level, and so how you disable this in settings.

    I am working with Georgia DOT and we have created an app to track our state vehicles using IPhone 5. My question is: will an iPhone automatically turn off location services?  If it goes below a certain battery power level, and if so how do you disable this in settings.
    Message was edited by: mickyel

    I don't believe that this will happen, however, the entire iPhone will shut down when the iPhone reaches the auto-shutdown power level. There is no way to turn that Off other that connecting the iPhone to power.

Maybe you are looking for