ORA-06550: line 1, column 8: PLS-00103 [message #350409] |
Thu, 25 September 2008 00:04  |
wasimhc
Messages: 8 Registered: September 2008
|
Junior Member |
|
|
I have got the following error:
Warning: oci_execute() [function.oci-execute]: ORA-06550: line 1, column 8: PLS-00103: Encountered the symbol "" when expecting one of the following: begin function package pragma procedure subtype type use <an identifier> <a double-quoted delimited-identifier> form current cursor in E:\Web\WebServer\Apache2\htdocs\login5\test_bfile_select.php on line 48
1: /
My code is in PHP with oracle procedure as follows:
<?php
$conn = oci_connect('scott', 'tiger', '//localhost/orcl');
$sql = "SELECT
id
FROM
mylobs
WHERE
-- Select only BFILES which are not null
mybfile IS NOT NULL";
$stmt1 = oci_parse($conn, $sql);
oci_execute($stmt1)
or die ("Unable to execute query\n");
$sql = "DECLARE
locator BFILE;
diralias VARCHAR2(30);
filename VARCHAR2(30);
BEGIN
SELECT
mybfile INTO locator
FROM
mylobs
WHERE
id = :id;
-- Get the filename from the BFILE
DBMS_LOB.FILEGETNAME(locator, diralias, filename);
-- Assign OUT params to bind parameters
:diralias:=diralias;
:filename:=filename;
END;";
$stmt2 = oci_parse($conn, $sql);
while ( $row = oci_fetch_assoc ($stmt1) ) {
oci_bind_by_name($stmt2, ":id", $row['ID']);
oci_bind_by_name ($stmt2, ":diralias", $diralias,30);
oci_bind_by_name ($stmt2, ":filename", $filename,30);
oci_execute($stmt2);
print "{$row['ID']}: $diralias/$filename\n";
}
oci_close($conn);
?>
[Edit MC: add code tags]
[Updated on: Thu, 25 September 2008 01:19] by Moderator Report message to a moderator
|
|
|
|
Re: ORA-06550: line 1, column 8: PLS-00103 [message #352429 is a reply to message #350409] |
Tue, 07 October 2008 10:21   |
wasimhc
Messages: 8 Registered: September 2008
|
Junior Member |
|
|
This code is based on PHP and Oracle. Only the following code is PL/SQL based:
DECLARE
locator BFILE;
diralias VARCHAR2(30);
filename VARCHAR2(30);
BEGIN
SELECT
mybfile INTO locator
FROM
mylobs
WHERE
id = :id;
-- Get the filename from the BFILE
DBMS_LOB.FILEGETNAME(locator, diralias, filename);
-- Assign OUT params to bind parameters
:diralias:=diralias;
:filename:=filename;
END;
|
|
|
|
|
|
Re: ORA-06550: line 1, column 8: PLS-00103 [message #352544 is a reply to message #352488] |
Wed, 08 October 2008 05:55   |
wasimhc
Messages: 8 Registered: September 2008
|
Junior Member |
|
|
Thanks for reply.
In this PL/SQL procedure, there are declared 3 variables (ID, FILENAME, DIRALIAS). ID is input variable and other 2 are output variables which contain results.
Do I have to DEFINE/DECLARE out parameters.
Regards,
Wasim
|
|
|
|
|
Re: ORA-06550: line 1, column 8: PLS-00103 [message #413585 is a reply to message #354353] |
Thu, 16 July 2009 09:08  |
dfox
Messages: 1 Registered: July 2009 Location: Buffalo, NY
|
Junior Member |
|
|
Greetings,
Whenever I've run into this:
PHP Code generating
ORA-06550 and
Encountered the symbol "" in the error
and the PL/SQL code executes fine in something like SQL*PLUS.
The issue has been the dos vs unix end-of-line, carriage return/newline vs newline.
If you are on a Linux/Unix system I would suggest executing an:
od -cx {filename} on the PHP file and inspecting for that.
and/or
dos2unix {filename} to change the end-of-line to unix and
trying again.
Luck,
Dave
|
|
|