SCCM Query to Find Registry Key Value That is IP Address
I am try to create a collection that will show all computers with the following registry value:
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\SNMP\Parameters\TrapConfiguration\mesnet]
"1"="10.213.11.221"
Does anyone know how to create the query? Ive already updated the mof files on SCCM. Thanks.
This is what I entered in the Config.mof file:
// RegKeyToMOF by Mark Cochrane (thanks to Skissinger, Steverac, Jonas Hettich & Kent Agerlund)
// this section tells the inventory agent what to collect
// 9/25/2012 9:20:39 AM
#pragma namespace ("\\\\.\\root\\cimv2")
#pragma deleteclass("mesnet", NOFAIL)
[DYNPROPS]
Class mesnet
[key] string KeyName;
String 1;
[DYNPROPS]
Instance of mesnet
KeyName="RegKeyToMOF_32";
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\services\\SNMP\\Parameters\\TrapConfiguration\\mesnet|1"),Dynamic,Provider("RegPropProv")] 1;
#pragma namespace ("\\\\.\\root\\cimv2")
#pragma deleteclass("mesnet_64", NOFAIL)
[DYNPROPS]
Class mesnet_64
[key] string KeyName;
String 1;
[DYNPROPS]
Instance of mesnet_64
KeyName="RegKeyToMOF_64";
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\services\\SNMP\\Parameters\\TrapConfiguration\\mesnet|1"),Dynamic,Provider("RegPropProv")] 1;
This is what I added to the sms_def.mof file:
// RegKeyToMOF by Mark Cochrane (thanks to Skissinger, Steverac, Jonas Hettich & Kent Agerlund)
// this section tells the inventory agent what to report to the server
// 9/25/2012 9:20:39 AM
#pragma namespace ("\\\\.\\root\\cimv2\\SMS")
#pragma deleteclass("mesnet", NOFAIL)
[SMS_Report(TRUE),SMS_Group_Name("mesnet"),SMS_Class_ID("Custom|mesnet|1.0"),
SMS_Context_1("__ProviderArchitecture=32|uint32"),
SMS_Context_2("__RequiredArchitecture=true|boolean")]
Class mesnet: SMS_Class_Template
[SMS_Report(TRUE),key] string KeyName;
[SMS_Report(TRUE)] String 1;
#pragma namespace ("\\\\.\\root\\cimv2\\SMS")
#pragma deleteclass("mesnet_64", NOFAIL)
[SMS_Report(TRUE),SMS_Group_Name("mesnet"),SMS_Class_ID("Custom|mesnet|1.0"),
SMS_Context_1("__ProviderArchitecture=64|uint32"),
SMS_Context_2("__RequiredArchitecture=true|boolean")]
Class mesnet_64 : SMS_Class_Template
[SMS_Report(TRUE),key] string KeyName;
[SMS_Report(TRUE)] String 1;
I'd like to gather a report on computers that do not have this setting. Once I identify those computers that need this config, i plan on pushing out a package so that they are properly configured.
Similar Messages
-
VB Script to accept PC names in text file and get registry key value out of those systems
Hi All,
My task: Create VB script to accept PC names from a text file, process each host name to get Registry key value of individual host name and finally export them to a text file or an excel sheet having registry key value against each pc.
I want to pull key value of LSFORCEHOST located in HKCU/Environment of each PC and export this value against each pc in a text or Excel file.
What I achieved: I am able to process against single pc name but failed to process 3000+ systems listed in a text file which I tried to process through VB script. I am not pro and learning the VBS and cant write complex code.
My VBS code written so far(It failed many time with issue):
Option Explicit
Const HKEY_CURRENT_USER = &H80000001
Dim oFSO, sFile, oFile, sText, strComputer,oReg, strKeyPath, strValueName, strValue, objFSO, objFile, strContents
Set oFSO = CreateObject("Scripting.FileSystemObject")
sFile = "test.txt"
If oFSO.FileExists(sFile) Then
Set oFile = oFSO.OpenTextFile(sFile, 1)
Do While Not oFile.AtEndOfStream
sText = oFile.ReadLine
If Trim(sText) <> "" Then
strComputer = sText
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "Environment"
strValueName = "LSFORCEHOST"
oReg.GetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\destination.txt",1, ForReading)
strContents = strValue
Set objFile = objFSO.OpenTextFile("C:\destination.txt",2, ForWriting)
objFile.Write strContents
objFile.Close
End If
Loop
oFile.Close
End If
I think when I tried to process each PC name from text file against registry key value, above code not working. As per my knowledge some issue in loop. Do I need to add FOR EACH feature?
Please help to correct it. Thanks in advance.I think when I tried to process each PC name from text file against registry key value, above code not working. As per my knowledge some issue in loop. Do I need to add FOR EACH feature?
Please help to correct it. Thanks in advance.
Your code contains numerous errors. Furthermore you make things difficult for yourself by giving similar names to the objects used for your input and output. If you are a systems administrator then your best bet is to make an effort to learn the language
instead of grabbing a few code fragments from here and there and hoping that somehow they will work.
Try the cleaned up code below for this particular project. Note the consistent code indentation. It helps you enormously when trying to understand the structure of the code. Remember also that you must fully qualify all file paths. Writing to "Destination.txt"
will cause endless confusion because you never know for sure where this file will reside.
Const HKEY_CURRENT_USER = &H80000001
Set oFSO = CreateObject("Scripting.FileSystemObject")
sKeyPath = "Environment"
sValueName = "LSFORCEHOST"
sFile = "D:\Test.txt"
If oFSO.FileExists(sFile) Then
Set oInput = oFSO.OpenTextFile(sFile, 1)
Do While Not oInput.AtEndOfStream
sComputer = oInput.ReadLine
If Trim(sComputer) <> "" Then
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
& sComputer & "\root\default:StdRegProv")
oReg.GetStringValue HKEY_CURRENT_USER,sKeyPath,sValueName,sValue
Set oOutput = oFSO.OpenTextFile("D:\destination.txt",8, True)
oOutput.WriteLine sValue
oOutput.Close
End If
Loop
oInput.Close
End If -
How to deselect query property 'suppress repeated key values'
hj gurus,
In BEx analyser there is a query property 'suppress repeated key values' which can be de-selected.
regards,
PreetyHello preety.
Is simple.
In BEx query designer push the button designated by "query properties" (the 13 button from left to right).
Go to the tab "Display" and mark the second option "Hide Repeated Key Values"
And there you go.
Please assign points.
Diogo. -
SCCM query to find last logon server info
dear
all
could u please share an sccm query to find all client logon server ie mean we get once set L command is put
ankithhi
I Have the same query added logon server
SELECT
v_GS_SYSTEM.Name0
AS ComputerName,
v_GS_NETWORK_LOGIN_PROFILE.TimeStamp
AS [Last Login Time],
v_GS_NETWORK_LOGIN_PROFILE
.Name0
AS [Logon User],
v_GS_SYSTEM.Domain0
AS [Logon Domain],
v_GS_SYSTEM.SystemRole0
AS [System Role],
v_GS_SYSTEM
.SystemType0
AS [System Type],
v_GS_NETWORK_LOGIN_PROFILE.LogonServer0
FROM
v_GS_NETWORK_LOGIN_PROFILE
LEFT
OUTER
JOIN
v_GS_SYSTEM
ON v_GS_NETWORK_LOGIN_PROFILE.ResourceID
= v_GS_SYSTEM.ResourceID
WHERE
(v_GS_NETWORK_LOGIN_PROFILE.LastLogon0
IS
NOT
NULL)
once query executed iam getting in output
ankith -
How to find Assertion key value?
Hi,
I am referring MSDN article for Management Libraries for .NET to access my Azure AD account.
I followed all steps from article, but when my application execution starts it gives an error
"An unhandled exception of type 'Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException' occurred in Microsoft.IdentityModel.Clients.ActiveDirectory.dll
Additional information: AADSTS90014: The request body must contain the following parameter: 'client_secret or client_assertion'."
c# block where I caught in error--
AuthenticationResult result = context.AcquireToken(
ConfigurationManager.AppSettings["apiEndpoint"],
ConfigurationManager.AppSettings["clientId"],
new Uri(ConfigurationManager.AppSettings["redirectUri"]));
my context variable as below
var context = new AuthenticationContext(string.Format(
ConfigurationManager.AppSettings["login"],
ConfigurationManager.AppSettings["tenantId"]));
and when I am trying to add client_secrete key to code
AuthenticationResult result = context.AcquireToken(
ConfigurationManager.AppSettings["apiEndpoint"],
new ClientCredential("*******", "******"),
new UserAssertion("*****", "client_credentials", "*****"));
throws an error
An unhandled exception of type 'Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException' occurred in Microsoft.IdentityModel.Clients.ActiveDirectory.dll
Additional information: AADSTS50027: Invalid JWT token. AADSTS50027: Invalid JWT token. Token format not valid.
please tell me proper solution where I making mistake and also help to find Assertion key value for application which are added on Azure AD portal.
thanks,
Yogesh
Hello Yogesh,
Since this issue is related with window azure AD, i move it to the azure ad forum, there are AD experts who will hlep you. The current forum you posted to is used to discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O,
Regigistry, Globalization, Reflection.
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Hi ALL,
i have read some parameters like NumMinutesBeforeCheckingLRU, NumCubesLoadedBeforeCheckingLRU etc and found related description in turning guide , but i want more further information about these parameter. Is there any way i can get it?
p.s. I checked Financial Management Guide , but found nothing.
Any help will be appreciated.
Regards,
ChelseaWelcome to my world of pain as well..... I've put together an information listing of registry values that are queried by HFM while running. I found most of these first by run a registry sniffer on the HFM process to see what it was looking for in the registry. After I found the registry keys, I did some google / oracle search and starting filling in some answers. It seems that some of these keys are not really used anymore even though the program is querying the registry for them.
In addition to the list below, I would recommend finding a document called : Hyperion System 9 Financial Management Subcube Architecture as it explains some of these registry settings, etc.
Anyway, here's the list I've found so far : (I apologize for the poor formatting here; however, it is neat in my excel file ......)
Key Tree Key Name Key Type Min Value Max Value Default Value Unit of Measure Description
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server\Running Tasks AutoClearDeadTasksAfterSeconds REG_SZ 720 864,000 Seconds Number of seconds to retain a completed task in the running tasks list
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server\Running Tasks MaxNumConcurrentConsolidations REG_SZ 1 8 Consolidations Controls the nubmer of concurrent consolidations allowed per application server. Any consolidations executed above the value are queued as Scheduled Consolidations.
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server\Running Tasks NumConsolidationThreads REG_SZ 1 8 Threads Controsl the multi-threading of consolidatiosn per application server. Lowering the value limits the system's utilization of system resources, resulting in slower consolidation performance.
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server\Running Tasks NumConsolidationsAllowed REG_SZ 1 20 8 Consolidations Controls the number of conslidations allower per application across all the application servers.
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server\Running Tasks NumDataLoadsAllowed REG_SZ 1 20 8 Loads Controls the number of data loads allowed per application across all the application servers.
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server\Running Tasks NumEAExportsAllowed REG_SZ 1 20 8 EA Exports Controls the number of Extended Analytic exports allower per application across all the application servers.
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Client\Clusters\machinename UseStickyServer REG_DWORD 0 1 1 True/False Set to 1 to enable Stick Server, 0 to disable. This is set on the CLIENT machine
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server EACommandTimeout REG_DWORD 0 65535 0 Seconds The number of seconds that must elapse before a SQL query is determined to be deadlocked. Specify a value from 0 to 65535. Note 0 = no timeout.
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server NumEAThreads REG_DWORD 1 32 8 Threads The number of theads used during processing of data.
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server EAIgnoreInvalidmemberIDs REG_DWORD 0 1 0 Boolean Determines whether to fail if an invalid dimension member ID is encountered. Specify 1 to ignore invalid IDs. Specify 0 to have the system fail if an invalid ID is encountered.
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server EAUseSQLbinding REG_DWORD 0 1 1 Boolean Determine whether to use SQL binding. Specify 1 to use SQL binding or 0 to disable SQL binding.
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server ConnectionPoolingTrace REG_DWORD 0 1 0 Boolean Determines whether to trace connection pool activity to log. Specifiy 1 to trace or 0 to disable trace.
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server EATraceADOErrors REG_DWORD 0 1 0 Boolean Determines whether to trace ActiveX Data Object (AdO) activity to log. Specify 1 to trace or 0 to disable trace. This setting is not applicable to ODBC.
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server EAuseODBC REG_DWORD 0 1 1 Boolean Determines whether to use ODBC to interact with external data store. Specify 1 to use ODBC or specify 0 to use ADO.
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server EALogEntirePOV REG_DWORD 0 1 0 Boolean Determines whether to log the pov being captured in the Extended Analytics dump to the log file ( in the temp directory). Specify 1 to log the POV or 0 to disable the logging.
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server NumMinutesBeforeCheckingLRU REG_DWORD 1 240 15 Minutes Used in determining RAM utilization check
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server NumCubesLoadedBeforeCheckingLRU REG_DWORD 5 100000 500 Cubes Used in determining RAM utilization check
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server MaxNumCubesInRAM REG_DWORD 10,000 Cubes
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server MaxNumDataRecordsInRAM REG_DWORD 5,000 2000000 1000000 Records
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server PercentDataRecordsToFree REG_DWORD 20 100 50 Percent
HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Server AgeOfCubesToFreeInMinutesWhenLRUIsCalled REG_DWORD 0 1000000 15 Minutes -
SCCM 2012 Installation Directory Registry Key chaning automatically to Old Installation Path
Hi Guys,
I have recently recovered SCCM 2012 SP1 CAS Site from Primary Site by reinstalling CAS site and database was replicating with Primary sites properly after CAS recovery. But we noticed that after approx. 2 hours of CAS site recovery database replication stopped.
After long digging into SCCM log files we found that SCCM installation directory was pointing to old CAS Site Installation Directory (Which was before recovery) instead of NEW Installation Directory so we changed SCCM CAS Site Installation Directory manually
to new installation path in below registry key and everything was running fine again on CAS Site.
HKEY_LOCAL_MACHINE\Software\Microsoft\SMS\Identification
But again when we restarted SMS_EXEUTIVE Service, SCCM Installation Directory again changed to old installation patch under above registry location and all is bad again. We are unable to figure out what is causing this and even we formatted our HDD before
installation CAS Site.
Can anyone please help to get rid of this issue. Our while CAS site is down due to this issue.
Thanks.I think that you have to use the same installation directory in a site recovery scenario.
Torsten Meringer | http://www.mssccmfaq.de -
OLAP universe query filters using multiple key values
Hi,
We are running BO over a MSAS 2005 cube and due to reporting requirements we have had to split the year out from the standard time hierarchy so we have it as a separate hierarchy from the rest of the time hierarchy. We also have 2 other dimension objects we use to find the current reporting month (shown below as Current Month and Current Year) which link to the Year and Month dimensions to give us the current year and current month.
I have created predefined filters in the universe for Last Month and Last 6 Months etc which link the 2 hierarchies together to dynamically find the correct months to pull out based on the current reporting month.
The issue i am facing is that when these filters are used in reports we are not able to pull through the Year dimension in the report as we receive the error: "The Year Hierarchy hierarchy is used more than once in the Crossjoin function"
We can however use the Month dimension in reports even though it is also referenced in the filter definition.
I have narrowed the issue down to the fact the Month dimension is mentioned in the Filter Key which allows it to be used in the reports.
Is it possible to include 2 key values or are there any other ideas on how to tackle this problem so i can include the both the year and month in reports using these filters?
Last Month filter:
<FILTER KEY="@Select(Period To Date\Month).[TECH_NAME]"><CONDITION OPERATORCONDITION="InList"><CONSTANT TECH_NAME="CASE WHEN FILTER(@Select(Period To Date\Month).Members,@Select(Period To Date\Current Month).[Y]).Item(0)= @Select(Period To Date\Month).[January] THEN {CrossJoin(FILTER(@Select(Period To Date\Month).Members,@Select(Period To Date\Current Month).[Y]).Item(0).lead(11),FILTER(@Select(Period To Date\Year).Members,@Select(Period To Date\Current Year).[Y]).Item(0).lag(1))} ELSE CrossJoin(FILTER(@Select(Period To Date\Month).Members,@Select(Period To Date\Current Month).[Y]).Item(0).lag(1),FILTER(@Select(Period To Date\Year).Members,@Select(Period To Date\Current Year).[Y]).Item(0)) END"></CONSTANT></CONDITION></FILTER>
Thanks in advanceDear Daniel, may I ask one more question please?
what if I have 4 tables?
table1
ID * ID_Type_code * Name
0001 * 11 * abc
0002 * 12 * abcd
0003 * 13 * abcde
table2
ID * OID_type_code * Name
0001 * 22 * abc
0002 * 23 * abcd
0002 * 25 * abcd
0003 * 23 * abcde
0003 * 22 * abcde
0003 * 28 * abcde
table3
ID * OID_type_code * OGAD_line_id * address
0001 * 22 * 1 * a street
0001 * 22 * 2 * b street
0002 * 23 * 1 * c street
0002 * 25 * 1 * d street
0003 * 28 * 1 * e street
0003 * 28 * 2 * f street
0003 * 28 * 3 * g street
table 4
ID OID_type_codeOGAD_line_id*COP_line_id*phone number
0001*22*1*1*2222222222
0001*22*1*2*3333333333
0002*23*1*1*4444444444
0003*28*2*1*5555555555
0003*28*2*2*6666666666
Primary key for each table
table1, primary key is ID
table2, primary key is ID , OID_type_code
table3, primary key is ID , OID_type_code, OGAD_line_id
table4, primary key is ID , OID_type_code, OGAD_line_id , COP_line_id
I would like to show each value in each table in the separate input text fields.
Therefore, this is an advanced question based on the previous one, not only get values from one table but also from several tables based on input for example 0003 and 28 as the ID and OID_type_code?.
Let me know if you need more details,
Thank you so much,
Viola -
Query for specific registry key
hi all,
could someone,help me on how to query sms DB about specific registry key.
i need to create collection based on this query:
all machines that have on the HKLM\software\microsoft\sms\mobile client\software distribution\execution history\system
path a specific package ID entry.Look at Program Rerun behavior setting on an advertisement
http://technet.microsoft.com/en-ca/library/bb694016.aspx
Program rerun behavior
Specifies whether the advertised program will be rerun on the client computer if it has previously been run before the scheduled mandatory time.
Always rerun program: The program will always be rerun on the client when the advertisement is scheduled, even if the program has already
been successfully run. This is particularly useful when using recurring advertisements in which the program is routinely updated, as with some virus detection software.
http://www.enhansoft.com/ -
Query Designer - Hide Repeated Key Values - Doesn't work in the web
Hello Experts,
I'm facing a problem with a query. The user requested that he/she wants to see all the values of the key values.
I already unchecked the option "Hide repeated key values" in query designer, but it still hiding it. I tested in BEx and it's working fine, but when I run it in the web the key values are being hidden.
Anyone knows what is happening? I'm not using WAD and there is no possibility to use it.
Thanks,
HelderHi,
I have seen this problem - setting that option still does not show the repeated key values in web. You will indeed need to use WAD and uncheck that option in the properties of the analysis item. If you can't do that, the other option would be to do this change in the default web template (which is generally 0Analysis_pattern for BI WAD) but note that this will affect all queries.
Also, please note that if the query is exported to excel, it will show the repeated values. This is the reason sometimes the users ask for key values to be repeated - maybe you would want to confirm that. -
Query to find the class name that has the maximum number of students ?
I need the query to find the [class Name] which has the most number of students. please look below at the tables
Students Table
StudentId StudentName ClassID
1 xxx 1
2 yyy 1
3 zzz 1
4 fff 2
5 ttt 2
Classes Table
ClassID ClassNane
1 CSHARP
2 JSHARP
The result should be : CSHARP
since there are 3 students in CSHARP and 2 students in JSHARP class
Appreciate your help
ThanksTry:
DECLARE @Classes TABLE (
ClassID INT identity(1, 1) PRIMARY KEY
,ClassName VARCHAR(50)
INSERT INTO @Classes (ClassName)
VALUES ('CSharp')
,('JSharp')
DECLARE @Students TABLE (
StudentID INT identity(1, 1) PRIMARY KEY
,StudentName VARCHAR(10)
,ClassID INT
INSERT INTO @Students (
StudentName
,ClassID
VALUES (
'xxx'
,1
'yyy'
,1
'zzz'
,1
'fff'
,2
'ttt'
,2
SELECT TOP (1)
WITH TIES C.ClassName
FROM @Classes C
INNER JOIN @Students S ON C.ClassID = S.ClassID
GROUP BY C.ClassID
,C.ClassName
ORDER BY COUNT(S.StudentID) DESC
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles -
Finding registry key for a preference in Adobe
Anyone know which registry key is for this preference in Adobe?
Internet\Connection Speed: "LAN"Seems to be:
HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0\AVGeneral
Set "iConnectionSpeed" REG_DWORD:0x00989680 -
Finding the most values that occurs in a list
Okay, so I am asked to create this algorithm that will allow me to count the value that occurs most frequently within the list. So as an example say that I have a list
1, 2, 3, 4, 5
then this will return 5
and say that I have 1, 2, 2, 3, 4, 5
then this will return 2
How can I do this?would someone be willing to check this code out for me??
int count = 1;
int prevCount = 1;
int totalCount = 0;
for (int i = 0; i < array.length; i++) {
for (int j = i + 1; j < array.length; j++) {
if (array[i] == array[j]) {
count++;
i++;
if (count == 1 && prevCount == 1){
totalCount++;
else if (count >= prevCount) {
if (count == prevCount)
totalCount++;
else
totalCount = 1;
if (prevCount < count)
prevCount = count;
count = 1;
}I think it works, I tested it using several cases -
Can anyone suggest a query that would return all of the columns in the primary key of a table? Information on why I'm asking can be found below.
I'm currently using the following query, but it won't work right if there are unique indexes on the table besides the primary key.
"select column_name from all_ind_columns c, all_indexes i where c.index_owner = i.owner and c.index_name = i.index_name and i.table_owner = {me} and i.table_name = {table_name} and uniqueness = 'UNIQUE'"
The reason I'm interested in the primary key is I need to merge the contents of table A into a table B with the same structure, and before I can do this I need to delete any rows that will cause insertion to fail.In the column for constrain_type P is for primary key and R is for Foreign key
COLUMN TABLE_NAME NEW_VALUE TT_TAB NOPRINT
TTITLE 'TABLE: ' TT_TAB SKIP1
break on table_name skip page on constraint_name on constraint_type
COLUMN CONSTRAINT_NAME FORMAT A35
COLUMN COLUMN_NAME FORMAT A35
COLUMN REF_TAB_COL FORMAT A35
COLUMN POSITION NOPRINT
SELECT a.table_name, A.CONSTRAINT_NAME, B.COLUMN_NAME, B.POSITION,
a.constraint_type, NULL REF_TAB_Col
FROM USER_CONSTRAINTS A, USER_CONS_COLUMNS B
WHERE A.CONSTRAINT_TYPE='P'
AND A.CONSTRAINT_NAME = B.CONSTRAINT_NAME
UNION
select a.table_name, A.constraint_name, C.COLUMN_NAME, C.POSITION,
a.constraint_type, B.TABLE_NAME||'.'|| B.COLUMN_NAME
from USER_constraints A, USER_IND_COLUMNS B, USER_CONS_COLUMNS C
where A.CONSTRAINT_TYPE = 'R'
AND A.R_CONSTRAINT_NAME = B.INDEX_NAME
AND A.CONSTRAINT_NAME = C.CONSTRAINT_NAME(+)
ORDER BY 1,2,4 ; -
Issue in Query to find the Cumulative Values
Hi All,
I am developing one Query in which i have to show plant wise last 12 months status of audit.
In this audit i am able to show the types of audits say X,Y,Z perfectly.
But the thiing i want to calculate is the cumulative values of X,Y,Z before the last 12 months.
For Ex: Audit X Y Z Formula(X+Y-Z)
month1 10 20 30 0
month2 10 30 10 30
month12 20 40 20 40
month13 ***(X) ***(Y) ***(Z)..till
Like this i want to develop the report as per the requirement.
Please help how to resolve this issue.
Thanks in Advance.Hi All,
I am developing one Query in which i have to show plant wise last 12 months status of audit.
In this audit i am able to show the types of audits say X,Y,Z perfectly.
But the thiing i want to calculate is the cumulative values of X,Y,Z before the last 12 months.
For Ex: Audit X Y Z Formula(X+Y-Z)
month1 10 20 30 0
month2 10 30 10 30
month12 20 40 20 40
month13 ***(X) ***(Y) ***(Z)..till
Like this i want to develop the report as per the requirement.
Please help how to resolve this issue.
Thanks in Advance.
Maybe you are looking for
-
LSMW SEL_DATE filed Single - Character Flag
Dear gurus i created a lsmw for T/code VK12 . I faced problem when the LSMW read till convert data. In the VK12 , this Screen Field SEL_DATE will be my valid on date. I created the source filed Valid on date to match the mapping with SEL_DATE. Here a
-
Query Builder - Report variables
Hi All, I have to document a report with all the variable names and the variable formulae. Is it possible to run a query in the query builder which can fetch these details from the report. I would like to know where i can find a guide for query build
-
In my workflow I pre-process images in a tmp directory using Bridge & ACR & Photoshop. I end up with a raw (.CR2) image, and a jpeg image and sometimes an .XMP sidecar file. If I adjusted anything in ACR I get the sidecar, if I didn't, then no sideca
-
Hello, I have created a subvi that searches through a main folder for specific files and adds them to a compressed folder. I have 4 folders I need to create for different types of collected files (.csv and .txt). The naming convention of the files in
-
Where do I find an app for Facebook video chat?
When I try to video chat on facebook Apple will not let me download the Facebook Video Calling_v1.6-10.jar because it is an unidentifiable developer. Who would be an identified developer? Where would I find the app?