RE: date column part of primary key in Oracle

[prev] [thread] [next] [Date index for 2005/02/10]

From: Hartmaier Alexander
Subject: RE: date column part of primary key in Oracle
Date: 14:14 on 10 Feb 2005
Yes please update the Wiki section on Oracle dates.
But wouldn't it be easier and nicer to have a single unique key field 'or=
der_id'? Why can there be multiple rows with the same order_id in your ta=
ble?

-Alex


-----Urspr=FCngliche Nachricht-----
Von: Jim Brandt [mailto:cbrandt@xxxxxxx.xxx]=20
Gesendet: Dienstag, 8. Februar 2005 22:00
An: cdbi-talk@xxxxxx.xxxxx.xxx
Betreff: Re: date column part of primary key in Oracle

Amazing how posting to the list sharpens the mind :)

Yes, you can use dates in primary keys.

What you can't do is use functions like TO_CHAR in a set_sql statement=20=

that is selecting the records you want to use. I had a select statement=20=

that was doing a TO_CHAR on my enter_date and apparently CDBI didn't=20
like that when enter_date was in the primary key.

Strange thing is that it worked if enter date was in Essential.

Anyway, problem solved.

Would this warrant a change to the docs or at least a mention on the=20
Kwiki? I know I spent some time on it :)

Jim


On Feb 8, 2005, at 3:46 PM, Jim Brandt wrote:

>
> Is there something in CDBI that prevents you from having a date=20
> datatype as part of a primary key? I have a simple table with an=20
> order_id and an enter_date as the PKs. But when I list the enter_date=20=

> in the Primary section, it comes back empty when I fetch records. All=20=

> other columns have data.
>
> If I put enter_date in Essential, it works. The problem is, if I have=20=

> several records with the same order_id, CDBI spits them all out with=20=

> the same date since they all look the same to CDBI.
>
> Thanks for any insight.
>
> Jim
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> Jim Brandt
> Administrative Computing Services
> University at Buffalo
>
>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Jim Brandt
Administrative Computing Services
University at Buffalo


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*=
"*"*
Hinweis: Dieses E-mail kann vertrauliche und gesch=FCtzte Informationen e=
nthalten.
Sollten Sie nicht der beabsichtigte Empf=E4nger sein, verst=E4ndigen Sie =
bitte den Absender und l=F6schen Sie dieses E-mail dann sofort.

Notice: This e-mail contains information that is confidential and may be =
privileged.
If you are not the intended recipient, please notify the sender and then =
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*=
"*"*

date column part of primary key in Oracle
Jim Brandt 20:46 on 08 Feb 2005

Re: date column part of primary key in Oracle
Jim Brandt 20:59 on 08 Feb 2005

RE: date column part of primary key in Oracle
Hartmaier Alexander 14:14 on 10 Feb 2005

Re: date column part of primary key in Oracle
Jim Brandt 15:07 on 10 Feb 2005

Generated at 10:21 on 11 Feb 2005 by mariachi v0.52