MySQL Forums
Forum List  »  MySQL Workbench

compare ids from resultsets
Posted by: René Tobner
Date: March 11, 2013 01:51PM

I'd like to compare two QueryResultsets of bibliographies (old&new with almost identical content but different table structure) from different tables, matching the ids of both tables to determine aquivalent records.

Here my code until now ...

http://pastebin.com/aWXAzhdZ

Problem is, I think, the exit condition (break) in the last "if". I'd like to catch the case when res_new.nextRow() comes to the last row of resultSet_new (the new bibliography). (I'm not sure if this "if" is necessary, for it might be caught by the while-condition becoming false..?!)

However if this "if" is necessary, I need "res_new.currentRow()" working, but what I get is:

if res_new.currentRow() == 551:
TypeError: 'int' object is not callable

551 for the time being the number of rows, because I couldn't make working maxRows() either.

I think, I have a pretty huge misconception (or no conception at all) about the underlying entanglements of wb and python scripting regarding: why is that I can use res_new.nextRow() but not res_new.currenRow()/maxRows() ? Or did I make another mistake?

Any reflections and/or help appreciated.

On the other hand I must say, I am really thrilled by the use of wb and the possibilities of scripting, being able to 1) extract specific records of my table (where x like ...) into the Query-Result-Editor, 2) alter this Query-Result by scripts, 3) watch over these changes in the editor and finally commit my changes with "Apply". This makes a wonderful tool and I'd like to experiment further. Thank you!

ps: This phorum should have a funtion for formatting code, right?!

Options: ReplyQuote


Subject
Views
Written By
Posted
compare ids from resultsets
1197
March 11, 2013 01:51PM
862
March 12, 2013 06:01AM
605
March 12, 2013 04:09PM
563
March 25, 2013 02:25AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.