473,379 Members | 1,317 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,379 software developers and data experts.

Issue with Cursor in the Stored Procedure. Please help as soon as possible!

Hi,
I have a Stored Proc created as:

Expand|Select|Wrap|Line Numbers
  1. CREATE OR REPLACE   PROCEDURE           COMP_RECORDS
  2.     IS
  3.     l_query          VARCHAR2 (10000) := '';
  4.  
  5.     CURSOR TBL1
  6.     IS
  7.     SELECT TABLE_NAME, COLUMN_NAME FROM COLS_TO_COMP WHERE TABLE_NAME='SECMASTER_HISTORY';
  8.     TBL1_REC              APP_DEVELOPMENT.COLS_TO_COMP%rowtype;
  9.  
  10.     BEGIN                
  11.         For tbl1_rec in tbl1
  12.         loop
  13.                 l_query := 'INSERT INTO TEST2 SELECT a.'||TBL1_REC.COLUMN_NAME || 'FROM security.secmaster_history a where a.security_alias=18330 and a.src=60254'; 
  14.                  EXECUTE IMMEDIATE l_query;
  15.                 COMMIT;
  16.         end loop;
  17.     END;
when i am running this i am getting an exception as ora-00923: From keyword not found where expected.
Can anyone help please...its urgent!
Jul 25 '13 #1
1 1504
rski
700 Expert 512MB
Looks like you missed space between FROM

Should be
Expand|Select|Wrap|Line Numbers
  1. ' FROM security.secmaster_history a where a.security_alias=18330 and 
  2.  
Jul 25 '13 #2

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

Similar topics

6
by: hurricane | last post by:
Hi to all, excuse my english ( i'm an italian student... ) I have the necessity of make a stored procedure that convert one parameter passed from base64 to binary before store in a field...
5
by: Guoqi Zheng | last post by:
Dear sir, I am about to finish a new asp.net application, I used a lot of ms sql stored procedure. Those stored procudure I think is the most important part of the application. Now I am about...
1
by: larry mckay | last post by:
hi, I'm trying to update a database using a stored procedure from a data grid. the database is not updating using this code with the new dbgrid. can anyone figure out where the problem/issue is? ...
0
by: leenap | last post by:
I was just wondering if you could help me out with this query - I have an instance created within which you have 3 databases say A , B and C. I have a Stored Procedure created in A say...
1
by: MDB | last post by:
Hello all, I know this may not be the correct group but was hoping someone could help anyway. I have a stored procedure that is not returning the correct information. For some reason it is not...
2
by: karups | last post by:
Hi, I've got listbox in my .aspx page where the users can make multiple selection. So, Users can select any number of items in listbox, I have to take value from items and pass it to stored...
17
by: Riaaaa | last post by:
Pls check my code for the stored procedure which i created for the companydetails including companyid P.K. Not Null int(4), companyname Not Null varchar (20), address varchar(30) where...
0
by: Riaaaa | last post by:
Hello members, This is the SQL SERVER 2005 stored procedure. It contains the data from the two diff tables. (1)Customer : Here clpid and cardid are composite primary keys with the identity...
4
by: Simon Gare | last post by:
Hi need a stored procedure to replace the 4 commands listed below UPDATE dbo.booking_form SET total_cost = mileage_charge + waiting_charge + CarParkToDriver UPDATE dbo.booking_form SET VAT =...
0
by: db2user24 | last post by:
I'm trying to invoke a DB2 stored procedure. The stored proc is coded in C and compiled to a shared library, which has been placed in the <DB2 dir>/functions directory. The platform is Linux (using...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.