I'm working on a
vb.net application, where I use sql queries to get the datas from a dbase file.
There are cases where there can be 2 similar rows with the PARENT and ENFANT fields same in E_Ensart table, but the other columns may ahve different datas.
I use the below query to retrive datas from the database:
Code:
Private Function GetSQLExactMatch(ByVal name As String, ByVal artTbl As String) As String
Dim sb As StringBuilder = New StringBuilder("")
sb.Append(GetSQLSelectColumns())
sb.Append(" from E_Ensemb e, ")
sb.Append(" E_Ensart a ")
sb.Append(" where a.PARENT = '" & name & "' ")
sb.Append(" and e.ITEM_NBR = a.ENFANT ")
sb.Append(" and a.VALIDITE = 'O'")
Return sb.ToString()
End Function
When I use the above query, I get only one line from E_Ensart table instead of 2 lines.
I think its because I assign the e.ITEM_NBR =a.ENFANT in my query.
But even if I remove this line, I get only one row picked instead of 2 rows and I also find that the query is running indefinitly and the same line is repeated n number of times...
Kindly help me to find out where I'm wrong.
Hoping for suggestions.
Thanks in advance.