TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Awadhendra Tripahti
NA
87
2.3k
Not able to use same query in oracle
Sep 1 2014 8:28 AM
I am new in oracle so I am not able to write this query in Oracle its showing me some compile time error
main issues are:
1) Not able to use @@identity option which is in sql and return last inserted id (as its auto insert value)
ALTER PROCEDURE [dbo].[Insert_Update_Students](
,@SelectedCourse varchar(4000) = NULL
,@StudentID int = NULL
output
,@UserID int = NULL
,@YogaBefore bit = NULL
,@YourComment varchar(250) = NULL
)
AS BEGIN
SET NOCOUNT ON;
IF(@StudentID IS NULL OR @StudentID <= 0)
BEGIN
INSERT INTO Students( [AboutUs]
,[SelectedCourse]
,[UserID]
,[YogaBefore]
,[YourComment]
)
VALUES(
,@SelectedCourse
,@UserID
,@YogaBefore
,@YourComment
)
set @StudentID=@@identity;
END
ELSE
BEGIN
UPDATE Students SET [AboutUs]=@AboutUs
,[SelectedCourse]=@SelectedCourse
,[UserID]=@UserID
,[YogaBefore]=@YogaBefore
,[YourComment]=@YourComment
where
[StudentID]=@StudentID
END
END
Reply
Answers (
1
)
Convert Sql to Oracle script
DropDownlist Fill with cursor data from table