Re: date column part of primary key in Oracle
[prev]
[thread]
[next]
[Date index for 2005/02/08]
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
that is selecting the records you want to use. I had a select statement
that was doing a TO_CHAR on my enter_date and apparently CDBI didn't
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
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
> datatype as part of a primary key? I have a simple table with an
> order_id and an enter_date as the PKs. But when I list the enter_date
> in the Primary section, it comes back empty when I fetch records. All
> other columns have data.
>
> If I put enter_date in Essential, it works. The problem is, if I have
> several records with the same order_id, CDBI spits them all out with
> the same date since they all look the same to CDBI.
>
> Thanks for any insight.
>
> Jim
>
> ==========================================
> Jim Brandt
> Administrative Computing Services
> University at Buffalo
>
>
==========================================
Jim Brandt
Administrative Computing Services
University at Buffalo
|
|
Re: date column part of primary key in Oracle
Jim Brandt 20:59 on 08 Feb 2005
|