So I am going to answer but I am going to abbreviate the explanation as I don't have enough time to rewrite the whole document I wrote yesterday. I wrote about 400 lines of explanation and then my laptop rebooted to install some updates and I lost everything I wrote. I started writing a response to your questions yesterday afternoon and I wrote a lengthy explanation using LabTrak as the basis for my response. ID for one table being used to query another) or indices are out of sync or corrupted (rebuilding indices should fix this). As for the different results, it may be you're passing the wrong value to the query (eg. You may need to look deeper depending on whether table correspond to a global mapped (legacy) table or a "pure" SQL table. If you're looking for a programmatically way to see the primary (assuming you don't have access to the code) then you could check information_schema.key_column_usage for constraint_type = "PRIMARY KEY". The fields listed there are the ones that correspond to the primary key of each of the tables displayed. The primary keys for the tables in the ERD diagram are listed in your posted image. If a FK is required then it should be defined manually. The reason relationships are not showing in ERD is because adding an object reference from one class to another doesn't generate a ForeignKey (only relationships do this automatically) thus no relationship is defined in the generated ERD. We may need more clarity to answer the specific question you have but here are some answers to things I could pull from your post: LEFT JOIN SQLUser.PAC_FacilityType PFT ON CTH.HOSP_Desc = PFT.FACIL_Descīut please may I know how am I supposed to know when table’s primary key / foreign key do not match and doesn’t show any relationship in ERD as below.īut when I extracted the ERD diagram of CT_Loc and CT_ Hospital they do not have any relationship and when I used the rowID, I got wrong answers.Īny detailed explanation will help, with reference to documentation will be appreciated. Same as SELECT * from SQLUser.CT_Hospital CTH LEFT JOIN SQLUser.CT_Loc CTL ON CTL.CTLOC_Desc = ? I would like to do something like this Select * FROM This is what I tried: Tired to create ERD diagrams and try to extract Primary and Foreign keys to associate, but I cannot in this case I am struggling to understand the process and method of accessing the SQL table with no reference to SQL parameter or Table but string.Please may I know how to access SQL parameter with string as datatype with NO reference to SQL Table and SQL Column.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |