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

cx_oracle: How do you pass variable value in placeholder with OFFSET clause in python

Hi ,
Whenever trying run below code , i am getting error " cur.execute("select * from nm_src_lkup ORDER BY NM_SRC_CD OFFSET :row_count ROWS") cx_Oracle.DatabaseError: ORA-01008: not all variables bound" . i am passing rowcount variable value in OFFSET cluase with select query .but it's not working .Please help me out
Expand|Select|Wrap|Line Numbers
  1. from time import sleep
  2. import sys
  3. import cx_Oracle
  4. import csv
  5. IDLE_INTERVAL_IN_SECONDS = 100
  6. dsn_tns = cx_Oracle.makedsn('xxxx.com', '1521', service_name='ppxxx.com') 
  7. conn = cx_Oracle.connect('MDBSE','mdbB5se', dsn=dsn_tns)
  8. cur = conn.cursor()
  9. row_count = 0
  10. while True:
  11.     cur.execute("select * from nm_src_lkup ORDER BY NM_SRC_CD OFFSET :row_count ROWS")
  12.     row_count = cur.rowcount
  13.     if row_count > 0:
  14.         file = open("skp1.csv","w")
  15.         output = csv.writer(file , dialect='excel')
  16.         for row_data in cur:
  17.         output.writerow(row_data)
  18.     sleep(IDLE_INTERVAL_IN_SECONDS)
  19.  
Jan 20 '20 #1
0 1355

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

Similar topics

5
by: GB | last post by:
Hello: In my MS Access project I have two objects - my form and my report. I need to pass variable value from Command_click procedure of my form to Report_open procedure of my report. How can I...
1
by: csgraham74 | last post by:
Hi there, Having done much web development in recent times im a bit new to vb.net and uses of classes. Basically in my VB.Net code i call a connection to unidata then using this connection i...
6
by: paul | last post by:
HI! How do we send a variable from an Iframe page back to its parent? I have a script that calculates the iframe's window size but I need to know how to send that value back to its parent so I...
8
by: Jerry | last post by:
I am a MySQL and PHP newbie. I am having trouble getting the $w variable in my code below passed to mysql. When I use the value of $w directly in the Where clause, the correct rows are returned....
2
by: jamesnkk | last post by:
I have no exactly idea how to pass a variable value from one form to another, How do I do it using, say in Form 1 using DoCmd.OpenForm like the below statement, correct me If I am wrong. FORM_1...
5
by: techbuddha | last post by:
Hi new to the forum and visual basic. I am attempting to fix a migration of excel to access. The excel sheets where simple copied as is into access. for example one table lists the academic...
3
by: dsalex | last post by:
I have a form that has a subform to ask/assign a value (inserted by the user) to a public variable (VB). The same form has an Option Group that lauches named querys using DoCmd.OpenQuery. How can I...
11
by: venkatagmail | last post by:
I have problem understanding pass by value and pass by reference and want to how how they are or appear in the memory: I had to get my basics right again. I create an array and try all possible...
2
by: jakubmakowski | last post by:
Hello, I have a problem with opening the report using a variable from the access form. Suppose I have a form with customer data - one of the fields is called "ClientID" and in the same databese I...
0
by: quicyvictor | last post by:
i've been on it for 2 days. can someone help search.php **************************************************************** <form method="post" action="search.php"> <select id="name"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.