SQL query to retrieve families with only one generation from a family db

Hi,
I need to write an SQL query that would select families with only one generation ((which means a person - or a married couple - with kids) or (a person - or a married couple - with parents but no kids)) from a database containing families. The simplified db structure is:
person:
id - int, primary key
siblings:
id
parent_id
kid_id
marriage
id:
husband_id
wife_id
Could anyone please help me? I dont really have any idea how to accomplish that...

Hi,
Welcome to the forum!
Assuming that siblings (despite its name) contains only parent-child relationships, and that the parent_id could be either the mother or the father:
WITH     got_tree     AS
     SELECT     CONNECT_BY_ROOT  s.parent_id     AS root_id
     ,     LEVEL                     AS lvl
     FROM          siblings     s
     LEFT OUTER JOIN     marriage     m     ON     s.parent_id     IN ( m.husband_id
                                                        , m.wife_id
     START WITH     parent_id     NOT IN     (  SELECT  kid_id
                                           FROM        siblings
     CONNECT BY     s.parent_id     IN ( PRIOR m.husband_id
                            , PRIOR m.wife_id
                            , PRIOR kid_id
SELECT       root_id
FROM       got_tree
GROUP BY  root_id
HAVING       MAX (lvl)     <= 2
;This will get a list of parents who may or may not have children, but who do not have either parents or grandchildren.
To get their spouses and children (if any) you will have to join this result set to all the other tables. At that point, you can eliminate poeple who do not have ancestors themselves, but are married to people who have more than one generation of ancestors.
The details of how to do that depend on the details of your tables. If you'd like help, then post a little sample data (CREATE TABLE and INSERT statements for all tables) and the results you want from that data.
Edited by: Frank Kulash on Oct 14, 2009 4:05 PM
I'd need sample data in order to test this, of course.

Similar Messages

  • SQL Server 2012 Undetected Deadlock in a table with only one row

      We have migrated our SQL 2000 Enterprise Database to SQL 2012 Enterprise few days ago.
      This is our main database, so most of the applications access it.
      The day after the migration, when users started to run tasks, the database access started to experiment a total failure.
      That is, all processes in the SQL 2k12 database were in lock with each other. This is a commom case of deadlock, but the Database Engine was unable to detect it.
      After some research, we found that the applications were trying to access a very simple table with only one row. This table has a number that is restarted every day and is used to number all the transactions made against the system.   So, client
    applications start a new transaction, get the current number, increment it by one and commit the transaction.
      The only solution we found was to kill all user processes in SQL Server every time this situation occurs (no more than 5 minutes when all clients are accessing the database).
      No client application was changed in this migration and this process was working very well for the last 10 years.
      The problem is that SQL 2k12 is unable to handle this situation compared to SQL 2k.
      It seems to occurs with other tables too, but as this is an "entry table" the problem occurs with it first.
      I have searched internet and some suggest some workarounds like using table hints to completely lock the table at the begining of the transaction, but it can't be used to other tables.
      Does anyone have heard this to be a problem with SQL 2k12? Is there any fixes to make SQL 2k12 as good as SQL 2k?

    First off re: "Unfortunatelly, this can't be used in production environment as exclusive table lock would serialize the accesses to tables and there will be other tables that will suffer with this problem."
    This is incorrect. 
    Using a table to generate sequence numbers like this is a bad idea exactly because the access must be serialized.  Since you can't switch to a SEQUENCE object, which is the correct solution, the _entire goal_ of this exercise to find a way to properly
    serialize access to this table.  Using exclusive locking will not be necessary for all the tables; just for the single-row table used for generating sequence values with a cursor.
    I converted the sample program to VB.NET:
    Public Class Form1
    Private mbCancel As Boolean = False
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim soConn As ADODB.Connection
    Dim soRst As ADODB.Recordset
    Dim sdData As Date
    Dim slValue As Long
    Dim slDelay As Long
    'create database vbtest
    'go
    ' CREATE TABLE [dbo].[ControlNumTest](
    ' [UltData] [datetime] NOT NULL,
    ' [UltNum] [int] NOT NULL,
    ' CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
    ' [UltData] Asc
    ' )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]
    ' ) ON [PRIMARY]
    mbCancel = False
    Do
    ' Configure the Connection object
    soConn = New ADODB.Connection
    With soConn
    .ConnectionString = "Provider=SQLNCLI11;Initial Catalog=vbtest;Data Source=localhost;trusted_connection=yes"
    .IsolationLevel = ADODB.IsolationLevelEnum.adXactCursorStability
    .Mode = ADODB.ConnectModeEnum.adModeReadWrite
    .CursorLocation = ADODB.CursorLocationEnum.adUseServer
    .Open()
    End With
    ' Start a new transaction
    Call soConn.BeginTrans()
    ' Configure the RecordSet object
    soRst = New ADODB.Recordset
    With soRst
    .ActiveConnection = soConn
    .CursorLocation = ADODB.CursorLocationEnum.adUseServer
    .CursorType = ADODB.CursorTypeEnum.adOpenForwardOnly
    .LockType = ADODB.LockTypeEnum.adLockPessimistic
    .Open("SELECT * FROM dbo.ControlNumTest")
    End With
    With soRst
    sdData = .Fields!UltData.Value ' Read the last Date (LOCK INFO 1: See comments bello
    slValue = .Fields!UltNum.Value ' Read the last Number
    If sdData <> Date.Now.Date Then ' Date has changed?
    sdData = Date.Now.Date
    slValue = 1 ' Restart number
    End If
    .Fields!UltData.Value = sdData ' Update data
    .Fields!UltNum.Value = slValue + 1 ' Next number
    End With
    Call soRst.Update()
    Call soRst.Close()
    ' Ends the transaction
    Call soConn.CommitTrans()
    Call soConn.Close()
    soRst = Nothing
    soConn = Nothing
    txtUltNum.Text = slValue + 1 ' Display the last number
    Application.DoEvents()
    slDelay = Int(((Rnd * 250) + 100) / 100) * 100
    System.Threading.Thread.Sleep(slDelay)
    Loop While mbCancel = False
    If mbCancel = True Then
    Call MsgBox("The test was canceled")
    End If
    Exit Sub
    End Sub
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    mbCancel = True
    End Sub
    End Class
    And created the table
    CREATE TABLE [dbo].[ControlNumTest](
    [UltData] [datetime] NOT NULL,
    [UltNum] [int] NOT NULL,
    CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
    [UltData] Asc
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = on, FILLFACTOR = 80) ON [PRIMARY]
    ) ON [PRIMARY]
    go insert into ControlNumTest values (cast(getdate()as date),1)
    Then ran 3 copies of the program and generated the deadlock:
    <deadlock>
    <victim-list>
    <victimProcess id="processf27b1498" />
    </victim-list>
    <process-list>
    <process id="processf27b1498" taskpriority="0" logused="0" waitresource="KEY: 35:72057594039042048 (a01df6b954ad)" waittime="1970" ownerId="3181" transactionname="implicit_transaction" lasttranstarted="2014-02-14T15:49:31.263" XDES="0xf04da3a8" lockMode="X" schedulerid="4" kpid="9700" status="suspended" spid="51" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2014-02-14T15:49:31.267" lastbatchcompleted="2014-02-14T15:49:31.267" lastattention="1900-01-01T00:00:00.267" clientapp="vbt" hostname="DBROWNE2" hostpid="21152" loginname="NORTHAMERICA\dbrowne" isolationlevel="read committed (2)" xactid="3181" currentdb="35" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128058">
    <executionStack>
    <frame procname="adhoc" line="1" stmtstart="80" sqlhandle="0x020000008376181f3ad0ea908fe9d8593f2e3ced9882f5c90000000000000000000000000000000000000000">
    UPDATE [dbo].[ControlNumTest] SET [UltData]=@Param000004,[UltNum]=@Param000005 </frame>
    <frame procname="unknown" line="1" sqlhandle="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000">
    unknown </frame>
    </executionStack>
    <inputbuf>
    (@Param000004 datetime,@Param000005 int)UPDATE [dbo].[ControlNumTest] SET [UltData]=@Param000004,[UltNum]=@Param000005 </inputbuf>
    </process>
    <process id="processf6ac9498" taskpriority="0" logused="10000" waitresource="KEY: 35:72057594039042048 (a01df6b954ad)" waittime="1971" schedulerid="5" kpid="30516" status="suspended" spid="55" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2014-02-14T15:49:31.267" lastbatchcompleted="2014-02-14T15:49:31.267" lastattention="1900-01-01T00:00:00.267" clientapp="vbt" hostname="DBROWNE2" hostpid="27852" loginname="NORTHAMERICA\dbrowne" isolationlevel="read committed (2)" xactid="3182" currentdb="35" lockTimeout="4294967295" clientoption1="671156256" clientoption2="128058">
    <executionStack>
    <frame procname="adhoc" line="1" sqlhandle="0x020000003c6309232ab0edbe0a7790a816a09c4c5ac6f43c0000000000000000000000000000000000000000">
    FETCH API_CURSOR0000000000000001 </frame>
    <frame procname="unknown" line="1" sqlhandle="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000">
    unknown </frame>
    </executionStack>
    <inputbuf>
    FETCH API_CURSOR0000000000000001 </inputbuf>
    </process>
    </process-list>
    <resource-list>
    <keylock hobtid="72057594039042048" dbid="35" objectname="vbtest.dbo.ControlNumTest" indexname="PK_CorreioNumTeste" id="lockff6e6c80" mode="U" associatedObjectId="72057594039042048">
    <owner-list>
    <owner id="processf6ac9498" mode="S" />
    <owner id="processf6ac9498" mode="U" requestType="wait" />
    </owner-list>
    <waiter-list>
    <waiter id="processf27b1498" mode="X" requestType="convert" />
    </waiter-list>
    </keylock>
    <keylock hobtid="72057594039042048" dbid="35" objectname="vbtest.dbo.ControlNumTest" indexname="PK_CorreioNumTeste" id="lockff6e6c80" mode="U" associatedObjectId="72057594039042048">
    <owner-list>
    <owner id="processf27b1498" mode="U" />
    <owner id="processf27b1498" mode="U" />
    <owner id="processf27b1498" mode="X" requestType="convert" />
    </owner-list>
    <waiter-list>
    <waiter id="processf6ac9498" mode="U" requestType="wait" />
    </waiter-list>
    </keylock>
    </resource-list>
    </deadlock>
    It's the S lock that comes from the cursor read that's the villian here.  U locks are compatible with S locks, so one session gets a U lock and another gets an S lock.  But then the session with an S needs a U, and the session with a U needs an
    X.  Deadlock. 
    I'm not sure what kind of locks were taken by this cursor code on SQL 2000, but on SQL 2012, this code is absolutely broken and should deadlock.
    The right way to fix this code is to add (UPDLOCK,SERIALIZABLE) to the cursor
    .Open("SELECT * FROM dbo.ControlNumTest with (updlock,serializable)")
    So each session reads the table with a restrictive lock, and you don't mix S, U and X locks in this transaction.  This resolves the deadlock, but requires a code change.
    I tried several things that didn't require a code, which did not resolve the deadlock;
    1) setting ALLOW_ROW_LOCKS=OFF ALLOW_PAGE_LOCKS=OFF
    2) SERIALIZABLE isolation level
    3) Switching OleDB providers from SQLOLEDB to SQLNCLI11
    Then I replaced the table with a view containing a lock hint:
    CREATE TABLE [dbo].[ControlNumTest_t](
    [UltData] [datetime] NOT NULL,
    [UltNum] [int] NOT NULL,
    CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
    [UltData] Asc
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = on, FILLFACTOR = 80) ON [PRIMARY]
    ) ON [PRIMARY]
    go
    create view ControlNumTest as
    select * from ControlNumTest_t with (tablockx)
    Which, at least in my limited testing, resovlved the deadlock without any client code change.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Issue with only one client - The client version 5.00.7958.1000 does not match the MP version 5.00.7711.0000. The client will not be installed.

    Below issue is with only one client in that untrusted domain. So boundary is not the issue.
    Env -
    mydom.com has SCCM PRI site (MP, DP as well).
    Client is in untrusted forest.
    Please help.
    Thanks
    MP 'mysccm.mydom.com' is compatible ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Retrieved 1 MP records from AD for site 'pri' ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Retrived site version '5.00.7958.1000' from AD for site 'pri' ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    SiteCode:         pri ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    SiteVersion:      5.00.7958.1000 ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Ccmsetup is being restarted due to an administrative action. Installation files will be reset and downloaded again. ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Deleted file C:\Windows\ccmsetup\client.msi ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Only one MP mysccm.mydom.com is specified. Use it. ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Searching for DP locations from MP(s)... ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Current AD site of machine is Default-First-Site-Name LocationServices 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Local Machine is joined to an AD domain LocationServices 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Current AD forest name is staging.local, domain name is staging.local LocationServices 11/4/2014 12:14:55 PM 4816 (0x12D0)
    DhcpGetOriginalSubnetMask entry point is supported. LocationServices 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Begin checking Alternate Network Configuration LocationServices 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Finished checking Alternate Network Configuration LocationServices 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Sending message body '<ContentLocationRequest SchemaVersion="1.00">
      <AssignedSite SiteCode="pri"/>
      <ClientPackage/>
      <ClientLocationInfo LocationType="SMSPACKAGE" DistributeOnDemand="0" UseProtected="0" AllowCaching="0" BranchDPFlags="0" AllowHTTP="1" AllowSMB="0" AllowMulticast="0"
    UseInternetDP="0">
        <ADSite Name="Default-First-Site-Name"/>
        <Forest Name="staging.local"/>
        <Domain Name="staging.local"/>
        <IPAddresses>
    <IPAddress SubnetAddress="10.72.117.0" Address="10.72.117.134"/>
    <IPAddress SubnetAddress="10.72.117.0" Address="10.72.117.142"/>
        </IPAddresses>
      </ClientLocationInfo>
    </ContentLocationRequest>
    ' ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Sending message header '<Msg SchemaVersion="1.1"><ID>{5B972249-B931-4739-9EFA-A9FDE29C351A}</ID><SourceHost>STAGINGSRVR07</SourceHost><TargetAddress>mp:[http]MP_LocationManager</TargetAddress><ReplyTo>direct:STAGINGSRVR07:LS_ReplyLocations</ReplyTo><Priority>3</Priority><Timeout>600</Timeout><ReqVersion>5931</ReqVersion><TargetHost>mysccm.mydom.com</TargetHost><TargetEndpoint>MP_LocationManager</TargetEndpoint><ReplyMode>Sync</ReplyMode><Protocol>http</Protocol><SentTime>2014-11-04T17:14:55Z</SentTime><Body
    Type="ByteRange" Offset="0" Length="1264"/><Hooks><Hook3 Name="zlib-compress"/></Hooks><Payload Type="inline"/></Msg>' ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    CCM_POST 'HTTP://mysccm.mydom.com/ccm_system/request' ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Content boundary is '--aAbBcCdDv1234567890VxXyYzZ' ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Received header '<Msg SchemaVersion="1.1">
     <ID>{D4EF0A4D-A000-4697-9AFA-B1317B09931D}</ID>
     <SourceID>GUID:21298681-5080-4365-B614-F0C8DF67452B</SourceID>
     <SourceHost>pri1SCCM02</SourceHost>
     <TargetAddress>direct:STAGINGSRVR07:LS_ReplyLocations</TargetAddress>
     <ReplyTo>MP_LocationManager</ReplyTo>
     <CorrelationID>{00000000-0000-0000-0000-000000000000}</CorrelationID>
     <Priority>3</Priority>
     <Timeout>600</Timeout>
     <TargetHost>STAGINGSRVR07</TargetHost><TargetEndpoint>LS_ReplyLocations</TargetEndpoint><ReplyMode>Sync</ReplyMode><Protocol>http</Protocol><SentTime>2014-11-04T17:14:55Z</SentTime><Body Type="ByteRange"
    Offset="0" Length="2408"/><Hooks><Hook3 Name="zlib-compress"/><Hook Name="authenticate"><Property Name="Signature">3082019206092A864886F70D010702A08201833082017F020101310B300906052B0E03021A0500300B06092A864886F70D0107013182015E3082015A02010130373023311330110603550403130A545247315343434D3032310C300A06035504031303534D5302106C6A0DBD0066FA9642BBD3DB95A990CD300906052B0E03021A0500300D06092A864886F70D01010105000482010042A5446464A1253E1A8D831E124760EAAF9ABAEB8627D5066402ADA9E5EBF22032BD329C6DCEC93506E122ED6D43064E57504C60DEAD096C14F5873C03659B99660F7F037AE8B326F5A5AAD5D04E2FAFDE6BBE99B4226F1B45437D1214585783F2CC92E332045586025E1577F90B15EF16A18EBC10EE029550C3FF0255C74BC373E06851692D090B589FFAA2E2C427CE5687D04F31FE45D738D027F5357E03901E075A0AE9ECD9E5FA90A9AF7470A1877FFC6AD9DE2AAFE6717FB0237A59ACF8C96C797A5C83985F58B3EFD376F8BD29ABEA613B33B3CCEE9160697A83F6503FCF9BD12FFE1234ACF3A58EB7A0DB61915B5C543BB6A9D34491F281BAB589C55E</Property><Property
    Name="AuthSenderMachine">pri1SCCM02;mysccm.mydom.com;</Property><Property Name="MPSiteCode">pri</Property></Hook></Hooks><Payload Type="inline"/></Msg>' ccmsetup 11/4/2014 12:14:55
    PM 4816 (0x12D0)
    Received reply body '<ContentLocationReply SchemaVersion="1.00"><ContentInfo PackageFlags="16777216"><ContentHashValues/></ContentInfo><Sites><Site><MPSite SiteCode="pri" MasterSiteCode="pri"
    SiteLocality="LOCAL" IISPreferedPort="80" IISSSLPreferedPort="443"/><LocationRecords><LocationRecord><URL Name="http://mysccm.mydom.com/SMS_DP_SMSPKG$/pri00002"
    Signature="<ADSite">http://mysccm.mydom.com/SMS_DP_SMSSIG$/pri00002"/><ADSite Name="CSSG-Mount-Laurel"/><IPSubnets><IPSubnet Address="10.72.117.0"/><IPSubnet
    Address=""/></IPSubnets><Metric Value=""/><Version>7958</Version><Capabilities SchemaVersion="1.0"><Property Name="SSLState" Value="0"/></Capabilities><ServerRemoteName>mysccm.mydom.com</ServerRemoteName><DPType>SERVER</DPType><Windows
    Trust="0"/><Locality>LOCAL</Locality></LocationRecord></LocationRecords></Site></Sites><ClientPackage FullPackageID="pri00002" FullPackageVersion="2" FullPackageHash="03CFD97C8FB5F7E7E9F177FD6D30D6F25ED106E517E69B715695A0E81DB1D9AF"
    MinimumClientVersion="5.00.7958.1000" RandomizeMaxDays="7" ProgramEnabled="false" LastModifiedTime="30388855;1262113920" SiteVersionMatch="true" SiteVersion="5.00.7958.1000" EnablePeerCache="true"/><RelatedContentIDs/></ContentLocationReply>'
    ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Found local location 'http://mysccm.mydom.com/SMS_DP_SMSPKG$/pri00002' ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Discovered 1 local DP locations. ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    PROPFIND 'http://mysccm.mydom.com/SMS_DP_SMSPKG$/pri00002' ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Got 401 challenge Retrying with Windows Auth... ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    PROPFIND 'http://mysccm.mydom.com/SMS_DP_SMSPKG$/pri00002' ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Failed to correctly receive a WEBDAV HTTP request.. (StatusCode at WinHttpQueryHeaders: 401) ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Failed to check url http://mysccm.mydom.com/SMS_DP_SMSPKG$/pri00002. Error 0x80004005 ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Enumerated all 1 local DP locations but none of them is good. Fallback to MP. ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    GET 'HTTP://mysccm.mydom.com/CCM_Client/ccmsetup.cab' ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    C:\Windows\ccmsetup\ccmsetup.cab is Microsoft trusted. ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Successfully extracted manifest file C:\Windows\ccmsetup\ccmsetup.xml from file C:\Windows\ccmsetup\ccmsetup.cab. ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Loading manifest file: C:\Windows\ccmsetup\ccmsetup.xml ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Successfully loaded ccmsetup manifest file. ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Checking if manifest version '5.00.7958.1000' is newer than the ccmsetup version '5.0.7958.1000' ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Running from temp downloaded folder or manifest is not newer than ccmsetup. ccmsetup 11/4/2014 12:14:55 PM 4816 (0x12D0)
    Adding file 'HTTP://mysccm.mydom.com:80/CCM_Client/x64/client.msi' to BITS job, saving as 'C:\Windows\ccmsetup\client.msi'. ccmsetup 11/4/2014 12:14:56 PM 4816 (0x12D0)
    Starting BITS download for client deployment files. ccmsetup 11/4/2014 12:14:56 PM 4816 (0x12D0)
    Successfully completed BITS download for client deployment files. ccmsetup 11/4/2014 12:14:57 PM 4816 (0x12D0)
    Successfully downloaded client files via BITS. ccmsetup 11/4/2014 12:14:57 PM 4816 (0x12D0)
    Validated file 'C:\Windows\ccmsetup\client.msi' hash 'A5732CE24F2B1545E9FBA458971E0A5504093E0F743CA9E8BD9C047582902878' ccmsetup 11/4/2014 12:14:58 PM 4816 (0x12D0)
    Retrieved client version '5.00.7958.1000' and minimum assignable site version '5.00.7845.1000' from client package ccmsetup 11/4/2014 12:14:58 PM 4816 (0x12D0)
    Checking compatibility of site version '5.00.7958.1000', expect newer than '5.00.7845.1000' ccmsetup 11/4/2014 12:14:58 PM 4816 (0x12D0)
    Site version '5.00.7958.1000' is compatible. Client deployment will continue. ccmsetup 11/4/2014 12:14:58 PM 4816 (0x12D0)
    An MP exists on this machine. ccmsetup 11/4/2014 12:14:58 PM 4816 (0x12D0)
    The client version 5.00.7958.1000 does not match the MP version 5.00.7711.0000.  The client will not be installed. ccmsetup 11/4/2014 12:14:58 PM 4816 (0x12D0)
    A Fallback Status Point has not been specified.  Message with STATEID='318' will not be sent. ccmsetup 11/4/2014 12:14:58 PM 4816 (0x12D0)
    InstallFromManifest failed 0x80004005 ccmsetup 11/4/2014 12:14:58 PM 4816 (0x12D0)
    CcmSetup failed with error code 0x80004005 ccmsetup 11/4/2014 12:14:58 PM 3680 (0x0E60)

    Why two primary that is 'coz geographically based server support and workstation. You can think it as a data center to data center split.
    That doesn't make sense and aren't valid reasons for 2012 (not that you can necessarily change it now).
    This line jumps out at me in the log file though: "An MP exists on this machine".
    That looks like the system you are installing on previously had an MP on it. I would delete the ccm namespace in WMI, cleanup all reference to ccm and Configuratin Manager from the registry, and then try again.
    Jason | http://blog.configmgrftw.com | @jasonsandys

  • Nodes with Only One Lower-Level Node = Hide

    Hi everyone
    Have anyone present this situation:
    Iu2019ve a quey to report inventory aging. It has two hierarchies to show data. In Rows I have Major Markets and in Columns a date hierarchy to show aging Ex: from 0 to 8 months, 9+ and 13+. Of course here I have also value and volume.
    Query reports all values for all major markets fine. When I filter one major market, letu2019s say France also brings detailed figures but when I add any drill down in rows all values goes to cero (0).
    Te estrange is that if you swap drill down order with major markets or drill down by columns with the same characteristic figures come out again as usual.
    I know this sounds like a SAP note but I have not been able to find it either.
    Thanks a lot for your help, and of course points will be assignedu2026..
    Ps. Important, this happen when  option u201CNodes with Only One Lower-Level Node = Hideu201D (this is selected on purpose because there are some repeated nodes in major market hierarchy Ex. France u2013 France and if there is just one value under first node then means that only display of last one is necessary to avoid repeated values).

    Solution we found is to remove flag "Do not display leaves for inner-nodes in the query", directly on the hierarchy.
    Thanks

  • SQL query to retrieve totals from "supporting Details"

    We've had a strange issue where the totals from the supporting details aren't adding up to the value submitted in essbase.
    In effect our RDMS is out of sync with Planning.
    In order to remedy this, I'm trying to build a SQL query to retrieve the value of the supporting details.
    Here is my Sql statement so far :
    SELECT
    HO1.OBJECT_NAME SCENARIO,
    HO2.OBJECT_NAME ACCOUNT,
    HO3.OBJECT_NAME ENTITY,
    HO4.OBJECT_NAME Month,
    HO5.OBJECT_NAME Version,
    HO6.OBJECT_NAME Currency,
    HO7.OBJECT_NAME Year,
    HO8.OBJECT_NAME Project,
    HO10.OBJECT_NAME CC,
    HO12.OBJECT_NAME Grplcl,
    HO13.OBJECT_NAME Product,
    HO15.OBJECT_NAME SalesRegion,
    HO16.OBJECT_NAME ContractAnalysis,
    HO17.OBJECT_NAME IC,
    SUM(NVL(HCDI.VALUE,0)) AMOUNT
    FROM hsp_column_detail HCD,
    hsp_column_detail_ITEM HCDI,
    HSP_OBJECT HO1,
    HSP_OBJECT HO2,
    HSP_OBJECT HO3,
    HSP_OBJECT HO4,
    HSP_OBJECT HO5,
    HSP_OBJECT HO6,
    HSP_OBJECT HO7,
    HSP_OBJECT HO8,
    HSP_OBJECT HO10,
    HSP_OBJECT HO12,
    HSP_OBJECT HO13,
    HSP_OBJECT HO15,
    HSP_OBJECT HO16,
    HSP_OBJECT HO17
    WHERE hcd.detail_id = hcdi.detail_id
    AND hcd.dim1 = ho1.object_id
    AND hcd.dim2 = ho2.object_id
    AND hcd.dim3 = ho3.object_id
    AND hcd.dim4 = ho4.object_id
    AND hcd.dim5 = ho5.object_id
    AND hcd.dim6 = ho6.object_id
    AND hcd.dim7 = ho7.object_id
    AND hcd.dim8 = ho8.object_id
    AND hcd.dim10 = ho10.object_id
    AND hcd.dim12 = ho12.object_id
    AND hcd.dim13 = ho13.object_id
    AND hcd.dim15 = ho15.object_id
    AND hcd.dim16 = ho16.object_id
    AND hcd.dim17 = ho17.object_id
    and hcdi.generation = 0
    GROUP BY HO1.OBJECT_NAME, HO2.OBJECT_NAME, HO3.OBJECT_NAME, HO4.OBJECT_NAME,
    HO5.OBJECT_NAME,
    HO6.OBJECT_NAME,
    HO7.OBJECT_NAME,
    HO8.OBJECT_NAME,
    HO10.OBJECT_NAME,
    HO12.OBJECT_NAME,
    HO13.OBJECT_NAME,
    HO15.OBJECT_NAME,
    HO16.OBJECT_NAME,
    HO17.OBJECT_NAME
    ORDER BY HO1.OBJECT_NAME, HO3.OBJECT_NAME, HO2.OBJECT_NAME

    This query works using PL SQL and has been used on Oracle 9.2.3.
    Cheers,
    Jeremie
    Here is the Query:
    set serveroutput on;
    set serveroutput on size 1000000;
    --set buffer_size 10000000;
    --set line_size 2000;
    --DBMS_OUTPUT.size = 2000000;
    DECLARE
    CURSOR BUDGET_HEADERS_CU IS
    SELECT
    hcd.detail_id,
    HO1.OBJECT_NAME SCENARIO,
    HO2.OBJECT_NAME ACCOUNT,
    HO3.OBJECT_NAME ENTITY,
    HO4.OBJECT_NAME Month,
    HO5.OBJECT_NAME Version,
    HO6.OBJECT_NAME Currency,
    HO7.OBJECT_NAME Year,
    HO8.OBJECT_NAME Project,
    HO10.OBJECT_NAME CC,
    HO12.OBJECT_NAME Grplcl,
    HO13.OBJECT_NAME Product,
    HO15.OBJECT_NAME SalesRegion,
    HO16.OBJECT_NAME ContractAnalysis,
    HO17.OBJECT_NAME IC,
    hcd.dim1 SCENARIO_id,
    hcd.dim2 ACCOUNT_id,
    hcd.dim3 ENTITY_id,
    hcd.dim4 Month_id,
    hcd.dim5 Version_id,
    hcd.dim6 Currency_ID,
    hcd.dim7 Year_ID,
    hcd.dim8 Project_ID,
    hcd.dim10 CC_ID,
    hcd.dim12 Grplcl_ID,
    hcd.dim13 Product_ID,
    hcd.dim15 SalesRegion_ID,
    hcd.dim16 ContractAnalysis_ID,
    hcd.dim17 IC_ID
    FROM hsp_column_detail HCD, /*hsp_column_detail_item HCDi,*/
    HSP_OBJECT HO1,
    HSP_OBJECT HO2,
    HSP_OBJECT HO3,
    HSP_OBJECT HO4,
    HSP_OBJECT HO5,
    HSP_OBJECT HO6,
    HSP_OBJECT HO7,
    HSP_OBJECT HO8,
    HSP_OBJECT HO10,
    HSP_OBJECT HO12,
    HSP_OBJECT HO13,
    HSP_OBJECT HO15,
    HSP_OBJECT HO16,
    HSP_OBJECT HO17
    WHERE /*hcd.detail_id = hcdi.detail_id
    AND*/ hcd.dim1 = ho1.object_id
    AND hcd.dim2 = ho2.object_id
    AND hcd.dim3 = ho3.object_id
    AND hcd.dim4 = ho4.object_id
    AND hcd.dim5 = ho5.object_id
    AND hcd.dim6 = ho6.object_id
    AND hcd.dim7 = ho7.object_id
    AND hcd.dim8 = ho8.object_id
    AND hcd.dim10 = ho10.object_id
    AND hcd.dim12 = ho12.object_id
    AND hcd.dim13 = ho13.object_id
    AND hcd.dim15 = ho15.object_id
    AND hcd.dim16 = ho16.object_id
    AND hcd.dim17 = ho17.object_id
    and HO5.OBJECT_NAME = 'Working'
    --and hcdi.generation != 0
    --and hcdi.label like 'JRTEST-%'
    --and hcd.detail_id = 253102
    /*GROUP BY HCD.Dim1, HCD.Dim2, HCD.Dim3, HCD.Dim4,
    HCD.Dim5,
    HCD.Dim6,
    HCD.Dim7,
    HCD.Dim8,
    HCD.Dim10,
    HCD.Dim12,
    HCD.Dim13,
    HCD.Dim15,
    HCD.Dim16,
    HCD.Dim17*/;
    CURSOR BUDGET_DETAILS_CU(
    /*scenario_p in varchar2,
    account_p in varchar2,
    entity_p in varchar2,
    month_p in varchar2,
    version_p in varchar2,
    currency_p in varchar2,
    year_p in varchar2,
    project_p in varchar2,
    cc_p in varchar2,
    grplcl_p in varchar2,
    product_p in varchar2,
    salesregion_p in varchar2,
    contractanalysis_p in varchar2,
    ic_p in varchar2*/
    detail_id_p in number
    IS
    SELECT
    /* HO1.OBJECT_NAME SCENARIO,
    HO2.OBJECT_NAME ACCOUNT,
    HO3.OBJECT_NAME ENTITY,
    HO4.OBJECT_NAME Month,
    HO5.OBJECT_NAME Version,
    HO6.OBJECT_NAME Currency,
    HO7.OBJECT_NAME Year,
    HO8.OBJECT_NAME Project,
    HO10.OBJECT_NAME CC,
    HO12.OBJECT_NAME Grplcl,
    HO13.OBJECT_NAME Product,
    HO15.OBJECT_NAME SalesRegion,
    HO16.OBJECT_NAME ContractAnalysis,
    HO17.OBJECT_NAME IC, */
    label,
    NVL(HCDI.VALUE,0) AMOUNT,
    HCDI.Position,
    HCDI.operator,
    HCDI.generation
    FROM /*hsp_column_detail HCD,*/
    hsp_column_detail_ITEM HCDI
    /* HSP_OBJECT HO1,
    HSP_OBJECT HO2,
    HSP_OBJECT HO3,
    HSP_OBJECT HO4,
    HSP_OBJECT HO5,
    HSP_OBJECT HO6,
    HSP_OBJECT HO7,
    HSP_OBJECT HO8,
    HSP_OBJECT HO10,
    HSP_OBJECT HO12,
    HSP_OBJECT HO13,
    HSP_OBJECT HO15,
    HSP_OBJECT HO16,
    HSP_OBJECT HO17*/
    --WHERE hcd.detail_id = hcdi.detail_id
    WHERE hcdi.detail_id = detail_id_p
    /*AND hcd.dim1 = ho1.object_id
    AND hcd.dim2 = ho2.object_id
    AND hcd.dim3 = ho3.object_id
    AND hcd.dim4 = ho4.object_id
    AND hcd.dim5 = ho5.object_id
    AND hcd.dim6 = ho6.object_id
    AND hcd.dim7 = ho7.object_id
    AND hcd.dim8 = ho8.object_id
    AND hcd.dim10 = ho10.object_id
    AND hcd.dim12 = ho12.object_id
    AND hcd.dim13 = ho13.object_id
    AND hcd.dim15 = ho15.object_id
    AND hcd.dim16 = ho16.object_id
    AND hcd.dim17 = ho17.object_id*/
    --and hcdi.generation != 0
    --and label like 'JRTEST-%'
    /*AND HCD.Dim1 = scenario_p
    AND HCD.Dim2 = account_p
    AND HCD.Dim3 = entity_p
    AND HCD.Dim4 = month_p
    AND HCD.Dim5 = version_p
    AND HCD.Dim6 = currency_p
    AND HCD.Dim7 = year_p
    AND HCD.Dim8 = project_p
    AND HCD.Dim10 = cc_p
    AND HCD.Dim12 = grplcl_p
    AND HCD.Dim13 = product_p
    AND HCD.Dim15 = salesregion_p
    AND HCD.Dim16 = contractanalysis_p
    AND HCD.Dim17 = ic_p*/
    ORDER BY hcdi.position;
    -- Variable Declaration
    running_total_ln number :=0;
    prev_running_total_ln number :=0;
    add_amount number :=0;
    multiply_amount number :=1;
    prev_generation number :=0;
    prev_add_amount number :=0;
    prev_multiply_amount number :=1;
    running_total_gen0 number :=0;
    running_gen0_op number :=0;
    running_total_gen1 number :=0;
    running_gen1_op number :=0;
    running_total_gen2 number :=0;
    running_gen2_op number :=0;
    running_total_gen3 number :=0;
    running_gen3_op number :=0;
    running_total_gen4 number :=0;
    running_gen4_op number :=0;
    running_total_gen5 number :=0;
    running_gen5_op number :=0;
    output_file utl_file.file_type;
    -- Begin PL/SQL processing
    BEGIN
    --DBMS_OUTPUT.
    DBMS_OUTPUT.ENABLE(1000000);
    DBMS_OUTPUT.PUT_LINE('Begin Processing');
    output_file := utl_file.fopen ('C:\temp', 'test.txt', 'W');
    -- Begin Header For Loop
    FOR BUDGET_HEADERS_CV IN BUDGET_HEADERS_CU
    LOOP
    --Reset Running Totals
    running_total_ln:=0;
    prev_running_total_ln:=0;
    add_amount:=0;
    multiply_amount:=1;
    prev_generation:=0;
    prev_add_amount:=0;
    prev_multiply_amount:=1;
    running_total_gen0:=0;
    running_gen0_op:=0;
    running_total_gen1:=0;
    running_gen1_op:=0;
    running_total_gen2:=0;
    running_gen2_op:=0;
    running_total_gen3:=0;
    running_gen3_op:=0;
    running_total_gen4:=0;
    running_gen4_op:=0;
    running_total_gen5:=0;
    running_gen5_op:=0;
    -- Begin Detail For Loop
    FOR BUDGET_DETAILS_CV IN BUDGET_DETAILS_CU(
    BUDGET_HEADERS_CV.Detail_ID
    /*BUDGET_HEADERS_CV.SCENARIO_ID,
    BUDGET_HEADERS_CV.ACCOUNT_ID,
    BUDGET_HEADERS_CV.ENTITY_ID,
    BUDGET_HEADERS_CV.Month_ID,
    BUDGET_HEADERS_CV.Version_ID,
    BUDGET_HEADERS_CV.Currency_ID,
    BUDGET_HEADERS_CV.Year_ID,
    BUDGET_HEADERS_CV.Project_ID,
    BUDGET_HEADERS_CV.CC_ID,
    BUDGET_HEADERS_CV.Grplcl_ID,
    BUDGET_HEADERS_CV.Product_ID,
    BUDGET_HEADERS_CV.SalesRegion_ID,
    BUDGET_HEADERS_CV.ContractAnalysis_ID,
    BUDGET_HEADERS_CV.IC_ID*/
    LOOP
    -- Null;
    add_amount :=0;
    multiply_amount :=1;
    IF BUDGET_DETAILS_CV.OPERATOR = 1 THEN
    add_amount := BUDGET_DETAILS_CV.Amount;
    End if;
    IF BUDGET_DETAILS_CV.OPERATOR = 2 THEN
    add_amount := BUDGET_DETAILS_CV.Amount * -1;
    End if;
    IF BUDGET_DETAILS_CV.OPERATOR = 3 THEN
    multiply_amount := BUDGET_DETAILS_CV.Amount;
    End if;
    IF BUDGET_DETAILS_CV.OPERATOR = 4 THEN
    multiply_amount := 1/BUDGET_DETAILS_CV.Amount;
    End if;
    IF BUDGET_DETAILS_CV.Position = 0 then
    running_total_gen0 := add_amount*multiply_amount;-- we are dealing with the first line
    Else
    if BUDGET_DETAILS_CV.GENERATION = prev_generation then
    -- run whatever total we are on up
    if BUDGET_DETAILS_CV.GENERATION = 0 then
    running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 1 then
    running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 2 then
    running_total_gen2 := (running_total_gen2 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 3 then
    running_total_gen3 := (running_total_gen3 + add_amount)*multiply_amount;
    end if;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = prev_generation +1 then
    -- we are going up a generation
    -- (we cannot go up to gen0
    if BUDGET_DETAILS_CV.GENERATION = 1 then
    running_total_gen1:=0;-- reset gen1 counter
    running_gen0_op:=BUDGET_DETAILS_CV.OPERATOR; -- Store the sign for later operation
    running_total_gen0 := running_total_gen0/prev_multiply_amount - prev_add_amount; -- Remove parent from Gen 0 total
    running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 2 then
    running_total_gen2:=0;-- reset gen1 counter
    running_gen1_op:=BUDGET_DETAILS_CV.OPERATOR; -- Store the sign for later operation
    running_total_gen1 := running_total_gen1/prev_multiply_amount - prev_add_amount; -- Remove parent from Gen 1 total
    running_total_gen2 := (running_total_gen2 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 3 then
    running_total_gen3:=0;-- reset gen1 counter
    running_gen2_op:=BUDGET_DETAILS_CV.OPERATOR; -- Store the sign for later operation
    running_total_gen2 := running_total_gen2/prev_multiply_amount - prev_add_amount; -- Remove parent from Gen 2 total
    running_total_gen3 := (running_total_gen3 + add_amount)*multiply_amount;
    end if;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = prev_generation - 1 then
    -- we are Down a generation
    if BUDGET_DETAILS_CV.GENERATION = 0 then
    --we need to "add" back the previous gen 1 parent
    IF running_gen0_op = 1 THEN
    running_total_gen0 := running_total_gen0 + running_total_gen1;
    End if;
    IF running_gen0_op = 2 THEN
    running_total_gen0 := running_total_gen0 - running_total_gen1;
    End if;
    IF running_gen0_op = 3 THEN
    running_total_gen0 := running_total_gen0 * running_total_gen1;
    End if;
    IF running_gen0_op = 4 THEN
    running_total_gen0 := running_total_gen0 / running_total_gen1;
    End if;
    -- we need to add the current member to the gen0
    running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
    END IF;
    if BUDGET_DETAILS_CV.GENERATION = 1 then
    --we need to "add" back the previous gen 2 parent
    IF running_gen1_op = 1 THEN
    running_total_gen1 := running_total_gen1 + running_total_gen2;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen1 := running_total_gen1 - running_total_gen2;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen1 := running_total_gen1 * running_total_gen2;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen1 := running_total_gen1 / running_total_gen2;
    End if;
    -- we need to add the current member to the gen1
    running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 2 then
    --we need to "add" back the previous gen 3 parent
    IF running_gen1_op = 1 THEN
    running_total_gen2 := running_total_gen2 + running_total_gen3;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen2 := running_total_gen2 - running_total_gen3;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen2 := running_total_gen2 * running_total_gen3;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen2 := running_total_gen2 / running_total_gen3;
    End if;
    -- we need to add the current member to the gen2
    running_total_gen2 := (running_total_gen2 + add_amount)*multiply_amount;
    end if;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = prev_generation - 2 then
    -- we are Down 2 generations
    if BUDGET_DETAILS_CV.GENERATION = 0 then
    --we need to "add" back the previous gen 2 parent
    IF running_gen1_op = 1 THEN
    running_total_gen1 := running_total_gen1 + running_total_gen2;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen1 := running_total_gen1 - running_total_gen2;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen1 := running_total_gen1 * running_total_gen2;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen1 := running_total_gen1 / running_total_gen2;
    End if;
    --we need to "add" back the previous gen 1 parent
    IF running_gen0_op = 1 THEN
    running_total_gen0 := running_total_gen0 + running_total_gen1;
    End if;
    IF running_gen0_op = 2 THEN
    running_total_gen0 := running_total_gen0 - running_total_gen1;
    End if;
    IF running_gen0_op = 3 THEN
    running_total_gen0 := running_total_gen0 * running_total_gen1;
    End if;
    IF running_gen0_op = 4 THEN
    running_total_gen0 := running_total_gen0 / running_total_gen1;
    End if;
    -- we need to add the current member to the gen0
    running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
    END IF;
    if BUDGET_DETAILS_CV.GENERATION = 1 then
    --we need to "add" back the previous gen 3 parent
    IF running_gen1_op = 1 THEN
    running_total_gen2 := running_total_gen2 + running_total_gen3;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen2 := running_total_gen2 - running_total_gen3;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen2 := running_total_gen2 * running_total_gen3;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen2 := running_total_gen2 / running_total_gen3;
    End if;
    --we need to "add" back the previous gen 2 parent
    IF running_gen1_op = 1 THEN
    running_total_gen1 := running_total_gen1 + running_total_gen2;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen1 := running_total_gen1 - running_total_gen2;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen1 := running_total_gen1 * running_total_gen2;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen1 := running_total_gen1 / running_total_gen2;
    End if;
    -- we need to add the current member to the gen1
    running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
    END IF;
    if BUDGET_DETAILS_CV.GENERATION = prev_generation - 3 then
    -- we are Down 3 generations
    if BUDGET_DETAILS_CV.GENERATION = 0 then
    --we need to "add" back the previous gen 3 parent
    IF running_gen1_op = 1 THEN
    running_total_gen2 := running_total_gen2 + running_total_gen3;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen2 := running_total_gen2 - running_total_gen3;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen2 := running_total_gen2 * running_total_gen3;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen2 := running_total_gen2 / running_total_gen3;
    End if;
    --we need to "add" back the previous gen 2 parent
    IF running_gen1_op = 1 THEN
    running_total_gen1 := running_total_gen1 + running_total_gen2;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen1 := running_total_gen1 - running_total_gen2;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen1 := running_total_gen1 * running_total_gen2;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen1 := running_total_gen1 / running_total_gen2;
    End if;
    --we need to "add" back the previous gen 1 parent
    IF running_gen0_op = 1 THEN
    running_total_gen0 := running_total_gen0 + running_total_gen1;
    End if;
    IF running_gen0_op = 2 THEN
    running_total_gen0 := running_total_gen0 - running_total_gen1;
    End if;
    IF running_gen0_op = 3 THEN
    running_total_gen0 := running_total_gen0 * running_total_gen1;
    End if;
    IF running_gen0_op = 4 THEN
    running_total_gen0 := running_total_gen0 / running_total_gen1;
    End if;
    -- we need to add the current member to the gen0
    running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
    END IF;
    end if;
    END IF;
    End IF;
    END LOOP; -- End of Detail Loop
    --DBMS_OUTPUT.PUT_LINE(BUDGET_HEADERS_CV.SCENARIO||';'||BUDGET_HEADERS_CV.ACCOUNT||';'||BUDGET_HEADERS_CV.ENTITY||';'||BUDGET_HEADERS_CV.Month||';'||BUDGET_HEADERS_CV.Version||';'||BUDGET_HEADERS_CV.Currency||';'||BUDGET_HEADERS_CV.Year||';'||BUDGET_HEADERS_CV.Project||';'||BUDGET_HEADERS_CV.CC||';'||BUDGET_HEADERS_CV.Grplcl||';'||BUDGET_HEADERS_CV.Product||';'||BUDGET_HEADERS_CV.SalesRegion||';'||BUDGET_HEADERS_CV.ContractAnalysis||';'||BUDGET_HEADERS_CV.IC||';'||running_total_gen0);
    utl_file.put_line(output_file,BUDGET_HEADERS_CV.SCENARIO||';'||BUDGET_HEADERS_CV.ACCOUNT||';'||BUDGET_HEADERS_CV.ENTITY||';'||BUDGET_HEADERS_CV.Month||';'||BUDGET_HEADERS_CV.Version||';'||BUDGET_HEADERS_CV.Currency||';'||BUDGET_HEADERS_CV.Year||';'||BUDGET_HEADERS_CV.Project||';'||BUDGET_HEADERS_CV.CC||';'||BUDGET_HEADERS_CV.Grplcl||';'||BUDGET_HEADERS_CV.Product||';'||BUDGET_HEADERS_CV.SalesRegion||';'||BUDGET_HEADERS_CV.ContractAnalysis||';'||BUDGET_HEADERS_CV.IC||';'||running_total_gen0);
    /*BUDGET_HEADERS_CV.SCENARIO, BUDGET_HEADERS_CV.ACCOUNT, BUDGET_HEADERS_CV.ENTITY, BUDGET_HEADERS_CV.Month, BUDGET_HEADERS_CV.Version,BUDGET_HEADERS_CV.Currency, BUDGET_HEADERS_CV.Year, BUDGET_HEADERS_CV.Project, BUDGET_HEADERS_CV.CC, BUDGET_HEADERS_CV.Grplcl, BUDGET_HEADERS_CV.Product, BUDGET_HEADERS_CV.SalesRegion, BUDGET_HEADERS_CV.ContractAnalysis, BUDGET_HEADERS_CV.IC */
    END LOOP; -- End of Header Loop
    --DBMS_OUTPUT.PUT_LINE('Total');
    -- DBMS_OUTPUT.PUT_LINE('End Processing');
    utl_file.fclose(output_file);
    END;
    Edited by: JeremieR on Apr 18, 2011 5:02 AM

  • I was trying to add an itunes library to my computer, and now my itunes library can not be found. An ipod can be synced with only one iTunes library at a time. How can I find my Itunes library, complete with playlists ?

    I was trying to add an itunes library to my computer, and now my itunes library can not be found. An ipod can be synced with only one iTunes library at a time. How can I find my Itunes library, complete with playlists ?

    I have the same problem too and tried alot of things like time zone , restarting or changing DNS of wifi connection to 8.8.8.8 still nothing happens .. !!
    iPhone 5s, iOS 8.3

  • HT204088 How how can I synch my ipod + iphone music to my new computer? I get the same error  "my ipod or iphone is synched with another itunes library.An Ipod can be synched with only one itunes library at a time. What would I like to do Erase and Synch

    How can I synch my ipod & iphone music (purchased from itunes on my old laptop) to my new laptop? I keep getting the same message on my itunes on my new laptop: " The ipod/Iphone is synched with another itunes library. An ipod/iphone can be synched with only one itunes library at a time. What would you like to do - Erase and Synch or Transfer Purchases?" What do I do?
    A couple of other items:
    1) I am guessing Apple does not keep a history of all my music purchases? As I did not have my entire library backed-up anywhere, and relying on the music I have on my ipod and my iphone as my only source of itunes music....I have lost over 500 songs!!!
    2) I used to have an Apple account under another account name, and since have switched to a new account name. Is there anyway to find the history of purchases from my old Apple account name and transfer these over to my new account name and onto my new laptop?
    I hope someone can help, I am having a very difficult time trying to obtain answers. Angie

    The iphone/ipod is NOT a storage/backup device.  Not maintaining a backup copy is a big mistake.
    You can transfer itunes purchases from your iphone/ipod to your computer:
    Authorize your computer for all accounts and then click  File>Transfer Purchases

  • How to connect many devices with only one FW800 port in iMac?

    Hi,
    I am upgrading to a new Intel iMac from a 2004 vintage Dual2.0GHz PowerMac. I currently have 8x d2 Quadra drives chained by FW800, and 2x Iomega drives connected vis FW400 hub which also connects HD cams.
    My questions is that with only one FW800 port in iMac, I think my devices connectivity is the following?
    (1) Get a FW 800 hub (I can only find 2 port ones at the Apple store and BestBuy)
    (2) Connect the d2 Quadras to one port of the FW800 hub
    (3) Get a FW 800 to FW 400 cable
    (4) Connect my 6 port FW400 hub to the 2nd port of the FW800 hub
    Thanks for reviewing this solution, and I would also appreciate other suggestions or hear about your experiences if you have a similar set-up.
    Will

    In addition to your listed considerations, you should consider the following.
    Many storage needs do not required FireWire 800 speed. For example, USB 2.0 works fine for your Time Machine backup drive. If you are just storing user data such as your iPhoto or iTunes media files, USB 2.0 is more than fast enough. So, as much as possible, if any of those external drives have USB 2.0 connections and the data storage does not need FireWire 800 speed, offload as much as possible to USB 2.0. I used to be a +FireWire snob+, but since getting an Intel iMac, I find that USB 2.0 works quite well for most data storage purposes.
    There are new hard drives that are power efficient and as large as 2TB. Consolidate your data storage needs onto a smaller number of very large drives, partitioned as needed. This will make your setup more reliable (smaller number drives), and save reduce power consumption. If any of your current externals are SATA, you can probably replace the existing drive with an extra large one.
    So, I think you setup should be, extra large FireWire 800 drive connected to the FireWire 800 port directly. Using a 9-pin to 6-pin cable, connect the FireWire 400 hub. Connect any non-storage FireWire 400 devices there. Do some data transfer testing to make sure having the 400 hub there on the chain does not cause the 800 connection to slow down.
    Connect other drives as needed using USB 2.0, existing or new. Retire the smaller of your external drives.

  • HT4527 an iphone can be synced with only one itunes library at a time error on same pc

    an iphone can be synced with only one itunes library at a time error on same pc why?

    Damaged library... See Empty/corrupt library after upgrade/crash.
    tt2

  • An iPhone can be synced with only one iTunes library at a time

    I recently bought a MacBook Pro, and I figured it would be pretty simple to move my iPhone to sync with iTunes on the Mac from iTunes on my pc, afterall it is the same program and both are designed for the iPhone.
    I have been successful in getting the Contacts and Calendar to sync, but the Music, Applications, Video and a few other things give me this message when I check the sync box:
    "The iPhone is synced with another iTunes library. Do you want to erase the iPhone and sync with this iTunes library? An iPhone can be synced with only one iTunes library at a time. Erasing and syncing replaces the contents of this iPhone with the contents of this iTunes library."
    Obviously, I don't want to erase everything. Actually, I don't care about Music, Videos, Podcasts or Ringtones as I don't have any, but I do care about Photos and Applications. Actually Photos I can reload too, but I don't want to loose the apps I have purchased with the iTunes App Store.
    I even tried going back to the PC and unchecking the Sync boxes on it, hoping this might disassociate it from the phone, but now even on that PC I get the same message.
    How do I disconnect phone from the old iTunes and be able to sync it to the new iTunes? This should be simple right?

    I made an appointment with a Mac Genius and I will say that while it was better than getting to talk to India on a poor quality phone call it was just about as helpful. Sure she was cute and friendly, but I left without my issue resolved and was surprised that I didn't even get a followup from anyone asking about my experience (hence my venting here)
    Anyway, I found a solution for my issue here: http://tinyfish.net/2008/07/18/how-to-sync-iphone-with-multiple-computers/
    This is a real solution to the issue, and has the benefit that I can do this to as many machines as I need and sync at any of them instead of just one. Hopefully, Apple doesn't delete my response since it truly is the answer to the problem and others might be looking for the same solution.

  • I got a new pc and I am getting this message: The ipod 'harms ipod' is synced with another itunes library  Do you want to erace this Ipod and synce with this itunes library?  An Ipod can only be synced with only one itunes library at a time.  Erasing and

    The ipod 'harms ipod' is synced with another itunes library.Do you want to erase this ipod and sync with this itunes library?  An ipod can be synced with only one itunes library at a time.  Erasing and syncing replace the contents of this ipod with the contents of this itunes library.
    I don't know what to do?  I should save my library before I replace the contents, but I don't know how to do that! HELP!!

    See this older post from another forum member Zevoneer covering the different methods and software available to assist you with the task of copying content from your iPod back to your PC and into iTunes.
    https://discussions.apple.com/thread/2452022?start=0&tstart=0
    B-rock

  • I bought a MAC for the first time and plugged my Itouch into it to download my music on it, but is says The iPod "Rick's IPOD" is synced with another iTunes library. An iPod can be synced with only one iTunes library at a time. What should I do?

    I bought a MAC for the first time and plugged my Itouch into it to download my music on it, but is says The iPod “Rick's IPOD” is synced with another iTunes library. An iPod can be synced with only one iTunes library at a time. What should I do?

    Same as you would if you bought a pc; copy everything from your old computer to your new one.  Then you can just sync everything from the new computer, as you did with the old one.

  • I formatted and re-installed itunes. now it flashing massage that my ´ipod is synced with another iTunes library. An ipod can be synced with only one library at a time.´ now it is giving 2 options,  1- erase and sync, 2- transfer purchases. what to do?

    i formatted and re-installed itunes. now it flashing massage that my ´ipod is synced with another iTunes library. An ipod can be synced with only one library at a time.´ now it is giving 2 options,  1- erase and sync, 2- transfer purchases. what to do?

    Follow these instructions:
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities

  • I want to make a video clip using two still pictures, placing side by side.  I am able to make with only one at a time.

    I want to make a video clip using two still pictures, placing side by side.  I am able to make with only one at a time.  Also, I am able to move the picture using Transform.  But unsuccessfull in making with two stills in same clip.  Thank you for reply.

    If you want a Picture in Picture effect, stack one still on top of the other with a connect edit. Use Transform to scale and reposition the top image.
    Russ

  • Can I run the new Mac pro (6.1) with only one stick of ram?

    Will that cause any problems. And if not how much will the overall quality be affected. it won't be a permanent solution, but for a few weeks at least. So can it happen? Can I run the Mac pro 2013 with only one memory stick?

    Per this
    http://blog.macsales.com/22745-mix-and-match-more-memory-faster-mac-pro-2
    the 2013 Mac Pro is the only MP that can use a single stick of memory.

Maybe you are looking for

  • Unable to see the email attachments in IC Agent Inbox

    Hi All, we are running on crm7.1, i have configured agent inbox and the email functionality is working fine, we used ERMS in our scenario to route the emails to specific agents. Issue is that: the emails are visible and availble to the agents but we

  • Unable to Define New Plant

    Hi, I need help regarding creating New Plant. I used the following steps IMG> Enterprise Structure> Defiintion> Logistics Genral> Define, Copy, Delete, Check Plant 1.   Execute 2.   (Double Click) Define Plant 3.   New Entries 4.   Give Plant Name 5.

  • ITunes not playing songs correctly!!!! PLEASE HELP

    Very recently, iTunes decides to turn evil on me by making all the songs I play on there scratchy and un-listenable. While I can still use my other media players such as winamp, the music runs fine, but when I play it on iTunes its still scratchy. Pl

  • PHP Form Redirect without Header function

    I need help with a PHP form that needs to redirect to a thankyou page upon sending. I have tried the header function but it doesnt work because i have multiple PHP references throughout the page that prevent the header function from working. Is there

  • Images with Crystal Reports

    Somebody pls. advise if it's possible to display images with Crystal Reports ?! I want to generate a Price Catalog with images.   I have uploaded images into the system. Unfortunately, Oracle Report Builder has let me down. A short tutorial on how to