Beginner question!

kyosohma at gmail.com kyosohma at gmail.com
Fri Dec 21 10:42:51 EST 2007


On Dec 21, 9:11 am, SMALLp <po... at email.t-com.hr> wrote:
> Hy! I have error something like this
>
> TypeError: unbound method insert() must be called with insertData
> instance as first argument (got str instance instead)
>
> CODE:
>
> File1.py
> sql.insertData.insert("files", data)
>
> sql.py
>
> class insertData:
>         def insert(self, dataTable, data):
>                 conn = self.openConnection.openConnection()
>                 cursor = conn.cursor()
>                 sql ="INSERT INTO "+dataTable+" (user_name, file_name, file_size,
> file_path_local, file_path_FTP, curent_location, FTP_valid_time,
> uploaded, last_modified, last_verified, file_type, file_category) VLAUES
> "+data
>                 cursor.execute(sql)
>                 conn.Close()
>
> Help and advice neaded!

I think you need to post the real traceback or the real code since
your error message doesn't look like it has anything to do with the
code above. At least, I do not see a method named "insert".

Which database module are you using?

Mike



More information about the Python-list mailing list