Check serverside leftjoins
Check serverside leftjoins
in Editor
Hi, I have a question about .net editor left joins. In my code I don't know how many and which left joins will be. And can be situations when I need to join same table few times. So I want to check editor already have left joined table. I get the list by editor.LeftJoin(). But I can't see any private field like name of joined table. Can I get this info in code?
Answers
Hmmm. Editor doesn't "make" left joins itself. You have to code them. Looking at your code you should be able to see what left joins you got.
https://editor.datatables.net/manual/net/joins#Left-Join
Just to add to that:
The first parameter of the
.LeftJoin()method tells Editor what the joined table name should be.But you mention a private property - are you looking to try and access that information externally? Why?
Allan
It's just that I have a system where I don't know exactly what left joins there will be. And when adding a left join, I pass a string with the table name value. To check, I then need to keep track of the tables that have already been joined, for example, using an array to check if the table has already been added. If it has already been added, then I need to change the join conditions.
This can be described as working with SQL tables. The user specifies that I have a table with a certain name and certain columns. They want the values for this table to be references to values from another table. For example, in the original table there is a column called customerId, in another table there is a column called customerId, customerName. And I want to see customerName as the result. Such “replacements” can be for several tables and several columns in one table. In order not to join the table twice with different conditions and to avoid conflicts with the join names, I would like to combine them into one join and write the multiple conditions.
So here's the question: is it possible in DataTables to change these parameters during program execution using the API, or do I need to take all join logic manually first and set a left join function once?
Do you have the raw SQL for what you want? If so, can you show me that?
That sounds like a regular left join. In this example I've got it reading just
namefrom the joined table, but you could readily have it read multiple fields if you want from the joined table.Allan