Author |
Topic  |
|
gor
Retired Admin
    
Netherlands
5511 Posts |
Posted - 07 March 2001 : 17:31:00
|
Ok, first this: I do have to use ODBC for this, so no option doing this using OO4O (Oracle Objects for OLE)
When I store integers in INTEGER fields in the Oracle and retrieve them using ODBC and a Recordset they always display as being 0 If I store them as CHAR(5) however they display ok, I even didn't have to convert them to string first.
Is this the only option I've got, or are there other ways to store them as INTEGER and retrieve them using ODBC ?
Pierre< |
|
gor
Retired Admin
    
Netherlands
5511 Posts |
Posted - 09 March 2001 : 13:34:53
|
I changed the datatype to VARCHAR() but still don't know why I can't just use INTEGER
Pierre< |
 |
|
davemaxwell
Access 2000 Support Moderator
    
USA
3020 Posts |
Posted - 09 March 2001 : 14:15:18
|
You can't do a direct display of integer values because they are signed fields. You need to convert them to displayable fields (probably to character would be safest)
Dave Maxwell -------------- Proud to be a "World Class" Knucklehead < |
 |
|
gor
Retired Admin
    
Netherlands
5511 Posts |
Posted - 09 March 2001 : 14:48:41
|
I used character because that is easiest when used in combination with the other databases.
What on earth are signed fields ?
Pierre< |
 |
|
THWR
Starting Member
9 Posts |
Posted - 13 March 2001 : 05:00:40
|
this sounds a bit crazy, but -at least i needed to do this for my projects- you need to convert numerics to varchar2.
to_char(user.table.field) is the function for this
often you will also hae problems with the ODBC driver. the one from microsoft returns wrong field types (eg. nvarchar as varchar2, integer as varchar(1) etc). i dont know if this is fixed in the us version, but with the german driver u can forget using ODBC drivers. i use the COM Objects from oracle itself to connect:
at global.asa:
<OBJECT RUNAT=Server SCOPE=Application ID=OraSession PROGID="OracleInProcServer.XOraSession"></OBJECT>
and in the scripts
Set OraDatabase = OraSession.OpenDatabase("TNSListener","user/password",0)
for example. this works. or.. mhh... it works better that the ODBC driver 
< |
 |
|
THWR
Starting Member
9 Posts |
Posted - 13 March 2001 : 05:03:40
|
singed fields? these are numerics (dunno the english word for it) with a minus or plus sign. negative OR positive values with another range than unsigned fields.
singed int means values from -16535 to +16535, unsigned is from 0 to about 30000 (not exactly 
< |
 |
|
davemaxwell
Access 2000 Support Moderator
    
USA
3020 Posts |
Posted - 13 March 2001 : 08:02:28
|
quote:
What on earth are signed fields ?
Signed fields are integers with positive or negative possible values. The reason they can't be directly displayed is because they are stored in packed fields not straight storage like a character field. You'll probably want to convert the fields to character before trying to display...
Dave Maxwell -------------- Proud to be a "World Class" Knucklehead < |
 |
|
gor
Retired Admin
    
Netherlands
5511 Posts |
Posted - 13 March 2001 : 08:19:55
|
quote:
Signed fields are integers with positive or negative possible values. The reason they can't be directly displayed is because they are stored in packed fields not straight storage like a character field. You'll probably want to convert the fields to character before trying to display...
Ah, ok, well then it is just a matter of preference then I guess. At the moment I store them as characters and convert them to numeric when needed (i.e. when comparing the replycount with the hottopiccount) and otherwise I would store them as integers and convert them each time I display them. I think the first option takes less converting, and since that converting is unneeded for all the other databases, I think I'll stick with storing as character.
Thanks guys for the extra info ! 
Pierre< |
 |
|
Reinsnitz
Snitz Forums Admin
    
USA
3545 Posts |
Posted - 13 March 2001 : 13:20:46
|
ok... do we want to consider converting all of our non-ID numeric fields to Text fields? And handle the logic in the forum code?
Reinsnitz (Mike) ><)))'> Need a Mod? "Therefore go and make disciples of all nations,..." Matthew 28:19a< |
 |
|
davemaxwell
Access 2000 Support Moderator
    
USA
3020 Posts |
Posted - 13 March 2001 : 13:42:17
|
Either that (though, off the top of my head, I can't think of that many fields that would affect (ICQ, age,...) or I believe there IS a datatype in Oracle which doesn't require a sign, so it might not be packed.....
Dave Maxwell -------------- Proud to be a "World Class" Knucklehead < |
 |
|
gor
Retired Admin
    
Netherlands
5511 Posts |
Posted - 13 March 2001 : 18:55:36
|
Don't think we need to change anything for the other databases...the number of conversions doesn't decrease if you change the datatype for the others...it just is going to increase a bit because I'm going to have to add a few for Oracle to work ok.
Pierre< |
 |
|
|
Topic  |
|