Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 28-09-2008, 07:52 PM   #1 (permalink)
Alpha Geek
 
raksrules's Avatar
 
Join Date: Nov 2006
Location: Mumbai <-> Pune
Posts: 527
Unhappy [IMP] Need help with PL/SQL


This query may seem to be simple for some but i am not able to get how to achieve this. The scene is that i have a Lines table (say tab_lines) having 70 to 80 columns(approx). Now in this table i have a few columns starting at col8 to col65 (these are actual column names). Now my problem is that i need to look at the values in each of these columns (i.e. 8 to 65) for a value and do processing accordingly. This has to be done for each row in the table.

In gist, in need to check the value of each of the columns from col8 to col65 for each row in the tab_lines table. How do i do the looping to achieve this ? I have a rough idea that it will be nested loops wherein i will make a cursor that will select all the rows from the tab_lines table and open this cursor in a FOR loop. But after this i dont know how to loop through each of the columns (i.e. col8 to col65) in this row.

Please help me in this.
raksrules is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 28-09-2008, 07:58 PM   #2 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: [IMP] Need help with PL/SQL

If you can tell us how you want to process the fields, we can help you better. As of now,I really didn't get what you want. I understood that in a row, not all columns will contain data, but I don't get what you mean by 'processing' the data.
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता
victor_rambo is offline  
Old 28-09-2008, 07:59 PM   #3 (permalink)
God of Mistakes...
 
Garbage's Avatar
 
Join Date: Dec 2005
Location: Pune, Maharashtra
Posts: 1,923
Default Re: [IMP] Need help with PL/SQL

Me too not getting what he wants
__________________
Registered Linux User #468778
----------------------------------
http://twitter.com/_Garbage_
Garbage is offline  
Old 28-09-2008, 08:09 PM   #4 (permalink)
Alpha Geek
 
raksrules's Avatar
 
Join Date: Nov 2006
Location: Mumbai <-> Pune
Posts: 527
Default Re: [IMP] Need help with PL/SQL

Sorry for the confusion. I will try to explain in a better way.

I have a lines table tab_lines which has 70 - 80 cols

The table structure is some what like this

Header_Id number;
Line_Id number;
col8 number;
col9 number;
.......
col65 number;

Now i want to loop through all the columns (col8 to col65) in the table tab_lines for each of the row. Its something like this

For each row in tab_lines loop

Loop through col 8 to col65
<insert data into some xyz table> --this is processing
end loop

end loop


So effectively on the basis of each value that i retrieve i need to insert data in a particular table. This is what i meant by processing. And i need to select the data for each of the cols (8 to 65) for each of the row. I mean for a single row there will be 57 times looping (65-8) and i will need to insert 57 rows in table xyz for each row in tab_lines
raksrules is offline  
Old 28-09-2008, 08:17 PM   #5 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: [IMP] Need help with PL/SQL

ok, so basically, you want to perform INSERT queries on the table, correct? and you want to INSERT data into each of the col8 to col65 in loops?

Where will you be entering the values from? A CSV file, tab delimited text file, HTML table? or something other?
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता
victor_rambo is offline  
Old 28-09-2008, 08:20 PM   #6 (permalink)
Alpha Geek
 
raksrules's Avatar
 
Join Date: Nov 2006
Location: Mumbai <-> Pune
Posts: 527
Default Re: [IMP] Need help with PL/SQL

No No, I need to add some data (the values for which i have retrieved already) in a diff table xyz depending on the values of col8 to col65 ) of the table tab_lines. Insertion wont happen on the tab_lines table but in some other table xyz
raksrules is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by clinton
- by soumya
- by Sujeet
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 11:13 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2