Getting Candidate Keys for a Table?
Hi,
Does anyone know a way of getting a list of all candidate keys for a table? (all "UNIQUE" sets of columns defined when creating a table).
I looked in DatabaseMetaData, but there you can only get a list of primary key fields.
I'm using Java 1.3.1 with a PostgreSQL backend.
Cheers
Amar
run a query against the Meta-data tables of the database for getting the UNIQUE columns.
Similar Messages
-
How to get the "Key" for Dimension in SSAS.
Hi
How to get the "Key" for Dimension in SSAS.
(Below value is the PPSParameters table XML column value in PPSDatabase in SharePoint.
Below three key values are belongs to "Dimension". I have tried to find the key but I could net get it.)
<NewDataSet>
<UserValues><Key>16A201A9E75128559F947D58E6D187A9</Key></UserValues>
<UserValues><Key>7FBEA449A6ED5606973306445839619E</Key></UserValues>
<UserValues><Key>A8F75F9720817BCD2E1DFC1C1CF1E678</Key></UserValues>
</NewDataSet>
Thanks & Regards
Poomani SankaranTo Be Honest there is not one straight Cmdlet that atleast I have come across
The best way would if you have Lync monitoring server
Using the Lync Server 2013 Monitoring Server
If you have the Monitoring Server role configured in your environment, and for Lync Server 2013 everyone should!, you can use information contained in the LcsCDR database to pull back the last time a user signed in. You can run the following query* to
pull back the user's SIP URI and their last login time:
USE LcsCDR
SELECT dbo.Users.UserUri, dbo.UserStatistics.LastLogInTime
FROM dbo.UserStatistics
JOIN dbo.Users ON dbo.Users.UserId = dbo.UserStatistics.UserId
ORDER BY UserUri
Which produces the following output:
The advantage to using the Monitoring Server to obtain this data is that unlike the information contained in the rtcdyn database, the information from the LcsCDR data will persist even when the user isn't signed into Lync.
To get approx count of users enable for Lync Server in your organisation
Get-CsUser -Filter {Enabled -eq $true} | MeasurE
Please not the above command let will give you an approx number not exact
From the Monitoring report yet the SIP account that signed in and then from count find out how many user havent signed in this is manual task
Hope this is helpful
Please remember, if you see a post that helped you please click ;Vote As Helpful" and if it answered your question please click "Mark As Answer" Regards Edwin Anthony Joseph -
Is it possible to create many primary key for a table?
hello sir/mam.
i am selva, i am new to abap,
is it possible to create many primary key for a table?
please guide me.Hi Selva,
Many Primary Keys = Composite Key.
i.e some set of columns will enable you to identify a unique row from a set of rows in the table.
This can be achieved by checking the primary key check box in se11.
Hope it helps.
Regards,
Maheswaran.B
Message was edited by: Maheswaran B -
Hi,
I need some advice on remote keys for lookup tables.
We have loaded lookup data from several client system into the MDM repository. Each of the client system can have diffferences in the lookup values. What we need to do is to enable the keymappings so that the syndicator would know which value belongs to which system.
The tricky part is. We haven't managed to send out the values based on the remote keys. We do <b></b>not<b></b> want to send the lookup tables themselves but the actually main table records. All lookup data should be checked at the point of the syndication and only the used lookup values that orginally came from one system should be send to that particular system. Otherwise they should be tag should be blank.
Is this the right approach to handle this demand or is there a different way to take care of this? What would be the right settings in the syndicator?
Help will be rewarded.
Thank you very much
best regards
NicolasHi Andreas,
that is correct. Let's take two examples:
1) regions
2) Sales Area data (qualified lookup data)
Both tables are filled and loaded directly from the R/3s. So you would already know which value belongs to which system.
The problem that I have is that we will not map the remote key from the main table because it will be blank for new created master data (Centralization scenario). Therefore we cannot map the remote key from the attached lookup tables, can we?
The remote key will only work for lookup tables if the remote key of the actual master data is mapped. Since we don't have the remote key (local customer ID form R/3) in MDM and since we do not create it at the point of the syndication... how would the SAP standard scenario would look like for that?
This is nothing extraordinary it's just a standard centralization scneario.
Please advice.
Thanks alot
best regards
Nicolas -
Why can't I get a key for the Office Consumer Technical Preview now?
So.. I tried for many times to get a key for my new office 16 technical preview but failed all the times. Now the office on my PC is running out of time. So I cannot use it now. How could I get a key to let it work?
Hi CNysl,
This forum is for developers discusing devloping issues about
apps for Office.
As suggested by jackafx, I also suggest that you contact the Office team via the blog, you can send an email by following link like figure below:
The next chapter of Office on Windows
Regards & Fei
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. -
How do I get license key for trial app, now that I have joined Creative Cloud ?
how do I get license key for trial app, now that I have joined Creative Cloud ?
after trying again, the signin process worked and activated my trial copy for me.
-
Nnot Get Session Key for Authentication
I found in trace file of my application
(TRACE_LEVEL_CLIENT = SUPPORT in sqlnet.ora):
ORA-28035 Cannot Get Session Key for Authentication
Cause: Client and server cannot negotiate shared secret during logon.
What is the session key and how to obtain it?DISABLE_OOB = ON
NAMES.DEFAULT_DOMAIN = domain
NAMES.DIRECTORY_PATH= (TNSNAMES)
SQLNET.CRYPTO_SEED = P9EBHPQFLEIAJNUFAZHQP8JBNES8EBEEHS895LCWW9UZKO9HR2R2E5GDN7JV15T27QJO97D89BQAWSRF
# SQLNET.CRYPTO_CHECKSUM_SERVER = requested
# SQLNET.CRYPTO_CHECKSUM_CLIENT = requested
# SQLNET.ENCRYPTION_SERVER = requested
# SQLNET.ENCRYPTION_CLIENT = requested
SQLNET.RADIUS_AUTHENTICATION = ad1.domain
# SQLNET.RADIUS_AUTHENTICATION_PORT = (PORT)
SQLNET.RADIUS_AUTHENTICATION_TIMEOUT = 5
SQLNET.RADIUS_AUTHENTICATION_RETRIES = 3
SQLNET.RADIUS_ALTERNATE = ad2.nlmk
# SQLNET.RADIUS_ALTERNATE_PORT = (1645)
SQLNET.RADIUS_ALTERNATE_TIMEOUT = 5
SQLNET.RADIUS_ALTERNATE_RETRIES = 3
SQLNET.RADIUS_SEND_ACCOUNTING = ON
# SQLNET.RADIUS_SECRET=(path/radius.key)
SQLNET.AUTHENTICATION_SERVICES = (NTS, BEQ,RADIUS)
# TRACE_LEVEL_CLIENT = SUPPORT
# TRACE_LEVEL_SERVER = SUPPORT
domain is the name of my windows domain
TNSNAMES.ORA
SERVER.DOMAIN =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = server.domain)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = server.domain)
) -
Creating view to get first row for each table !!
I am having tables(more than 10) which are related using foreign key and primary key relationship.
Example:
Table1:
T1Prim T1Col1 T1Col2
Table2
T2For T2Prim T2Col1 T2Col2 T2Col3
(here T2For will have value same as T1Prim and in my design it has same column name i.e. T1Prim)
Table3
T3For T3Prim T3Col1 T3Col2 T3Col3
(here T3For will have value same as T2Prim)
and so on.
The data in the tables is like For table1 there will be one record, for table2 there will be one record and for table 3 there are more than one records.
Can i view either the first record for each of them or all records from each of them by writing the following view.
I have written a view like this:
Create or replace view test (T1Prim,T1Col1, T1Col2,T2Prim,T2Col1 T2Col2, T2Col3, T3Prim,T3Col1, T3Col2, T3Col3)
As
Select
Table1.T1Prim,
Table1.T1Col1,
Table1.T1Col2,
Table2.T2Prim,
Table2.T2Col1,
Table2.T2Col2,
Table2.T2Col3,
Table3.T3Prim,
Table3.T3Col1,
Table3.T3Col2,
Table3.T3Col3
From
Table1,
Table2,
Table3
where
Table1.Prim = Table2.For
and Table2.Prim = Table3.For
When i ran the select statement on the view I am not getting any data. Whereas there is data when select is ran on individual table.
Can someone please tell me where i am goofing.
Thanks in the anticipation that i will get some hint to solve this.
Eagerly waiting for reply.
Thanks !!I mean use a collection :
Collection Methods
A collection method is a built-in function or procedure that operates on collections and is called using dot notation. The methods EXISTS, COUNT, LIMIT, FIRST, LAST, PRIOR, NEXT, EXTEND, TRIM, and DELETE help generalize code, make collections easier to use, and make your applications easier to maintain.
EXISTS, COUNT, LIMIT, FIRST, LAST, PRIOR, and NEXT are functions, which appear as part of an expression. EXTEND, TRIM, and DELETE are procedures, which appear as a statement. EXISTS, PRIOR, NEXT, TRIM, EXTEND, and DELETE take integer parameters. EXISTS, PRIOR, NEXT, and DELETE can also take VARCHAR2 parameters for associative arrays with string keys. EXTEND and TRIM cannot be used with index-by tables.
For more information, see "Using Collection Methods".
Syntax
Text description of the illustration collection_method_call.gif
Keyword and Parameter Description
collection_name
This identifies an index-by table, nested table, or varray previously declared within the current scope.
COUNT
COUNT returns the number of elements that a collection currently contains, which is useful because the current size of a collection is not always known. You can use COUNT wherever an integer expression is allowed.
For varrays, COUNT always equals LAST. For nested tables, normally, COUNT equals LAST. But, if you delete elements from the middle of a nested table, COUNT is smaller than LAST.
DELETE
This procedure has three forms. DELETE removes all elements from a collection. DELETE(n) removes the nth element from an index-by table or nested table. If n is null, DELETE(n) does nothing. DELETE(m,n) removes all elements in the range m..n from an index-by table or nested table. If m is larger than n or if m or n is null, DELETE(m,n) does nothing.
EXISTS
EXISTS(n) returns TRUE if the nth element in a collection exists. Otherwise, EXISTS(n) returns FALSE. Mainly, you use EXISTS with DELETE to maintain sparse nested tables. You can also use EXISTS to avoid raising an exception when you reference a nonexistent element. When passed an out-of-range subscript, EXISTS returns FALSE instead of raising SUBSCRIPT_OUTSIDE_LIMIT.
EXTEND
This procedure has three forms. EXTEND appends one null element to a collection. EXTEND(n) appends n null elements to a collection. EXTEND(n,i) appends n copies of the ith element to a collection. EXTEND operates on the internal size of a collection. So, if EXTEND encounters deleted elements, it includes them in its tally. You cannot use EXTEND with index-by tables.
FIRST, LAST
FIRST and LAST return the first and last (smallest and largest) subscript values in a collection. The subscript values are usually integers, but can also be strings for associative arrays. If the collection is empty, FIRST and LAST return NULL. If the collection contains only one element, FIRST and LAST return the same subscript value.
For varrays, FIRST always returns 1 and LAST always equals COUNT. For nested tables, normally, LAST equals COUNT. But, if you delete elements from the middle of a nested table, LAST is larger than COUNT.
index
This is an expression that must yield (or convert implicitly to) an integer in most cases, or a string for an associative array declared with string keys.
LIMIT
For nested tables, which have no maximum size, LIMIT returns NULL. For varrays, LIMIT returns the maximum number of elements that a varray can contain (which you must specify in its type definition).
NEXT, PRIOR
PRIOR(n) returns the subscript that precedes index n in a collection. NEXT(n) returns the subscript that succeeds index n. If n has no predecessor, PRIOR(n) returns NULL. Likewise, if n has no successor, NEXT(n) returns NULL.
TRIM
This procedure has two forms. TRIM removes one element from the end of a collection. TRIM(n) removes n elements from the end of a collection. If n is greater than COUNT, TRIM(n) raises SUBSCRIPT_BEYOND_COUNT. You cannot use TRIM with index-by tables.
TRIM operates on the internal size of a collection. So, if TRIM encounters deleted elements, it includes them in its tally.
Usage Notes
You cannot use collection methods in a SQL statement. If you try, you get a compilation error.
Only EXISTS can be applied to atomically null collections. If you apply another method to such collections, PL/SQL raises COLLECTION_IS_NULL.
You can use PRIOR or NEXT to traverse collections indexed by any series of subscripts. For example, you can use PRIOR or NEXT to traverse a nested table from which some elements have been deleted.
EXTEND operates on the internal size of a collection, which includes deleted elements. You cannot use EXTEND to initialize an atomically null collection. Also, if you impose the NOT NULL constraint on a TABLE or VARRAY type, you cannot apply the first two forms of EXTEND to collections of that type.
If an element to be deleted does not exist, DELETE simply skips it; no exception is raised. Varrays are dense, so you cannot delete their individual elements.
PL/SQL keeps placeholders for deleted elements. So, you can replace a deleted element simply by assigning it a new value. However, PL/SQL does not keep placeholders for trimmed elements.
The amount of memory allocated to a nested table can increase or decrease dynamically. As you delete elements, memory is freed page by page. If you delete the entire table, all the memory is freed.
In general, do not depend on the interaction between TRIM and DELETE. It is better to treat nested tables like fixed-size arrays and use only DELETE, or to treat them like stacks and use only TRIM and EXTEND.
Within a subprogram, a collection parameter assumes the properties of the argument bound to it. So, you can apply methods FIRST, LAST, COUNT, and so on to such parameters. For varray parameters, the value of LIMIT is always derived from the parameter type definition, regardless of the parameter mode.
Examples
In the following example, you use NEXT to traverse a nested table from which some elements have been deleted:
i := courses.FIRST; -- get subscript of first element
WHILE i IS NOT NULL LOOP
-- do something with courses(i)
i := courses.NEXT(i); -- get subscript of next element
END LOOP;
In the following example, PL/SQL executes the assignment statement only if element i exists:
IF courses.EXISTS(i) THEN
courses(i) := new_course;
END IF;
The next example shows that you can use FIRST and LAST to specify the lower and upper bounds of a loop range provided each element in that range exists:
FOR i IN courses.FIRST..courses.LAST LOOP ...
In the following example, you delete elements 2 through 5 from a nested table:
courses.DELETE(2, 5);
In the final example, you use LIMIT to determine if you can add 20 more elements to varray projects:
IF (projects.COUNT + 20) < projects.LIMIT THEN
-- add 20 more elements
Related Topics
Collections, Functions, Procedures
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/13_elems7.htm#33054
Joel P�rez -
How to get master key for strong composition detail
Hi all,
My Offline Database Diagram that I have drawn with JDeveloper uses the cascading delete option in foreign keys. When the master will be deleted, its details should be deleted as well. This has resulted in strong composition relationships between master and details.
These relationships are covered by ADF BC Entity Associations and View Links.
But what strikes me is that both AppModule tester and the JHeadstart first-cut application are not able to insert a new detail? They respond with:
JBO-25030: Failed to find or invalidate owning entity
I found an article of Steve Muench discussing this topic with a bare BC4J Java sample. How do I get this in my master/details Entity Impl's context? How can I get the key of the selected master in the create() method of the detail (Steve Muench selects the first row in the table)?
I can't get rid of the strong association relationship in the Entity Association. It is automatically switched on when I switched it off.
Anyone to help?
thanks in advance,
Martijn PetersHi Markus,
Thanks for your reply. Your hints describe how to manually set up a master-detail relationship at the View Objects level.
Does this also work for master-detail entity objects that have a strong composition through CASCADE DELETE on the foreign keys in the database?
What surprises me is that the BC4J wizard uses different approaches for creating a master with details with or without CASCADE DELETE.
I would not expect different behavior for the create() operation in BC4J. I would only expect different behavior for remove() operations.
Moreover it is strange that the generated View Objects can not be altered and that we depend on a workaround you described.
Is their no risk for BC4J corruption when the master is deleted with the BC4J tester and that the database CASCADE deletes the details?
JDeveloper 10.1.2 provides a pretty tool for designing and maintaining a database schema though an Offline Database Diagram.
It shows the CASCADE DELETE option on foreign keys as a strong composition in an object oriented fashion.
The ADF BC wizard is very powerful in making an object oriented abstraction of the database schema.
However it seems to me that ADF BC does not seamlessly fit regarding compositions.
Switching on CASCADE DELETE in the database causes master-details pages in JHeadstart to disfunction.
Need this be improved in BC4J or am I wrong in the implied concepts?
What Java code can I add in the create() methods of my Entity Object subclasses to get the same behavior of regular master-detail objects creation?
Martijn Peters -
How to create a foreign key for the table from two different tables?
Hi All,
I have a three table like below. In the below table SAMPLE_CONS_CHECK and SAMPLE_CONS2_CHECK will be having the primary key for NAME column. The same SAMPLE_CONS3_CHECK table also having the primary key for NAME column and forieign key for SAMPLE_CONS_CHECK and SAMPLE_CONS2_CHECK tables. See the below code 2
code 1:
CREATE TABLE SAMPLE_CONS_CHECK
(NAME VARCHAR2(10),
SERIES VARCHAR2(5)
CREATE TABLE SAMPLE_CONS2_CHECK
(NAME VARCHAR2(5),
MODEL NUMBER
CREATE TABLE SAMPLE_CONS3_CHECK
(NAME VARCHAR2(5),
MODEL_NO NUMBER
)code 2
alter table SAMPLE_CONS_CHECK
add constraint SAMPLE_CONS_CHECK_pk primary key (NAME)
alter table SAMPLE_CONS2_CHECK
add constraint SAMPLE_CONS2_CHECK_pk primary key (NAME)
alter table SAMPLE_CONS3_CHECK
add constraint SAMPLE_CONS3_CHECK_pk primary key (NAME)
ALTER TABLE SAMPLE_CONS3_CHECK ADD
CONSTRAINT SAMPLE_CONS3_CHECK_FK1 FOREIGN KEY
NAME
) REFERENCES SAMPLE_CONS_CHECK
NAME
) ON DELETE CASCADE;
ALTER TABLE SAMPLE_CONS3_CHECK ADD
CONSTRAINT SAMPLE_CONS3_CHECK_FK2 FOREIGN KEY
NAME
) REFERENCES SAMPLE_CONS2_CHECK
NAME
) ON DELETE CASCADE;From the above schenario i am able to insert the data to SAMPLE_CONS3_CHECK table. But the parent data is already available in the parent table. The problem is here two different constarints from two different tables. While inserting, it is checking from both the tables whether the parent is exist or not.
How can i solve this problem? Can anyone halp me about this?
Thanks
Edited by: orasuriya on Aug 8, 2009 2:02 AMActually the design is completely incorrect.
What you say is
I have
'foo', 'foo series'
'foo','foo model'
'foo',666
By virtue of table3 referring to both table1 and table2.
This means you actually need to have 1 (one) table:
'foo','foo series','foo model', 666
And the 'problem' disappears.
Sybrand Bakker
Senior Oracle DBA -
How to define Composite primary key for a Table
Hi ,
I am basically more into Java Programming , with little bit knowledge on Oracle as DataBase .so please excuse for my silly doubts .
Can anybody please tell me how to define a Composite Primary Key on a Table .
Thanks in advance .
Edited by: user672373773 on Sep 25, 2009 8:54 AMHere is an example right out of the Oracle documentation and the syntax for adding PK since you mention adding a composite PK.
Example creating composite index
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_indexing.htm#sthref594
Syntax for adding a PK (composite or not)
alter table oooooooo.tttttttt
add constraint tttttttt_PK
primary key (sample_column2,
sample_column1)
using index
tablespace IDXSPC
pctfree 05
initrans 04
maxtrans 08
storage (initial 16k
next 16k
maxextents 32
pctincrease 0);
-- dictionary management with restricted storage, change as desired.
HTH -- Mark D Powell -- -
Getting License Key for NSP (no E-Mail is sent)
Hello SDN Team,
as reported I have successfully installed the NW04 ABAP Sneak Preview. Now I'm trying to get a license for it at http://www.sap.com/solutions/netweaver/minisap.epx. I enter all the data, check the License Agreement, hardware key from Transaction SLICENSE, choose the System NSP and send the form. But I never got an E-Mail with the key. So I tried the System WA1 just for a test. And after just a Minute I've got the E-Mail with the key.
Regards
Gregorlol.
@gregor,
i don't know what kind of groopie you are and why you are so opportunistic to talk for everyone.
fact is:
- some (including me) haven't even got that email.
OS: "Did you request it again - after I fixed the EmailServer?"
- others seem to have got it, but with a developer key for installation number DEMOSYSTEM whereas the installation sets the installation number to INITIAL.
the developer key for INITIAL is definitely different from the one for DEMOSYSTEM.
so to be a little constructive, at least tell people that they probably have to actualize their general license to update the installation from INITIAL to DEMOSYSTEM and afterwards use the known developer key to unlock the repository.
and don't you tell me what to post an what not to post.
anton
Message was edited by: Oliver Stiefbold -
Get product key for preinstalled windows 7
Hello sir, I bought this laptop (Hp pavilion dv6 6115tx Entertainment Notebook)around 4 years ago with preinstalled Windows 7 Home Premium Operating system. As you know Microsoft is going to give free upgrade to Windows 10. But the problem is that the product key below my laptop is not much visible. I am unable to identify the product key. Is there any other way to get product key of my genuine windows 7? I have recovery disk with me. but it does'nt have product key on it.Please help me... Thanks & Regards,Rushikesh Musale
Yes, you can use the same product key for 64-bit release too, as SenneVL says. But, kindly note that upgrade across is not supported and you need to perform clean install only. Also, kindly note that the Windows installation must be made in the same PC,
even if different architecture is being used. Otherwise, activation issues will arise.
Multiple architecture is supported in multiboot, so Windows 32-bit and 64-bit can be installed as multiboot environment, parallely.
Balaji Kundalam -
How to get SQL script for generating table, constraint, indexes?
I'd like to get from somewhere Oracle tool for generating simple SQL script for generating table, indexes, constraint (like Toad) and it has to be Oracle tool but not Designer.
Can someone give me some edvice?
Thanks!
m.I'd like to get from somewhere Oracle tool for
generating simple SQL script for generating table,
indexes, constraint (like Toad) and it has to be
Oracle tool but not Designer.
SQL Developer is similar to Toad and is an Oracle tool.
http://www.oracle.com/technology/products/database/sql_developer/index.html -
Get row count for different tables to the same line
How can I get the row count for different tables in one line:
SELECT count(A), count(B), count(C) from table tb_a A , tb_b B, tb_c C;
Thanks!>
Hi,
How can I get the row count for different tables in one line:
SELECT count(A), count(B), count(C) from table tb_a A , tb_b B, tb_c C;Something like this? One of the many uses for CTE's - Common Table Expressions - AKA
subquery refactoring. Worth getting to know - very handy!
with acount as
select count(*) as counta from dual -- put your table name here
bcount as
select count(*) as countb from dual -- put your table name here
ccount as
select count(*) as countc from dual -- put your table name here
select a.counta, b.countb, c.countc from acount a, bcount b, ccount c;HTH,
Paul...
Edited by: Paulie on 25-Jul-2012 17:44
Maybe you are looking for
-
Is Motion a total piece of garbage?
What do you think guys? Even when things are running well, there's always some weird glitch or system hang that makes this thing practicly unusable. Like continuous playback, even after the spacebar is hit or the mouse is clicked or the escape button
-
Site Web Analytics reports -- no more data
Hi, I just checked the Site Web Analystics reports and there is no more data since mid Dec. Any thoughts? Is there anything I have to reconfigure? Thanks in advance.
-
Need to move iTunes library from external hard drive to Mac desktop.
I moved my iTunes library from my Mac desktop to an external hard drive. I needed to do this so the Apple Store could do maintenance work on my computer and I didn't want to lose my files. How do I move the iTunes library back to my Mac desktop?
-
Problems with some links / functions in this forum
Hello Forum Support Staff, If I try to say "Mark All Threads as Read" it is supposed to mark all threads as read. However, this doesn't work in the last couple of days. I don't know why. Sometimes it greyes out some threads and leaves the other threa
-
Safari logging me out / Forgets password
So recently I decided to delete my history, cache passwords etc on Safari for my iPod, which was stupid because ever since if leave Safari for a small period of time or take it away from multi tasking, then I always have to re enter my email and pass