>-----Original Message-----
>Subject: Get New Record ID in ORACLE
>From: "James Holmes" <[EMAIL PROTECTED]>
>Date: Thu, 9 Jun 2005 19:59:22 +0800
>Thread:
>http://www.houseoffusion.com/cf_lists/index.cfm/method=messages
>&threadid=40571&forumid=4#209077
>
>I should also have mentioned that there is an incredibly weird CF bug
>wherein an anonymous block like this in a CFC needs to be all on one
>line:
>
>BEGIN statement 1; .... etc; END;
>
>or it fails. Outside of a CFC it can be on more than one line (or you
>can cfinclude the cfquery tag into the CFC and it still works on more
>than one line). No I'm not kidding - I can repeat the bug at will.
i see the bug outside a CFC as well:
<cfquery name="anonplsqltest" datasource="trademak">
declare
nextid number;
begin
select s.nextval into nextid from dual;
end;
</cfquery>
throws
[Macromedia][Oracle JDBC Driver][Oracle]ORA-06550: line 1, column 8:
PLS-00103: Encountered the symbol "" when expecting one of the
following: begin function package pragma procedure subtype type use
form current cursor
whereas
<cfquery name="anonplsqltest" datasource="trademak">
declare nextid number; begin select s.nextval into nextid from dual;
end;
</cfquery>
doesn't throw an error.
but it doesn't return anything either:
<cfdump var="#anonplsqltest#">
throws
Variable ANONPLSQLTEST is undefined.
so you could use anonymous pl/sql to wrap several statements together in
a single database call, but i don't see how you could use it to get
things out from the db.
/t
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:209081
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