Hi,
Please help me in debugging the below procedure.
SQL> create or replace procedure pr_test_new
2 as
3 declare sql_stmt varchar2(100);
4 begin
5 sql_stmt:='sele ct * from price';
6 execute immediate sql_stmt;
7 end;
8 /
I am using oracle 8i
While creating this procedure I get the following warnings.
Warning: Procedure created with compilation errors.
LINE/COL ERROR
-------- -----------------------------------------------------------------
5/9 PLS-00103: Encountered the symbol "=" when expecting one of the
following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table LONG_ double ref
char binary national character nchar
The symbol "<an identifier>" was substituted for "=" to continue.
6/19 PLS-00103: Encountered the symbol "SQL_STMT" when expecting one
of the following:
:= . ( @ % ; not null range renames default character
Please help me in solving the above problem.
Thanks in advance,
Chella
11 3094
Hi,
Please help me in debugging the below procedure.
SQL> create or replace procedure pr_test_new
2 as
3 declare sql_stmt varchar2(100);
4 begin
5 sql_stmt:='sele ct * from price';
6 execute immediate sql_stmt;
7 end;
8 /
I am using oracle 8i
While creating this procedure I get the following warnings.
Warning: Procedure created with compilation errors.
LINE/COL ERROR
-------- -----------------------------------------------------------------
5/9 PLS-00103: Encountered the symbol "=" when expecting one of the
following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table LONG_ double ref
char binary national character nchar
The symbol "<an identifier>" was substituted for "=" to continue.
6/19 PLS-00103: Encountered the symbol "SQL_STMT" when expecting one
of the following:
:= . ( @ % ; not null range renames default character
Please help me in solving the above problem.
Thanks in advance,
Chella
Remove the keyword "DECLARE" from your code. DECLARE should be used only in anonymous blocks or triggers and not while creating function,proced ures
Thank you for the reply.
But when I tried the following code,
declare sql_stmt varchar2(100);
begin
sql_stmt:='sele ct * from parts';
execute immediate sql_stmt;
end;
I get the following error.
ERROR at line 5:
ORA-06550: line 5, column 9:
PLS-00103: Encountered the symbol "IMMEDIATE" when expecting one of the
following:
:= . ( @ % ;
Please help me to make this code work. Actually where could be the problem?
Regards,
Chella
Thank you for the reply.
But when I tried the following code,
declare sql_stmt varchar2(100);
begin
sql_stmt:='sele ct * from parts';
execute immediate sql_stmt;
end;
I get the following error.
ERROR at line 5:
ORA-06550: line 5, column 9:
PLS-00103: Encountered the symbol "IMMEDIATE" when expecting one of the
following:
:= . ( @ % ;
Please help me to make this code work. Actually where could be the problem?
Regards,
Chella
Are you sure the above code is erroring out?
It is working fine for me!!
Yes the above code gives me the error.
I am using oracle 8i. Hope that is not a problem.
Will 8i support 'execute immediate'?
Regards,
Chella
Yes the above code gives me the error.
I am using oracle 8i. Hope that is not a problem.
Will 8i support 'execute immediate'?
Regards,
Chella
Yes oracle 8i supports Dynamic SQL.firstly I checked that only.
Are you executing this code from a file or directly in SQL PLUS??
Yes oracle 8i supports Dynamic SQL.firstly I checked that only.
Are you executing this code from a file or directly in SQL PLUS??
I am directly executing the code in SQL plus.
Regards,
Chella
I am directly executing the code in SQL plus.
Regards,
Chella
Just curious,
can you put the declaration sql_stmt in the next line and then check if it executes?
Just curious,
can you put the declaration sql_stmt in the next line and then check if it executes?
I have tried that too...But still I have problem in executing the code.
I have a doubt here. Does the error mentioned in the above threads anyway mean that the oracle version which I am using doesn't support dynamic sql?
Regards,
Chella
I have tried that too...But still I have problem in executing the code.
I have a doubt here. Does the error mentioned in the above threads anyway mean that the oracle version which I am using doesn't support dynamic sql?
Regards,
Chella
The problem is its not taking as EXECUTE IMMEDIATE.
Instead, it is taking just EXECUTE command which is basically used to execute any procedure,funct ions etc.
Eg: Both are same:
EXECUTE proc1(a,b,c);
EXEC proc1(a,b,c);
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Peter |
last post by:
Company thought DB2 will be better than Oracle.
The bottom line is when you do select, the system crash.
I think it may take 4-5 years for DB2 to reach Oracle standard.
Peter
|
by: Jason Leiser |
last post by:
Is there a way to call an Oracle Procedure using the MS OLD DB Provider
for Oracle object in a SQL Server 2000 DTS package? If it can't be done
this way, is there another way to retrieve data from an Oracle database
using an Oracle procedure to a SQL Server table? Also, can parameters
be passed into Oracle from SQL Server via a procedure? Our Oracle DBA
does NOT want to create views to enable SQL Server to access the data.
Examples...
|
by: totierne |
last post by:
comp.databases.ms-access,
I want to know how to use Oracle views with session variables in
Access.
The parameterised views in access, are migrated to views with per
session
variables.
The open questions:
How to display a resultset
|
by: Magy |
last post by:
What would be the best way to execute a Oracle stored procedure that excepts
several input paramters, through a web method in vb.net. What would be a
good way to get to the web method, the Oracle stored procedure's definition;
the name of the proc. and all of the parameter information such as name,
value, type and value. I'm looking for the best method. Any ideas.
Magy
|
by: burtonl |
last post by:
I'm using the ADODB abstraction layer and trying to figure out how to
call an Oracle stored procedure.
It has the following types defined:
CREATE OR REPLACE TYPE varchar2_3200_array IS TABLE OF VARCHAR2(3200);
/
CREATE OR REPLACE TYPE number_array IS TABLE OF NUMBER;
/
| |
by: TattedProgrammer |
last post by:
Hello All,
I am completely stuck, I have tried for an entire day to get a simple
procedure call to my Oracle Db via the enterprise Library 06. I am not
an oracle fan to start, but have to deal with it for now. I am only
trying to retrieve data into a dataset from the oracle procedure,
nothing fancy! Here is my 100th version of code I have.
|
by: jehugaleahsa |
last post by:
Hello:
I am working with Oracle .NET Stored Procedures. I would like to know
how to return the results of a SELECT statement. I have tried
returning a OracleRefCursor and a DataTable, but nothing seems to
work.
What data type must I return for this to be accepted as .NET stored
procedure?
|
by: andrewkl |
last post by:
hi,
I have the following Perl code that inserts a string to an Oracle DB via a stored procedure:
#!/usr/local/bin/perl ## Perl v5.8.6 built for sun4-solaris
use strict;
BEGIN {
$ENV{'TNS_ADMIN'} = '/auto/engweb/oracle/sqlnet';
$ENV{'ORACLE_HOME'} = '/usr/packages/dbdoracle/9.2.0';
}
|
by: Gloops |
last post by:
Hello everybody,
Is anyone able to give me some indications about how to develop an
Access interface for an Oracle database ?
I dispose of Access 2003 (11.6566.8107) SP2, Oracle 9i 9.2.0.1.0 and
ODBC 3.525.1117.0, on Windows XP Pro 5.1.2600 SP2 Nu 2600.
I failed executing an Oracle stored procedure from Access, and a trigger
to store data to a temporary table was active from SQL*Plus, but
|
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 usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |