Page 1 of 1

Database error code -177

Posted: Wed May 25, 2016 5:24 am
by Uiop541
Working on an online school project with database and I need to finish this class ASAP and I was wondering if any of you could help me with this error message I'm getting?

Re: Help ASAP Database error code -177

Posted: Wed May 25, 2016 5:37 am
by FJCC
What are the column types of Organizations.OrganizationName and VolunteerHours.OrganizationName? They should be the same type. You can check the type by going to the table pane, right clicking on the table icon and selecting Edit.

Re: Help ASAP Database error code -177

Posted: Wed May 25, 2016 6:44 am
by Uiop541
They appear to be the same?

Re: Help ASAP Database error code -177

Posted: Wed May 25, 2016 11:49 am
by eremmel
There are more aspects that define a type than only the keyword 'VARCHAR', The type of a text field is 'VARCHAR(N)' with N the max expected length in characters. Now rethink your relation definition....
In theory you can only make a relation between from fields f1 to f2 that have the types VARCHAR(n1) and VARCHAR(n2) when n1 < n2, but I will not be surprised that the constrain is even more restricted to: n1 == n2.

Re: Help ASAP Database error code -177

Posted: Wed May 25, 2016 7:22 pm
by UnklDonald418
I downloaded your “Community Service.obd” in your post
In your "Organizations" table "OrganizationName" is type [VARCHAR IGNORE CASE]
In your "Volunteer Hours" table the foreign key "OrganizationName" is type [VARCHAR]. While similar they are still different types.
By the way even after changing them to matching types you may need to re-enter your data in that column of the "Volunteer Hours" table before it will work.