473,573 Members | 4,482 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ora_parse error - whats wrong?

Hi folks,
this one's had me stumped!

$conn=ora_logon ("cricketunes@p ickles","j8j3kf ");
if ($conn != TRUE)
die("Unable to connect to oracle, exiting...\n");

$cursor = ora_open($conn) ;
if ($cursor != TRUE)
die("Unable to open a cursor, exiting...\n");

$result = ora_parse($curs or,$query);
if ($result != TRUE)
die("Unable to parse SQL block<BR>");

Warning: Ora_Parse failed (ORA-00911: invalid character -- while
processing OCI function OPARSE) in add.php on line 33

What is wrong with my ora_parse function call??

Puzzled,
Benny

Jul 17 '05 #1
9 3832
This is what the query has:
insert into movie
values('M081',' saefa','VHS','s d',44,'Comedy', 'sdfsf');

Jul 17 '05 #2
cr*********@yah oo.com wrote:
This is what the query has:
insert into movie
values('M081',' saefa','VHS','s d',44,'Comedy', 'sdfsf');


Try naming the columns if you use VALUES keyword.
eg:

INSERT INTO tbluser (userid, username) VALUES (1,'cricket');

Regards,
Erwin Moller

Jul 17 '05 #3

Erwin Moller wrote:
cr*********@yah oo.com wrote:
This is what the query has:
insert into movie
values('M081',' saefa','VHS','s d',44,'Comedy', 'sdfsf');


Try naming the columns if you use VALUES keyword.
eg:

INSERT INTO tbluser (userid, username) VALUES (1,'cricket');


This is what happens:
1. A simple SELECT query works.
2. INSERT into movies values('a','a', 'a','a',55,'a', 'a');
This doesnt work.

Whats the prob with INSERT queries? They're just not working with
ora_parse.

:(

Jul 17 '05 #4
cr*********@yah oo.com wrote:

: Erwin Moller wrote:
: > cr*********@yah oo.com wrote:
: >
: > > This is what the query has:
: > > insert into movie
: > > values('M081',' saefa','VHS','s d',44,'Comedy', 'sdfsf');
: >
: > Try naming the columns if you use VALUES keyword.
: > eg:
: >
: > INSERT INTO tbluser (userid, username) VALUES (1,'cricket');
: >

: This is what happens:
: 1. A simple SELECT query works.
: 2. INSERT into movies values('a','a', 'a','a',55,'a', 'a');
: This doesnt work.

: Whats the prob with INSERT queries? They're just not working with
: ora_parse.

Does that insert statement work as-is from sqlplus?


--

This space not for rent.
Jul 17 '05 #5
On 14 Apr 2005 03:58:35 -0700, cr*********@yah oo.com wrote:
Hi folks,
this one's had me stumped!

$conn=ora_logo n("cricketunes@ pickles","j8j3k f");
Don't use ora_logon, that's for Oracle 7, which is long dead. Use the OCI
extension, i.e. OCILogon (PHP 4) or oci_logon (PHP 5 - OCILogon still works
there though as an alias).
if ($conn != TRUE)
die("Unable to connect to oracle, exiting...\n");

$cursor = ora_open($conn) ;
if ($cursor != TRUE)
die("Unable to open a cursor, exiting...\n");

$result = ora_parse($curs or,$query);
if ($result != TRUE)
die("Unable to parse SQL block<BR>");

Warning: Ora_Parse failed (ORA-00911: invalid character -- while
processing OCI function OPARSE) in add.php on line 33

What is wrong with my ora_parse function call??
And later you post:
This is what the query has:
insert into movie
values('M081', 'saefa','VHS',' sd',44,'Comedy' ,'sdfsf');


You do not put a semicolon at the end of statement in calls to OCI. That's
only for PL/SQL or when you're in SQL*Plus.

The semicolon will result in ORA-00911.

--
Andy Hassall / <an**@andyh.co. uk> / <http://www.andyh.co.uk >
<http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #6
Yep Malcolm. I manually type the same thing from sql and it works:

SQL> describe movie;
Name Null? Type
----------------------------------------- -------- --------------
MOVIEID NOT NULL VARCHAR2(4)
TITLE NOT NULL VARCHAR2(60)
TYPE NOT NULL VARCHAR2(3)
DIRECTOR NOT NULL VARCHAR2(40)
YEAR NOT NULL NUMBER
CATEGORY NOT NULL VARCHAR2(12)
DESCRIPTION VARCHAR2(50)

Manual Insert:
----------------------------------
SQL> INSERT into movie values('a','a', 'a','a',55,'a', 'a');
1 row created.

PHP code segment:
-------------------------------------------------------------------------------------
$query="insert into movie values('a','a', 'a','a',55,'a', 'a');";
print $query;

Output:
--------------------------------------------------------------------
insert into movie values('a','a', 'a','a',55,'a', 'a');
Warning: Ora_Parse failed (ORA-00911: invalid character -- while
processing OCI function OPARSE) in
G:\cpsc462\stud ents\prabhur\ad dmov.php on line 35
Unable to parse SQL block
Lines 35-37:
-----------------
$result = ora_parse($curs or,$query);
if ($result != TRUE)
die("Unable to parse SQL block<BR>");

Jul 17 '05 #7
Yep Malcolm. I manually type the same thing from sql and it works:

SQL> describe movie;
Name Null? Type
----------------------------------------- -------- --------------
MOVIEID NOT NULL VARCHAR2(4)
TITLE NOT NULL VARCHAR2(60)
TYPE NOT NULL VARCHAR2(3)
DIRECTOR NOT NULL VARCHAR2(40)
YEAR NOT NULL NUMBER
CATEGORY NOT NULL VARCHAR2(12)
DESCRIPTION VARCHAR2(50)

Manual Insert:
----------------------------------
SQL> INSERT into movie values('a','a', 'a','a',55,'a', 'a');
1 row created.

PHP code segment:
-------------------------------------------------------------------------------------
$query="insert into movie values('a','a', 'a','a',55,'a', 'a');";
print $query;

Output:
--------------------------------------------------------------------
insert into movie values('a','a', 'a','a',55,'a', 'a');
Warning: Ora_Parse failed (ORA-00911: invalid character -- while
processing OCI function OPARSE) in
G:\cpsc462\stud ents\prabhur\ad dmov.php on line 35
Unable to parse SQL block
Lines 35-37:
-----------------
$result = ora_parse($curs or,$query);
if ($result != TRUE)
die("Unable to parse SQL block<BR>");

Jul 17 '05 #8
cr*********@yah oo.com wrote:

Erwin Moller wrote:
cr*********@yah oo.com wrote:
> This is what the query has:
> insert into movie
> values('M081',' saefa','VHS','s d',44,'Comedy', 'sdfsf');


Try naming the columns if you use VALUES keyword.
eg:

INSERT INTO tbluser (userid, username) VALUES (1,'cricket');
Well, did you actually TRY my suggestion cricket?

Your SQL is just not valid.

The fact that SQL+ will correct your faulty SQL-statement, made you believe
it was correct.

insert into movie
(columnname1,co lumnname2,colum nname3,columnna me4,columnname5 ,columnname6,co lumnname7)
values('M081',' saefa','VHS','s d',44,'Comedy', 'sdfsf');

Replace the columnname1 - 7 by real columnnames.


This is what happens:
1. A simple SELECT query works.
2. INSERT into movies values('a','a', 'a','a',55,'a', 'a');
This doesnt work.

Whats the prob with INSERT queries? They're just not working with
ora_parse.

:(


Jul 17 '05 #9
On Fri, 15 Apr 2005 09:58:51 +0200, Erwin Moller
<si************ *************** *************** @spamyourself.c om> wrote:
> This is what the query has:
> insert into movie
> values('M081',' saefa','VHS','s d',44,'Comedy', 'sdfsf');

Try naming the columns if you use VALUES keyword.
eg:

INSERT INTO tbluser (userid, username) VALUES (1,'cricket');


Well, did you actually TRY my suggestion cricket?

Your SQL is just not valid.


Is too. If you don't name the columns, then "all columns" is assumed. It
wouldn't raise ORA-00911, that's likely caused by the semicolon as I said
earlier.

--
Andy Hassall / <an**@andyh.co. uk> / <http://www.andyh.co.uk >
<http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3042
by: Paul | last post by:
I thought this is more of an IE issue but i've had no joy on that group perhaps somebody here will have a clue. If i click a link to a web page embedded in Excel (97 OR 2000) i get the standard error page displayed by IE (you know, the 'cannot find server or dns error' page). Turning off 'show friendly http error messages' alleviates this....
15
5831
by: Johan | last post by:
Hi, I've been working on the following piece of code and it works fine in IE and Opera, dut keep getting the same error in Firefox. Can anyone tell me what's wrong with this code? What I'm trying to do is rewrite the left (navigationframe) and load a page on the right (mainframe). tia, Johan
3
10155
by: KemperR | last post by:
Hello Experts outhere, may be someone can tell me whats going wrong with my ADOX trial. I have an Access 2002 database with some tables and queries (views) The code listed below works well up to the point where I want to add the new view to the views collection. I get Runtime error 3001 which is telling me "Arguments are of wrong...
9
24168
by: CQ | last post by:
Hi everyone, I get the following error when compiling my code: error: invalid initialization of non-const reference of type 'Vertex&' from a temporary of type 'int' The implementation of the function is as follows: Vertex& IGEdge::Mate (Vertex const& vertex) {
7
2220
by: Mike Barnard | last post by:
It's a simple test... VERY SIMPLE. But... In an external stlyesheet some attributes don't show. With the same styles cut and pasted to the test internally it works as expected. Anyone tell me why? Its probably sooooooo obvious, but it is 1.19 am! Thanks. www.thunderin.co.uk/
10
4948
by: ApexData | last post by:
Private Sub Command35_Click() MsgBox (BestSoundex2(, 6)) DoCmd.RunSQL "UPDATE SET = (BestSoundex2(, 6))" End Sub The Msgbox displays just fine, but the SQL statement gives the following error: Undefined Function 'BestSoundex2' In expression
1
12577
by: Pradeep83 | last post by:
Hi All, Good Morning Here I am jotdowning my problem I am compiling a .c file in Free BSD 6.0 and exceuting there itself. and i have taken that a.out file to properiarty routing operating system which is varaint of Free BSD , when i excute that a.out file there uisng the command ./a.out its...
0
1292
by: cuddles | last post by:
hi im using IBM DB2 version 8 i have a procedure that should delete an error log table DELETE FROM TABLE1.ERR_MSG_LOG WHERE DATE(CRT_S) < (CURRENT DATE - 30 DAYS); but i keep getting this error: A database manager error occurred. CLI0604E CallableStatement get*** method was called without calling execute. SQLSTATE=S1010
4
3924
by: (2b|!2b)==? | last post by:
template <typename T1, typename T2> struct MyDbInfo { MyDbInfo():m_pEnv(0), m_tran(0), m_db(0), m_idx(0) {} MyDbInfo(CDbEnv *env, DbTxn* tran, T1* db_ptr, T2 *idx_ptr):m_pEnv(env), m_tran(tran), m_db(db_ptr), m_idx(idx_ptr) {}
0
7741
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8167
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7730
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8028
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5550
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5252
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3688
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1263
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
987
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.