LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-22-2022, 05:26 AM   #1
SarthakJain
LQ Newbie
 
Registered: Jul 2022
Location: India
Posts: 3

Rep: Reputation: 0
Getting error in Drop command in sql


Code:
CREATE OR REPLACE PACKAGE Students2 AS
  PROCEDURE proce(f_name varchar2, l_name varchar2);
END;

CREATE OR REPLACE PACKAGE BODY Students2 AS
  PROCEDURE proce(f_name varchar2, l_name varchar2) IS
  BEGIN
   INSERT INTO Stu2(f_name, l_name) VALUES(f_name, l_name);
  END;
END Students2;

BEGIN
  Students2.proce('bat', 'man');
END;
this code runs accurately and batman gets embedded in the table which I made.

in any case, with regards to dropping the bundle

Code:
DROP PACKAGE Students2;
it gives this error;

SQL Error [933] [42000]: ORA-00933: SQL command not properly ended

What could I be missing? Can anybody suggest with a solution as I already tried researching on google and read many articles like on the wiki, Scaler, Oracle etc.

Thanks in Advance!
 
Old 09-22-2022, 05:45 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,353
Blog Entries: 1

Rep: Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656
Did you try it with Sql*Plus?
 
Old 09-22-2022, 06:12 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 18,997

Rep: Reputation: 6449Reputation: 6449Reputation: 6449Reputation: 6449Reputation: 6449Reputation: 6449Reputation: 6449Reputation: 6449Reputation: 6449Reputation: 6449Reputation: 6449
probably helps: https://www.tekstream.com/resource-c...roperly-ended/
 
Old 09-22-2022, 08:28 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 25,308

Rep: Reputation: 7531Reputation: 7531Reputation: 7531Reputation: 7531Reputation: 7531Reputation: 7531Reputation: 7531Reputation: 7531Reputation: 7531Reputation: 7531Reputation: 7531
Quote:
Originally Posted by SarthakJain View Post
Code:
CREATE OR REPLACE PACKAGE Students2 AS
  PROCEDURE proce(f_name varchar2, l_name varchar2);
END;

CREATE OR REPLACE PACKAGE BODY Students2 AS
  PROCEDURE proce(f_name varchar2, l_name varchar2) IS
  BEGIN
   INSERT INTO Stu2(f_name, l_name) VALUES(f_name, l_name);
  END;
END Students2;

BEGIN
  Students2.proce('bat', 'man');
END;
this code runs accurately and batman gets embedded in the table which I made. in any case, with regards to dropping the bundle
Code:
DROP PACKAGE Students2;
it gives this error; SQL Error [933] [42000]: ORA-00933: SQL command not properly ended

What could I be missing? Can anybody suggest with a solution as I already tried researching on google and read many articles like on the wiki, Scaler, Oracle etc.
Your profile says that you're a computer-science and engineering graduate...but this is very obviously a homework question. And you are posting no details at all, such as what database (assuming Oracle), on what platform, and the context of what you're doing. Is this a stored procedure/function?? Where does the drop package statement come into play, since it's not in the 'code' you posted initially??

Ask a clear question and explain what you're trying to do, because all we can tell you now is exactly what you can look up for that error message; and I would suggest you look at what you posted, and think about it.
 
Old 09-22-2022, 10:43 AM   #5
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,353
Blog Entries: 1

Rep: Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656
In some contexts, simple SQL statements aren't terminated with ';'semicolon, but PL/SQL blocks are.
In other contexts (e.g. Sql*Plus) ';'semicolon is always used, but PL/SQL blocks are to be terminated with a '/'slash e.g.
Code:
BEGIN
dbms_output.put_line('Hi');
END;
/
 
Old 09-25-2022, 01:44 AM   #6
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,944

Rep: Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168
May we confirm that you have logged in to a fresh connection and only typed the drop command?

Did you type it or copy it?

Are you logged in to an appropriate schema to be able to drop it?

Also, not sure why you would provide a link to "drop table" when you are trying to drop a package?
 
1 members found this post helpful.
  


Reply

Tags
sql


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FreeRadius: Failed to open file '/etc/freeradius/sql/mysql/schema.sql', error: 13 firewallengineer Linux - Networking 1 07-20-2016 02:43 PM
[SOLVED] How to describe table structure in PL/SQL developer IDE through sql command? fantasy1215 Programming 2 04-14-2013 08:20 PM
Is it necessary to drop specific flags in IPTABLES with an INPUT DROP policy? rootaccess Linux - Networking 5 08-22-2012 08:10 PM
Drop connections to port 80 at firewall machine also drop at protected network? Niceman2005 Linux - Security 2 10-27-2005 08:21 AM
iptables - drop all -> allow needed OR allow all -> drop specific lucastic Linux - Security 5 12-21-2004 02:07 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration