473,403 Members | 2,183 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

ORA-00933:SQL command not properly ended

Hi I am trying to update my table using this..

update tablename set sqlquery = 'select max(upd_rows) from tablename
where data_center='***' and tab_abbrev='***'' where userid='12345';

But am getting this error
ORA-00933:SQL command not properly ended

I dunno how to fix it.can anyone please help me out???

Thanks
Jan 22 '08 #1
4 17535
debasisdas
8,127 Expert 4TB
What are you trying do ? are you storing a sql query in a table ?

Please clairfy.
Jan 23 '08 #2
amitpatel66
2,367 Expert 2GB
Hi I am trying to update my table using this..

update tablename set sqlquery = 'select max(upd_rows) from tablename
where data_center='***' and tab_abbrev='***'' where userid='12345';

But am getting this error
ORA-00933:SQL command not properly ended

I dunno how to fix it.can anyone please help me out???

Thanks
Try this:

Expand|Select|Wrap|Line Numbers
  1.  
  2. update tablename set sqlquery = 'select max(upd_rows) from   tablename
  3. where data_center='||CHR(39)||'***'||CHR(39)||' and tab_abbrev='||CHR(39)||'***'||CHR(39)||'  and userid='||CHR(39)||'12345'||CHR(39);
  4.  
  5.  
Jan 23 '08 #3
ajmca
1
Hi I am trying to update my table using this..

update tablename set sqlquery = 'select max(upd_rows) from tablename
where data_center='***' and tab_abbrev='***'' where userid='12345';

But am getting this error
ORA-00933:SQL command not properly ended

I dunno how to fix it.can anyone please help me out???

Thanks
you have specified WHERE twice. try:

update tablename set sqlquery = 'select max(upd_rows) from tablename
where data_center='***' and tab_abbrev='***'' and userid='12345';

Also keep in mind yo are returning a number from this select statement. What is the datatype of sqlquery?
Feb 6 '08 #4
Hi I am trying to update my table using this..

update tablename set sqlquery = 'select max(upd_rows) from tablename
where data_center='***' and tab_abbrev='***'' where userid='12345';

But am getting this error
ORA-00933:SQL command not properly ended

I dunno how to fix it.can anyone please help me out???

Thanks
USE THIS

UPDATE EMP SET ENAME = 'select max(SUBSTR(JOB,1,2)) from EMP
where EMPNO=' || '7839' || 'and DEPTNO=''10' 'and userid='||'12345'
/

OR USE THIS FOR UPDATION INSTEAD OF DELETE

CREATE OR REPLACE PROCEDURE delete_all_rows
(p_tab_name IN VARCHAR2, p_rows_del OUT NUMBER)
IS
cursor_name INTEGER;
BEGIN
cursor_name := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(cursor_name, 'DELETE FROM '||p_tab_name,
DBMS_SQL.NATIVE );
p_rows_del := DBMS_SQL.EXECUTE (cursor_name);
DBMS_SQL.CLOSE_CURSOR(cursor_name);
END;
/

VARIABLE deleted NUMBER
EXECUTE delete_all_rows('employees', :deleted)
PRINT deleted
Feb 7 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Subrahmanyam Arya | last post by:
Dear oracle gurus, I am unable to get past the error ORA-12154: TNS: could not resolve service name on my host when using hsodbc to talk to a remote mysql database. i got from the meta link all...
6
by: Hari Om | last post by:
Here are the details of my error log files: I execute the command and get following message at console: ---------------------------------------------------------------------- ../sqlldr...
0
by: ʹÃûÑï | last post by:
ORA-03114: not connected to ORACLE && MS's Bug?? DataBase:Oracle 817 using OracleClient,net framework 1.1 I'm using ADO.Net in C# with Oracle 817. and following is my public data access...
10
by: CJM | last post by:
I'm trying to call a package/procedure in oracle (from an ASP page) which requires a number of parameters. I have got this working using OO40 but unfortunately the transaction rollback function...
5
by: mivey4 | last post by:
Hi, First off, I am aware that this is a very heavily documented error and I have done my homework for throughly researching probable causes before deciding to post my problem here. At this point,...
7
by: =?Utf-8?B?QVRT?= | last post by:
HOWTO Run multiple SQL statements from ASP/ADO to an Oracle 10g. Please help, I'm trying to write an ASP page to use ADO to run a long query against an Oracle 10g database, to create tables,...
0
by: truthbajaj | last post by:
Hi, I am using Oracle 9i and Unix on my system and trying to execute a UNIX shell command through external procedure in C. I created a shared lib (libextproc.so) for the following function. ...
0
by: gaikwadrachit | last post by:
Hi We are uploading a picture image(jpg) as a BLOB in a table using SQL Loader. We are parallely uploading the images at the same time from 2 different sessions on the server. The command for...
0
by: nkumarin001 | last post by:
Hi, I got stuck up when i was doing recovery. Please help me. I took backup of all the datafiles,redogfiles and controlfiles. I opened the database and created table called student....
0
by: nkumarin001 | last post by:
Hi, I got stuck up when i was doing recovery. Please help me. I opened the database in noarchivelog mode and inserted 5 records and made logswitch purposely but I dint gave any DML statements...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.