Getting error in inserting "Unable to determine primary key type"

Getting error in inserting "Unable to determine primary key type"

Ali AdnanAli Adnan Posts: 47Questions: 18Answers: 1

Dear Allan,
After upgrade to Editor 1.8 from 1.6 .Net dll all the tables having compound key through this error "Unable to determine primary key type"

Please suggest how to solve this

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Hi,

    Could you let me know what database you are using please? Also, I'm guessing that you are using .NET Framework? Finally, can you show me your Controller, Model and db schema?

    Thanks,
    Allan

  • Ali AdnanAli Adnan Posts: 47Questions: 18Answers: 1

    Dear Allan,

    Thankyou very much for your quick reply,

    Please see attached images for your reference

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Ah! You are using Oracle. Attached is an updated dll for Editor that should resolve this issue with Oracle.

    Allan

  • Ali AdnanAli Adnan Posts: 47Questions: 18Answers: 1

    Dear Allan,
    Thanks for update, please note it is given error "Invalid Number" if the compound keys are string (varchar2) data types.

    However it works fine with compound keys having at least one numeric column and the numeric column must be the first column in array.

    in my case I have compound keys ("cont_id", "tender_id", "option_no") where
    "cont_id" is number
    "tender_id" varchar2 and
    "option_no" is number data type

    so below code given error "Invalid Number"

    var editor = new Editor(db, "bider", new[] { "tender_id","cont_id",  "option_no" })
    

    however if I change order it works fine like

    var editor = new Editor(db, "bider", new[] { "cont_id", "tender_id", "option_no" })
    

    Please advise.

    Best Regards

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    This is the relevant bit of code. What it is trying to do is get the column type for the primary key. That's more difficult for when the primary key is a compound key, and previously it was just throwing an error. Now I've added lines 130-135 which match the behaviour of 1.6.0 - but that only works for a number.

    This is something that is going to need a bit more work, and it appears to be an issue that is unique to Oracle. For the moment I would suggest you use the workaround you have found.

    Allan

  • Ali AdnanAli Adnan Posts: 47Questions: 18Answers: 1

    ok thanks

This discussion has been closed.