Error in inserting into database

Discussion in 'Python' started by harshu010, May 26, 2008.

  1. harshu010

    harshu010

    Joined:
    May 23, 2008
    Messages:
    10
    Likes Received:
    0
    Hi,
    I am using cx_oracle DB-APi to insert large number of records into database.
    I am using the following code

    # code to write all the queries in the DB
    ================================
    while ResultListIndex < len(query_list) :
    cursor.execute("insert into tbl_query_detail(hash_value,file_name,package_name,QUERY_NUMBER,\
    author_name,FULL_QUERY,BASE_QUERY_INDICATOR) values \
    (A.NEXTVAL,:file_name,:package_name,:QUERY_NUMBER,:author_name,:FULL_QUERY,:BASE_QUERY_INDICATOR )"\
    ,filename,Result_list[0],Result_list[ResultListIndex],\
    'abc',Result_list[ResultListIndex + 1],\
    Result_list[ResultListIndex +2])
    ResultListIndex = ResultListIndex + 3
    ResultListIndex=1
    Result_list=[]
    FileListindex=FileListindex+1

    db.commit ()
    cursor.close ()

    getting the following error:

    Result_list[ResultListIndex + 2])
    TypeError: function takes at most 2 arguments (7 given)


    Please suggest the format or corrections required
     
    harshu010, May 26, 2008
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.