Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python extract
#1
Hi Team,

I am calling a stored procedure , and it is giving me output of 20 columns and 16 records below it.
result = cursor.fetchall()

my requirement now.

I want specific columns from result. cursor.
col1,col2,col3,col4,col5,col6,col7,col8,col12,col15.

1) I have one solution in my mind.
select col1,col2,col3,col4,col5,col6,col7,col8,col12,col15. from table1.

But I want data from result records.


fetchall gives below result.
helper1 helper2 helper3 helper5 col6 col7 col8 col9 col10
xxx xxx xxx xxx yyy yyy yyy yyy yyy
xxx xxx xxx xxx yyy yyy yyy yyy yyy
xxx xxx xxx xxx yyy yyy yyy yyy yyy
xxx xxx xxx xxx yyy yyy yyy yyy yyy

from this I want col6 col7 col8 col9 col10
and its record into csv.


Thanks
mg
Reply
#2
Hard to say without seeing your code. Or at least post the stored procedure.
I'll assume you're using an SQL query.
If that is the case, you can specify the actual columns in the query.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020