Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

problem in getting Scope_Identity in Oracle????

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sally.mokhtar@gmail.com - 27 Mar 2008 13:47 GMT
Hi All,
i'm converting my website from connecting to SQL to Connect to Oracle DB and i'm reconfiguring the DataSets and TableAdapters for that .
i have function in a tableAdapter that insert in a table then get the SCOPE_IDENTITY() of the ID of the last inserted row .
This the Code that refer to SQL DB:

INSERT INTO [JobFunction] ([JobFunctionName]) VALUES (@JobFunctionName); SELECT SCOPE_IDENTITY()

And This the Code that refer to ORACLE DB:

INSERT INTO JOBFUNCTION
(JOBFUNCTIONNAME)
VALUES (:JOBFUNCTIONNAME);
SELECT JOBFUNCTION_SEQ.nextval
FROM dual

The proplem is the last code generate an error : ORA-00911 invaild character
that's because i use ; to separate the INSERT statment from SELECT statment
and if i remove the ; it generates another error : ORA-00933 sql command not properly ended !!!!!!!!!!
Please Help Meeeeeeeeeeeeeeeeeeeeeeeeee
David R. Longnecker - 27 Mar 2008 14:02 GMT
What about putting this logic into a stored procedure that accepts the values
you're entering and returns a number?

Another option, though I haven't tested it to see if it'd work, might be
to keep the code inline, but assign your next sequence value to an output
parameter and capture the output parameter via the OracleClient class or
however your data access code is structured.

HTH.

-dl

--
David R. Longnecker
http://blog.tiredstudent.com

> Hi All,
>
[quoted text clipped - 26 lines]
>
> Please Help Meeeeeeeeeeeeeeeeeeeeeeeeee

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.