To do "autonumbering" you have to create a sequence and a trigger, to
the best of my knowledge Toad does not provide a shortcut to creating
these. I just edit a small snippet of code to reflect whatever table
i need it for, such as:
CREATE SEQUENCE SEQ_ACTIVITYLOG
START WITH 1
MAXVALUE 1E27
MINVALUE 1
NOCYCLE
CACHE 20
NOORDER;
CREATE OR REPLACE TRIGGER ITM.TRG_ACTIVITYLOG
BEFORE INSERT ON ITM.ACTIVITYLOG REFERENCING OLD AS OLD NEW AS
NEW
FOR EACH ROW
DECLARE
x INTEGER;
BEGIN
IF :new.ID is null THEN
SELECT SEQ_ACTIVITYLOG.NEXTVAL INTO x FROM DUAL;
:new.ID := x;
END IF;
END;
I just dumped those out of Toad, but at least put you down the right
path, you probably can find countless examples of this via a google
search.
As far as the CFQUERies, your functions are going to be different
between the two databases and the way you do joins might end up
needing some changes. Will depend on what version of Oracle as to how
different joins might need to be done.
--
Aaron Rouse
http://www.happyhacker.com/
On Fri, 7 Jan 2005 09:13:47 -0500, Stuart Kidd <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> I'm about to start on a new project at my current contract for which i've had
> them buy CF (and for once i didn't take too much convincing).
>
> In the past (and present) I connect to an MS-SQL database which i've grown to
> love.
>
> At work however, it's all Oracle. I've connected it using the CF
> Administrator and am using TOAD to add tables etc.
>
> Before i start coding i'm wondering if my CFQUERYies will be different to
> those I have created for MS-SQL in anyway?
>
> Thanks for your help,
>
> Stu
>
> ps: also, does anyone know how to create an incremental number for an INT in
> TOAD (it's for an PK id)?
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the mailserver that powers this list at
http://www.houseoffusion.com/banners/view.cfm?bannerid=17
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:189629
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54