
Marilyn Miers
|
| Posted: 03/17/2002, 5:05 AM |
|
Dear Codecharge,
I have two questions to ask.
1.Can Oracle database create numbers that support the Autonumber feature of
Access? From what I read, the answer would be No.
2. This question is related. How do I use CodeCharge to connect to Oracle
and make it act like an Autonumber?
Meaning, since Oracle can't support Autonumber.. Say this table > ProjectID,
ProjectTitle. When a user inserts a new projet, he only needs to key in
ProjectTitle. The ProjectID is a hidden field that somehow takes the
previous record's ProjectID number and increments it by one. Something of
that sort. Is there any way>
Yours,
Ler Ping
|
|
|
 |
Wee Ler Ping
|
| Posted: 03/17/2002, 6:16 AM |
|
I think it's called A trigger but have no idea how to do it
|
|
|
 |
Glenn Holden
|
| Posted: 03/17/2002, 9:32 AM |
|
Oracle has to have a nice way to Autonumber.... it's so fundamental. You
will probably have better luck posting the question to an Oracle newsgroup,
though.
Glenn
"Wee Ler Ping" <weesulin@singnet.com.sg> wrote in message
news:a728f7$e0v$1@news.codecharge.com...
> I think it's called A trigger but have no idea how to do it
>
>
|
|
|
 |
Ken Hardwick
|
| Posted: 03/17/2002, 6:10 PM |
|
The best way would be to use Oracle Sequence. I have not worked with it but
you might do a search on the web on how to use it.
I am using ASP and Oracle. I wrote and put in my global functions the
following.
Then I use it in the "before insert event" to get the next number available.
fldPrimField = Next_ID("tablename","Prim_Field","")
Also..note..that since this is not a autonumber field, you will need to have
the "Prim_Field" in your form twice...mark as primary/hide/rename one
instance,
and have the other hidden but not marked a primary. The one not marked as
primary will be the one you will assign the next_id to .
Then, you will need a different page for the edit of the same record.
Function Next_ID(T,F,W)
kenSQL = "Select max(" & F & ")+1 as next_One from " & T
if W <> "" then
kenSQL = kenSQL & " where " & W
end if
openrs rs2, kenSQL
if rs2.eof = true then
Next_id = 1
else
Next_Id = rs2("Next_one")
end if
rs2.close
set rs2 = nothing
End Function
Marilyn Miers <mimaclit69@hotmail.com> wrote in message
news:a724ac$62k$1@news.codecharge.com...
> Dear Codecharge,
>
> I have two questions to ask.
> 1.Can Oracle database create numbers that support the Autonumber feature
of
> Access? From what I read, the answer would be No.
> 2. This question is related. How do I use CodeCharge to connect to Oracle
> and make it act like an Autonumber?
>
> Meaning, since Oracle can't support Autonumber.. Say this table >
ProjectID,
> ProjectTitle. When a user inserts a new projet, he only needs to key in
> ProjectTitle. The ProjectID is a hidden field that somehow takes the
> previous record's ProjectID number and increments it by one. Something of
> that sort. Is there any way>
>
> Yours,
> Ler Ping
>
>
|
|
|
 |
|

|