How to get the primary key names right for child tables?
I have a logical model with a parent table and two child tables. The engineering strategy is "table per child". The parent has an primary key attribute. This is a screen shot:
https://lh5.googleusercontent.com/-iKMtA3Say5c/UIkG1iktgEI/AAAAAAAAAtc/mrwFeHm4gi4/s800/child_pk_log.png
When I engineer the model I get two primary keys with the same name name, which is the name of the parent:
https://lh3.googleusercontent.com/-N88a9VwoPKw/UIkG1spbXpI/AAAAAAAAAtY/eonf8WdUZ6I/s800/child_pk_rel.png
The correct names would be CHILD1_PK and CHILD2_PK. I can change the relational model by applying the naming rules but the next engineering will trash the names again.
How can I fix this?
Hi,
the problem with PK name is fixed in Data Modeler 3.2.
You can change PK name in relational model it won't be changed on next engineering
Philip
Similar Messages
-
How to get the Primary key from Synonym
Hi ,
I want to get the Primary Keys for my tables . I used
java.sql.DatabaseMetaData databasemetadata = connection.getMetaData();
ResultSet rs = databasemetadata.getTables(null, null, "%", null);
rs.next();
System.out.println(" TABLE_CAT "+ rs.getString(1));
System.out.println(" TABLE_SCHEM "+rs.getString(2));
System.out.println(" TABLE_NAME "+rs.getString(3));
System.out.println(" TABLE_TYPE "+rs.getString(4));
System.out.println(" REMARKS "+rs.getString(5)); gives :
TABLE_CAT null
TABLE_SCHEM PROGRESS
TABLE_NAME ApplicConv
TABLE_TYPE SYNONYM
REMARKS null
Now if I use :
rs = databasemetadata.getPrimaryKeys(null,"PROGRESS","Applicconv");
System.out.println("Is result set Non empty "+rs.next()); gives :
Is ResultSet non empty false .
Can you tell me why this result is empty? Is it because of my table is a Synonym?
If it is Synonym how to get the primary key ?You can use DatabaseMetaData#getPrimaryKeys.
-
How to get the data from pcl2 cluster for TCRT table.
Hi frndz,
How to get the data from pcl2 cluster for tcrt table for us payroll.
Thanks in advance.
Harisumanth.ChPL take a look at the sample Program EXAMPLE_PNP_GET_PAYROLL in your system. There are numerous other ways to read payroll results.. Pl use the search forum option & you sure will get a lot of hits..
~Suresh -
How to get the PRIMARY KEY of a table at runtime ???
Hi everybody,
My requirement is to update a z-table at runtime according to the data given ata runtime. So the main difficulties for me is that whenever I tried to update the table based on the data given in UI many rows are getting updated as these fields are not unique. So I think if I can get the PRIMARY KEY along with these given fields then I can update only one row at a time.
So Can anyone suggest me how to get PRIMARY KEY of a table based on the data in UI..??
Any suggestions will be appreciated..
Thanks,
SekharU will get primary keys of transparent tables using FM "REUSE_FIELDCALATLOG_MERGE".
pass tyour table name and u will get fieldcatalog filled. In tht their is a field called "KEY" if it has 'X' then tht field is a primary key of transparent tables & if it has "space" then it is not a primary key...
Or else you can try with 'DDIF_TABT_GET'
Or try this code
PARAMETERS: p_table TYPE tabname OBLIGATORY.
DATA: go_strucdescr TYPE REF TO cl_abap_structdescr,
gt_tab_fields TYPE ddfields.
FIELD-SYMBOLS: <gwa_tab_field> TYPE dfies.
TRY .
* Get the details of the DDIC table
go_strucdescr ?= cl_abap_elemdescr=>describe_by_name( p_table ).
CATCH cx_sy_move_cast_error .
MESSAGE 'Error while casting' TYPE 'S'. RETURN.
ENDTRY.
* Check if input is a DDIC table
CHECK go_strucdescr->is_ddic_type( ) = 'X'.
* Get the details of the table fields
gt_tab_fields = go_strucdescr->get_ddic_field_list( ).
* Display the Key fields of the table
LOOP AT gt_tab_fields ASSIGNING <gwa_tab_field> WHERE keyflag = 'X'.
WRITE: / <gwa_tab_field>-fieldname.
ENDLOOP. -
How I get the primary key in a interactive report?
hi,I'm a noob of apex.
I want to get a Interactive report's primary key or rownum,and I try to use the f01...but it doesn't work.
how can I do this.
zlHave a look at: Re: To reference Interactive Report filtered rows in PL/SQL
-
How to get the primary key generated by an Insert?
My classpath is correct. So does anybody knows
Why the following lines of code do not work?
I get this message error.
The line incorrect is line "6".
Exception in thread "main" java.lang.AbstractMethodError:
com.microsoft.jdbc.sqlserver.SQLSe
rverConnection.prepareStatement(Ljava/lang/String;I)
Ljava/sql/PreparedStatement;
1. String strSql;
2. PreparedStatement stmt;
3.
4. strSql = "insert into MYTABLE (MYFIELD) values ('SOMESTRINGVALUE')";
5.
6. stmt = myConnection.prepareStatement
7. (strSql,Statement.RETURN_GENERATED_KEYS);
8.
9. stmt.executeUpdate();
10. stmt.close();
I try to use the method
"ResultSet getGeneratedKeys()"
from the class Statement but without effect since the program can�t proceed from line '6'.Hi,
1. String strSql;
2. PreparedStatement stmt;3.
4. strSql = "insert into MYTABLE (MYFIELD) values ('SOMESTRINGVALUE')";5.
6. stmt = myConnection.prepareStatement
7. (strSql,Statement.RETURN_GENERATED_KEYS);8.
9. stmt.executeUpdate();
10. stmt.close();Can your go and look Ur code @4,
4. strSql = "insert into MYTABLE (MYFIELD) values (?)";and then before @9,
stmt.setString(1,SOMESTRINGVALUE);
Raju -
Hello,
I would like to get the primary key of a MS Access table, but the DatabaseMetaData.getPrimaryKeys(...) doesn't work. An exception is thrown.
Anybody knows how to get the primary key of a MS Access table?
Thanks
ArnoWhich code threw which exception?
Searching this forum for
Access primary
could help, too. -
Getting the primary key from order form
Does anyone know how to get the primary key (DocEntry) off of the order form for an existing order? I don't really want to use the DocNum field since it is not the primary key and theoretically two different orders could have the same DocNum. Thanks in advance for your help.
Hi Joe,
DocEntry and DocNum values are unique, so you cannot have in db 2 orders with the same DocNum. It's possible, that DocEntry and DocNum values can vary.
If you know the DocNum value (f.e. from Order's Form), you can simple use RecordSet object:
Dim sQuery as String
Dim oOrder as SAPbobsCOM.Documents
Dim oRecordSet As SAPbobsCOM.Recordset
Set oOrder = oCompany.GetBusinessObject(oOrders)
Set oRecordSet = oCompany.GetBusinessObject(BoRecordset)
sQuery = "Select DocEntry From ORDR Where DocNum = '" & DocNumber & "'"
oRecordSet.doQuery sQuery
If oRecordSet.RecordCount > 0 Then
oOrder.GetByKey(oRecordSet.Fields(0).Value)
End If
And this should work.
Regards
Libor. -
How to get the current schema name
Hi,
Can anybody please tell me how to get the current schema name, there is some inbuilt function for this,but i am not getting that. Please help me.
Thanks
Jogeshok folks, I found the answer at Tom's as usual.
http://asktom.oracle.com/tkyte/who_called_me/index.html
I rewrote it into a function for kicks. just pass the results of DBMS_UTILITY.FORMAT_CALL_STACK to this function and you will get back the owner of the code making the call as well some extra goodies like the name of the code and the type of code depending on the parameter. This ignores the AUTHID CURRENT_USER issues which muddles the schemaid. Quick question, does the average user always have access to DBMS_UTILITY.FORMAT_CALL_STACK or does this get locked down on some systems?
cheers,
paul
create or replace
FUNCTION SELF_EXAM (
p_call_stack VARCHAR2,
p_type VARCHAR2 DEFAULT 'SCHEMA'
) RETURN VARCHAR2
AS
str_stack VARCHAR2(4000);
int_n PLS_INTEGER;
str_line VARCHAR2(255);
found_stack BOOLEAN DEFAULT FALSE;
int_cnt PLS_INTEGER := 0;
str_caller VARCHAR2(30);
str_name VARCHAR2(30);
str_owner VARCHAR2(30);
str_type VARCHAR2(30);
BEGIN
str_stack := p_call_stack;
-- Loop through each line of the call stack
LOOP
int_n := INSTR( str_stack, chr(10) );
EXIT WHEN int_cnt = 3 OR int_n IS NULL OR int_n = 0;
-- get the line
str_line := SUBSTR( str_stack, 1, int_n - 1 );
-- remove the line from the stack str
str_stack := substr( str_stack, int_n + 1 );
IF NOT found_stack
THEN
IF str_line like '%handle%number%name%'
THEN
found_stack := TRUE;
END IF;
ELSE
int_cnt := int_cnt + 1;
-- cnt = 1 is ME
-- cnt = 2 is MY Caller
-- cnt = 3 is Their Caller
IF int_cnt = 1
THEN
str_line := SUBSTR( str_line, 22 );
dbms_output.put_line('->' || str_line);
IF str_line LIKE 'pr%'
THEN
int_n := LENGTH('procedure ');
ELSIF str_line LIKE 'fun%'
THEN
int_n := LENGTH('function ');
ELSIF str_line LIKE 'package body%'
THEN
int_n := LENGTH('package body ');
ELSIF str_line LIKE 'pack%'
THEN
int_n := LENGTH('package ');
ELSIF str_line LIKE 'anonymous%'
THEN
int_n := LENGTH('anonymous block ');
ELSE
int_n := null;
END IF;
IF int_n IS NOT NULL
THEN
str_type := LTRIM(RTRIM(UPPER(SUBSTR( str_line, 1, int_n - 1 ))));
ELSE
str_type := 'TRIGGER';
END IF;
str_line := SUBSTR( str_line, NVL(int_n,1) );
int_n := INSTR( str_line, '.' );
str_owner := LTRIM(RTRIM(SUBSTR( str_line, 1, int_n - 1 )));
str_name := LTRIM(RTRIM(SUBSTR( str_line, int_n + 1 )));
END IF;
END IF;
END LOOP;
IF UPPER(p_type) = 'NAME'
THEN
RETURN str_name;
ELSIF UPPER(p_type) = 'SCHEMA.NAME'
OR UPPER(p_type) = 'OWNER.NAME'
THEN
RETURN str_owner || '.' || str_name;
ELSIF UPPER(p_type) = 'TYPE'
THEN
RETURN str_type;
ELSE
RETURN str_owner;
END IF;
END SELF_EXAM; -
How to get the current function name in java
How to get the current function name in java.
In c it is done as
printf("%s",__func__);
Thanx in advance.j0o wrote:
System.out.println("Class Name: " + new Exception().getStackTrace()[0].getClassName() +
"/n Method Name : " + new Exception().getStackTrace()[0].getMethodName() +
"/n Line number : " + new Exception().getStackTrace()[0].getLineNumber());
I pointed the OP at this approach yesterday in one of his multi-posts. I still have not been given my Dukes! -
How to get the jsp page name in jsp?
how to get the jsp page name in jsp? how the jsp get the jsp page name dynamic.
thanks in advance.Try request.getServletPath()
-
How to get the actual font name from a font file?
Hi
I have only the font Path I have to get the font name from that path. Any idea how to get the actual font name?
Thanks,I would ask you these questions:
Why do you need to do this? What are you ultimately trying to accomplish?
Are you really asking about the InDesign SDK?
Do you really need to get the "name" of a font from an arbitrary file? Or do you want information about a font installed on the system? If so, what OS?
Do you need to be able to handle any font format?
Which font "name" do you mean?
What language do you want the name in?
(1) It's not clear what you're trying to accomplish. A bit more information about your ultimate goal would be helpful.
(2) This question is not at all specific to the InDesign SDK. Are you really trying to do something in the context of an InDesign plug-in? If so, you probably want to look at IID_IFONTFAMILY and the IFontFamily::GetFamilyName function.
(3) If you are asking more generally, Windows and Mac both have system API calls to get this information, although those tend to deal with installed system fonts, not with arbitrary font files per se.
Also, you can parse the name table from a True Type or Open Type font without using any system APIs; as True Type and Open Type are well-documented standards. I would start by reading these:
The Naming Table
Font Names Table
(4) Although there are other standards, such as Type 1 (PostScript) fonts, and True Type Collection files and other formats, especially on Mac.
(5) Also, when you start down this road, you will quickly realize that your seemingly simple question is actually ambiguous, and that the answer is kind of complicated, because a font can have many names (a family name, a full font name, a style name, a PostScript name, etc.).
(6) And not only does a font have multiple names, it can have each of those names in multiple languages and encodings.
Any clarification would make this a better question. -
How can get the console window name of the current form?
How can get the console window name of the current form?
Try the various get methods of the viewObject such as getQuery:
http://www.oracle.com/webapps/online-help/jdeveloper/10.1.2/state/content/navId.4/navSetId._/vtAnchor.getQuery%28%29/vtTopicFile.bc4jjavadoc%7Crt%7Coracle%7Cjbo%7CViewObject%7Ehtml/ -
I create a mobile game. How to get the signing key?
I create a mobile game. How to get the signing key? Is the certificate is payable? Sorry if the topic is in the wrong section.
You need to be an iOS/Mac OS X developer.
https://developer.apple.com/devcenter/ -
How to get the report server name in Forms 10g.
How to get the report server name in Forms 10g.
I'm using the Application Server 10g 10.1.2.Hello,
I do not think that you can get this value from anywhere. A solution is to put the Reports server name in an environment variable stored in the /forms/server/default.env file, then to query it at Forms runtime with the TOOL_ENV.Getvar() built-in.
Francois
Maybe you are looking for
-
Dynamic Action on change automatically submit
Hi, I have a tabular form (manually handled) with a text item that can be changed (Apex 4.0.2.00.07). Each time the user changes the value of the text item, the changes automatically will be submitted. Therefore I defined a dynamic action: event:onch
-
Copy-and-paste table row results in hang in Contribute 6.5 Mac
Am running Adobe Contribute 6.5 for Mac on OS X 10.8.2 Mountain Lion. Cannot copy-and-paste a table row from one page to another without having Contribute hang. Get spinning multi-colored beach ball and have to eventuall Force Quit Contribute. This w
-
What characters are allowed in an Apple ID Password?
My mom has "changed" her password because she said she was asked to when logging into Facetime. Now she can't log in. When I asked her what it was, she read to me and it had both a space and a period. I don't believe those are accepted. I tried to lo
-
C1-01 Ovi Unable to update messages via Sync to de...
Dear All, I am having C1-01. it was working very fine in routine. When I deleted all messages from Ovi latest version it also deleted from C1-01. ok fine. But after that when my cell C1-01 receive a message from any of my friend it did not pop up in
-
Want to schedule the backgroundjob on weekdays(Mon-Fri) for every 2 hrs
Hi, can anyone please take this request and tell me the solution for scheduling the background job according to factory calendar and also that job should run for every 2 hrs.