[DB-SIG] how to compare

python eager python_eager at yahoo.com
Tue Jan 31 08:53:58 CET 2006


   Hi ,
>       here  i am comparing both the values of form value and table 
value.
> But it will not work . The result will be print "not equal". Table 
values
> are retrieved fine. Here what mistake i did. No compilation error and 
run
> time error. Please solve this problem.
>    
>   Code Snippet :
>    
>             req = self.request()
>           pid = int(req.field('pid'))
>           self.writeln(pid)
>          
>             dbconnection = cx_Oracle.connect("myusername", 
"mypassword",
> "mydatabase")
>           cursor = dbconnection.cursor()
>           cursor.arraysize = 50
>           cursor.execute("SELECT PID FROM PERSONALDETAILS order by 
pid")
>           for PID in cursor.fetchall():
>              # Comparing here both formvalue and table value ( both 
are
> numeric)              
>               if pid==PID:
>                   self.writeln("Equal")
>               else:
>                   self.writeln("Not Equal")
>    
>   Thank you
>   Python_Eager



		
---------------------------------
Bring words and photos together (easily) with
 PhotoMail  - it's free and works with Yahoo! Mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/db-sig/attachments/20060130/cddd506b/attachment.htm 


More information about the DB-SIG mailing list