Python Forum
Cursor Variable inside Another Cursor . CX_ORacle
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cursor Variable inside Another Cursor . CX_ORacle
#1
Hi all,

I have 3 cursors, want to pass values from first and second on third cursor query as below.



import cx_Oracle as oracledb
conn = oracledb.connect("/", mode=oracledb.SYSASM)
cursor_dgnames = conn.cursor()
cursor_dgnames.execute("select distinct name from myview1")
for v_dgnames in cursor_dgnames:
    print(str(v_dgnames[0]))
    v_dgname=str(v_dgnames[0])
    cursor_fgnmaes = conn.cursor()
    cursor_fgnmaes.execute("select distinct fg from myview2 where TYPE<>'XYZ'")
    for v_fgnames in cursor_fgnmaes:
        print(str(v_fgnames[0]))
        v_fgname=str(v_fgnames[0])
        cursormain = conn.cursor()
        cursormain.execute("select d.name from myview3 d, myview4 dg where d.N = dg.N and dg.name=%s and d.F=%s")(v_dgnames,v_fgnames)
I tried different ways but none worked. Anyone could help on this please?
Reply


Messages In This Thread
Cursor Variable inside Another Cursor . CX_ORacle - by paulo79 - Apr-08-2022, 02:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with Web Cursor and Chrome Extension Interaction During Web Scraping ScraperHelge 0 527 Mar-26-2025, 03:47 PM
Last Post: ScraperHelge
  not able to call the variable inside the if/elif function mareeswaran 3 620 Feb-09-2025, 04:27 PM
Last Post: mareeswaran
  Variable being erased inside of if statement deusablutum 8 2,207 Jun-15-2024, 07:00 PM
Last Post: ndc85430
  Help with cursor in terminal river251 2 1,325 May-23-2024, 10:40 AM
Last Post: perfringo
  Variable definitions inside loop / could be better? gugarciap 2 1,345 Jan-09-2024, 11:11 PM
Last Post: deanhystad
  How to create a variable only for use inside the scope of a while loop? Radical 10 8,618 Nov-07-2023, 09:49 AM
Last Post: buran
  cx_oracle Error - AttributeError: 'function' object has no attribute 'cursor' birajdarmm 1 4,915 Apr-15-2023, 05:17 PM
Last Post: deanhystad
Question Sqlite3 how to know when cursor.execute didn't return anything ? SpongeB0B 2 1,674 Dec-18-2022, 06:13 PM
Last Post: deanhystad
  Command error - cursor.executemany(comandoSQL,valoresInserir) TecInfo 2 2,613 Nov-18-2022, 01:57 PM
Last Post: TecInfo
  Cursor write 3rd file empty paulo79 3 2,846 Mar-10-2022, 02:51 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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