Getting an "Integer" logical type to stick
I created my identity-style primary keys in the logical model as logical type "Integer". On the relational model it's still "Integer", and for Oracle it created them as "number(38,0)" (or as SQL Developer tells me, "number(*,0)"). This is a good result, and I like it. My trouble is how to compare my model to a created database without it reporting that the data types are different and wanting to recreate the tables.
Maybe it's a problem with how I'm doing the comparison, so I'll spell out my steps:
1) File->Import->Data Dictionary
2) I pick my connection, and [Next >].
3) I pick my schema, click "Swap Target Model" to on, and leave the "Import To" as my relational model and "Oracle Database 11g" as the database. [Next >]
4) My tables are already clicked, so I leave them. [Next >]
5) It reports that I have changes in my tables, and there are three in the list:
a) The "Data Type" for the column in question in the model is "INTEGER", and the table is "NUMBER". It's checkmarked as a difference.
b) The "Data Type Kind" for the model is "Logical Type(Integer)", and the table is "Logical Type(NUMERIC)". (This one isn't checkmarked because I turned off the "Compare Option" for "Use 'Data Type Kind' Property".)
c) Under "Indexes", it wants "To Drop" my primary key (index). That's odd, because it still lists the primary key under "PK and UK Constraints". It's not really a problem and I just ignore it, but I wonder if it's related to the data type issue.
If I do "DDL Preview", it's (leaving out some of the storage and logging options):
ALTER TABLE CAM.ADDRESSES DROP CONSTRAINT ADDRESSES_PK CASCADE ;
DROP INDEX CAM.ADDRESSES_PK
DROP TRIGGER CAM.ADDRESSES_ROW_ID_TRG
ALTER TABLE CAM.ADDRESSES RENAME TO bcp_ADDRESSES
CREATE TABLE CAM.ADDRESSES
ROW_ID INTEGER NOT NULL ,
INSERT INTO CAM.ADDRESSES
(ROW_ID ,[...] )
SELECT
ROW_ID , [...]
FROM
bcp_ADDRESSES
CREATE UNIQUE INDEX CAM.ADDRESSES_PK ON CAM.ADDRESSES
ROW_ID ASC
ALTER TABLE CAM.ADDRESSES
ADD CONSTRAINT ADDRESSES_PK PRIMARY KEY ( ROW_ID )
USING INDEX CAM.ADDRESSES_PK ;So it looks like it'd create the column as an "INTEGER" again, so on the next attempt I'd be back where I started.
In the "Types Administration" I tried changing the logical type mapping to "number(38,0)" and then "number(38)", but that didn't help. I didn't write down how it reported the difference -- I think it was that "number(38)" was different from "number". If I changed the type mapping to "number", then it stopped reporting the data type as a difference -- but then it wanted to create the columns as "number", which has a scale, and I'd rather not have one.
Any suggestions on how to get it to leave this alone?
(Version 3.3.0.747. I think that when I was running 3.1.4, it just wanted to alter column addresses modify (row_id integer), which was annoying but I could just delete all of those lines. Now that it wants to recreate the table altogether, it's harder to work around. But maybe the table recreation is due to the index business, which it didn't bother me about before.)
Thanks for the quick reply and about the storage properties. I'll check into that.
About Integer data type - it won't report difference if logical type integer is mapped to Integer data type or to Number(38). We'll improve it to cover mapping to Number as well.I just did some experiments and learned something about Oracle today. If you create a column as type "INTEGER" and look at the table in SQL Developer (3.0.04)'s Schema Browser's "Columns" tab, it says that the column is of type "NUMBER(38,0)", but it isn't. The USER_TAB_COLUMNS view says that the DATA_PRECISION is null, not 38, with DATA_SCALE 0. That explains why the Modeler sees the model's "INTEGER" or "NUMBER(38)" is different from the database column's precision-less data type. If the database column is explicitly created as a "NUMBER(38,0)", and USER_TAB_COLUMNS.DATA_PRECISION is really 38, the Modeler reports that as type "NUMBER(38)", which is sees as the same as the model's "INTEGER". Very interesting.
Similar Messages
-
Last 6 months of data based on date feild that is an integer data type
Hi Folks
I have a date column called 'YYYYMM' that is an Integer data type in YYYYMM format (eg. 201309). I want to return records from the last 6 months.
If the column was in a date format I could use something like
[YYYYMM] >DATEADD(M, -6, CURRENT_TIMESTAMP)
Therefore I assume I need to do a CONVERSION of INT into a date format with something like
CONVERT (DATE, [YYYYMM]
But I get the message "Explicit conversion from data type int to date is not allowed"
Can someone suggested a work around?
Many thanks Steveanother way is this
SELECT *
FROM Table
WHERE DATEADD(mm,(dateintfield%100)-1,DATEADD(yy,(dateintfield/100) -1900,0)) >=DATEADD(mm,DATEDIFF(mm,0,GETDATE())-6,0)AND DATEADD(mm,(dateintfield%100)-1,DATEADD(yy,(dateintfield/100) -1900,0)) < DATEADD(mm,DATEDIFF(mm,0,GETDATE()),0)
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
How To Get FileType and MIME Type from a File
Hi,
I am using following ways to get FileType and MIME Type.
I am able to get file type, but I am getting MIME Type as */*
Can any one please let me know how to get MIME Type, but it should not be time consuming process.
For File Type I am using following Code:
private String getFileData(InputStream inStream) {
fileName = C:\temp\temp.tiff
String filePath = Util.createTempFile(fileName);
RandomAccessFile raf = new RandomAccessFile(filePath, "rw");
while (inStream.available() > 0) {
byte[] buf = new byte[inStream.available()];
inStream.read(buf);
raf.write(buf);
inStream.close();
raf.close();
File file = new File(filePath);
JFileChooser chooser = new JFileChooser();
String fileType = chooser.getTypeDescription(file);
file.delete();
//MIME Type I am getting from
DataHandler data = new DataHandler(new DocumentSource(inStream));
data.getContentType();
data.getContentType() is not working well in all cases.
Can any one help me on this.
Thanks in advance,
Ram.
Edited by: javausers07 on Apr 15, 2009 4:25 PMjavausers07 wrote:
Hi,
I am using following ways to get FileType and MIME Type.
I am able to get file type, but I am getting MIME Type as */*
Can any one please let me know how to get MIME Type, but it should not be time consuming process.
For File Type I am using following Code:
private String getFileData(InputStream inStream) {
fileName = C:\temp\temp.tiff
String filePath = Util.createTempFile(fileName);
RandomAccessFile raf = new RandomAccessFile(filePath, "rw");
while (inStream.available() > 0) {
byte[] buf = new byte[inStream.available()];
inStream.read(buf);
raf.write(buf);
inStream.close();
raf.close();
File file = new File(filePath);Why do you do all above?
JFileChooser chooser = new JFileChooser();
String fileType = chooser.getTypeDescription(file);
file.delete();
//MIME Type I am getting from
DataHandler data = new DataHandler(new DocumentSource(inStream));
data.getContentType();
data.getContentType() is not working well in all cases.That's because there's no way to get MIME type of all files on all filesystems.
Kaj -
Bassically i just got my new iphone 5, everything was going fine up untill the Apple ID login box started appearing and then dissapearing before i get the chance to type the password. It pops up every 10 to 20 seconds, and dissapears just as quick as it popped up. I have turned the device on and off, and I have rebooted it. I checked for 'waiting downloads' or 'paused downloads' and there are none. i can still use everything on the phone, but this log in box popping up so often is going to get extremely annoying, im already contemplating sending it back!!!
PROBLEM SOLVED! HAHA
I did a full restore via iTunes. -
How to get the current logical system?
Dear Abapers:
I can't find the logical system value from the table SYST, pls tell me how to get the current logical system name, Thanks!Hi,
Check with the table T000, the Logical system field name is LOGSYS.
Regards
Thiru -
Domains and Logical Types in Data Modeler
Been out of serious design work for a long time. Can someone provide a good pointer to descriptions on Domains and Logical Types and presented in the Data Modeling tool?
For instance I am having trouble tracking the following distinctions:
Domain Logical Type
LongText Varchar
ShortText Char
Text Char
NText NTEXT
NVarchar NVARCHAR
CHAR and VARCHAR are listed as Logical Types but not Domains. There is a TEXT logical type, but ironically, it does not correspond to the Text Domain. Varchar2 appears in neither list. I believe I ready the N* domains/types are for international characters (multi-byte?), but basically see no pattern here so was hoping someone could straighten me out.
Thanks,
Robert KuropkatHi Robert,
Logical types are abstraction for native data types in supported databases. You need logical types if you want to import from database or DDL script (mapping of native to logical is important here) or want to generate DDL script (mapping of logical to native). You can delete all logical types (only "unknown" has importance) and create your own logical types. In this case you have to map them to native database types. If you use only Oracle database then you can delete types related to other databases. Of course you can rename existing logical types if you don't like how they are named.
Domains are based on logical types - you need logical type in order to have valid domain definition. Provided domains are just sample. You can delete them - the only important here is "unknown". You can create two types of domains (it's usage point of view) - 1) per installation - common for all designs; 2) per design - they appear only for design they are defined. You also can import domains.
Also domains are automatically created during import of DDL script - it's kind of data type aggregation - domain is created for each used data type.
Best regards,
Philip -
Validation on Integer data type attribute
Hi,
Working on jdev 11.1.1.3.0
I have to do validation on integer data type like, it should not allow 13.20(only single digit numbers.).
I am doing validation on AMImpl and converting the int into string
String per=Row.getPer().toString();// here if user enter 13.20, then per containing only 13 so its not going to inside if.
if(StringUtils.contains(per,"."))
return false;
Even i have written regular expression on my field but its working
can any one help me.Hi,
Why don't you use the af:convertNumber in your tag?
Something like that:
<af:inputText>
<af:convertNumber>
</af:inputText>
Doc: http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e12419/tagdoc/af_convertNumber.html
Regards, -
How do you get the integer of a number with more than 10 digits
I can't seem to be able to get the integer of a number with more than 10 digits.
ex:
integer(12345678901.3) returns -539222987 when it should really return 12345678901
Thanks for the help
(I'm on director 11 at the moment)You can write a Parent script to represent Big Integers. I wrote some code to get you started. It consist of two classes - "BigInt" and "Digit". At this point you can only add two "BigInts" and print out the value with a toString() function. Note that you pass a String to the "BigInt" constructor.
In the message window you could enter something like:
x = script("BigInt").new("999999999999")
y = script("BigInt").new("100000000000000000004")
z = x.add(y)
put z.toString()
And the output window will show:
-- "100000001000000000003"
Here are the two Parent scripts / Classes
-- Digit
property val
property next
on new me, anInt
val = anInt
next = 0
return me
end new
-- BigInt
property Num
property StringRep
on new me, aString
Num = script("Digit").new(Integer(aString.char[aString.length]))
curNum = Num
repeat with pos = aString.length - 1 down to 1
curNum.next = script("Digit").new(Integer(aString.char[pos]))
curNum = curNum.next
end repeat
return me
end new
on add me , Num2
curNum = Num
curNum2 = Num2.Num
result = curNum.val + curNum2.val
if result > 9 then
carry = 1
else
carry = 0
end if
result = result mod 10
sum = script("Digit").new(result)
curSum = sum
curNum = curNum.next
curNum2 = curNum2.next
repeat while curNum.ObjectP AND curNum2.ObjectP
result = curNum.val + curNum2.val + carry
if result > 9 then
carry = 1
else
carry = 0
end if
result = result mod 10
curSum.next = script("Digit").new(result)
curSum = curSum.next
curNum = curNum.next
curNum2 = curNum2.next
end repeat
repeat while curNum.ObjectP
result = curNum.val + carry
if result > 9 then
carry = 1
else
carry = 0
end if
result = result mod 10
curSum.next = script("Digit").new(result)
curSum = curSum.next
curNum = curNum.next
end repeat
repeat while curNum2.ObjectP
result = curNum2.val + carry
if result > 9 then
carry = 1
else
carry = 0
end if
result = result mod 10
curSum.next = script("Digit").new(result)
curSum = curSum.next
curNum2 = curNum2.next
end repeat
StringRep = ""
me.makeString(sum)
return me.script.new(StringRep)
end add
on toString me
StringRep = ""
me.makeString(Num)
return StringRep
end toString
on makeString me, digit
if not digit then
return
end if
me.makeString(digit.next)
put String(digit.val) after StringRep
end makeString -
How to map logical type to varchar(max)?
Hello fellow modelers and developers,
I created a logical model of a database in SDDM and trying to create a relational model for Oracle, DB2 and MSS. The one for Oracle seams fine, but the MSS one is kinda tricky as it seams impossible to map my logical data type "CLOB" to a varchar(max). Of course I could map to TEXT, but according to the SQLServer documentation, I should not use it, but varchar(max) instead.
If I import a DDL file which contains a varchar(max), SDDM creates a DOMAIN with "varchar" as logical type and "max" as size, but the DDL export will contain no size. If there is a way to add this one single tiny data type in my exported DDL without having to do a search replace afterwards I would really like to know.
greetings from Vienna.
edit:
BTW, I am using version 3.0.04.34 on Windows 7 64-bit
Edited by: 896729 on Nov 11, 2011 10:14 AMHello atschabu,
thanks for feedback. I logged a bug for that. It'll be tricky to import it - normally varchar is mapped to Varchar logical type but varchar(max) is something else. Probably we'll create domain and customer can assign proper logical type to it later.
Philip -
Getting the desired condition type
i have to pick the taxes from me23n--->invoice->taxes for PO smartform based on tax code and the condition record no.s valid date to & valid date from.
im using A363 table in which im getting all the condition types for a given material & vendor.but i have to pick a condition type which has the valid date to(datab) &
valid date from (datbi) equal to me23n(entered in me23n-->invoice,taxcode>taxes----->display condition record (for a particular condition type).
for ex:
after retrieving the data from A363 table i have
condition type valid date from valid date to condition record no.
JMOP 1.7.2007 30.9.2007 XXXXXXXXX123
JMOP 1.8.2007 30.9.2222 XXXXXXXXX456
Now i want to pick xxxxxxxx123 as this condition type has the valid date to(datab) & valid date from (datbi) equal to valid date to & valid date from (datbi)PO no. in ME23N transaction. please suggest from which table i can pick valid date to & valid date from (datbi) for a given condition record no. ,for a particular PO number.Hi Srinivas,
Go for KONV-KSCHL. and check by takig values (Eg: if u take EKKO in tat KNUMV is the Documentation condition number ) take this number and go for KONV and paste that KNUMV in this table here u can check condition types used by the Purchase.
KONV-KSCHL.
Reward Points if helpful.
Thanks
Naveen khan -
I just got Ivory 2 and I can't get it into logic
I am new to both logic and ivory, could someone please help me get Ivory into logic, i have tried tried but can't get any where.
please helpThank you all anyway, I just realized I have to hold down the mouse and then Ivory will pop up under all instruments. I am a cubase guy so it's like starting all over again. I'm wondering if I made a mistake, could some of you out there let me know what you think in comparing the two
-
My keyboard does not have the number sign: # . How do I get my keyboard to type this?
It depends on your keyboard layout.
From the menu bar, select
▹ System Preferences... ▹ Keyboard ▹ Keyboard ▹ Show Keyboard & Character Viewers in menu bar
Now select
Show Keyboard Viewer
from the menu with a keyboard icon in the menu bar, towards the right. By pressing modifier keys, you can see what characters correspond to any key combination. You can also produce a character by clicking it in the viewer. -
How can i get & use java true type fonts in my applet
Hi,
I could get the System fonts in my Applet by making use of Toolkit.getFontList()
I have used getGraphicsEnvironment to get fonts but my browser doesn't support it.I get ClassNotFoundException.
How can I get & make use True Type Fonts in my Java Applet.
Regards
SivaTo use getGraphicsEnvironment, you must convert your HTML with the HTMLConverter -- this will tell the browser not to use the native JVM to run your applet but to use a Java plugin to run the applet. If you cannot find HTMLConverter in your system, you may have to download it from Sun's web site.
V.V. -
Cannot get the correct data type in Oracle JDBC
Dear ALL:
I used JDBC ResultSetMetaData to get the column data type for Oracle Database. I created a table including 2 columns AAA, which is NUMBER type, BBB which is FLOAT type.
However, I found a problem that either NUMBER or FLOAT data types are reported as NUMBER type in JDBC.
IN SQL 2000, it is okay. SMALLINT, INT, TINYINT, etc..can be reported correctly.
Can anybody tell me that what's wrong here? I will be very appreciated.hi,
i guess its a bug which is fixed with 10i.
Elango. -
How can get & use java true type fonts in my applets
Hi
I could get the System fonts in my Applet by making use of Toolkit.getFontList()
I have used getGraphicsEnvironment to get fonts but my browser doesn't support it.I get ClassNotFoundException.
How can I get & make use True Type Fonts in my Java Applet.
any body knows reply immediate pls
Sivasimilar problem:
http://forum.java.sun.com/thread.jsp?forum=31&thread=164516
sorry, thats all i know.
tobias
Maybe you are looking for
-
Help plz
-
[how to delete the wallpaper in iPhone wallpaper folder ]
I don't like the wallpapers in iPhone wallpaper folder, how can I change the pictures of mine to wallpaper folder? PS. I found a free wallpaper site. It's wonderful, more than 30,000 pics! http://www.tootoo8.com and have many function, such as Favor
-
Pass parameters into iBot?
Hi, We are trying to use iBots to generate a set of PDF files for many different parameter combinations. Is it possible to pass parameters (like a parameter file) into an iBot and have it run the same answers request for each row in the parameter fil
-
Quality Issues and Green Strip at Right of Frame in Comp. 3.5
I just upgraded to Compressor 3.5 with my upgrade of FCS which includes FCP 7 (I guess this is FCS 3 even though the upgrade box doesn't say so). The quality of Compressor's outputs using the same settings is noticeably inferior to the previous versi
-
Teranex Mini, the economical choice in front of FCP?
My friend, the search function, did not have anything bad to say about Teranex. One poster said it was the best. In search of more information, I have gone to a review in Videography, suggested by Teranex. The reviewer has consulted for Teranex. Desp