hi, help needed!
below are my coding, i have a datagrid.
and i want the records display in the datagrid are select from two table.
i try to run the code above but it give an error:-
One or more errors occurred during processing of command. ORA-00960: ambiguous column naming in select list
[font=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif]Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: One or more errors occurred during processing of command. ORA-00960: ambiguous column naming in select list[/font]
is it something wrong with my select statement?
thanks for reply!
regards;
charlotte
below are my coding, i have a datagrid.
and i want the records display in the datagrid are select from two table.
VB.NET:
Dim SQL_Cat, SQL_Dept, SQL_Yr, SQL_Cat1, SQL_Dept1, SQL_Yr1 As String
' For ESC_APPLICANT
If ddlCat.SelectedItem.Text <> "" Then
SQL_Cat = "And APP_CAT LIKE '%" & ddlCat.SelectedItem.Text & "%'"
Else
SQL_Cat = ""
End If
If ddlReqDept.SelectedItem.Text <> "" Then
SQL_Dept = "And STFSEC LIKE '" & ddlReqDept.SelectedItem.Text & "%'"
Else
SQL_Dept = ""
End If
If ddlYear.SelectedItem.Text <> "" Then
SQL_Yr = "And TO_CHAR(ISSUE_DATE, 'yyyy')= '" & ddlYear.SelectedItem.Text & "'"
Else
SQL_Yr = ""
End If
' For ESC_LOSS
If ddlCat.SelectedItem.Text <> "" Then
SQL_Cat1 = "And b.APP_CAT LIKE '%" & ddlCat.SelectedItem.Text & "%'"
Else
SQL_Cat1 = ""
End If
If ddlReqDept.SelectedItem.Text <> "" Then
SQL_Dept1 = "And b.STFSEC LIKE '" & ddlReqDept.SelectedItem.Text & "%'"
Else
SQL_Dept1 = ""
End If
If ddlYear.SelectedItem.Text <> "" Then
SQL_Yr1 = "And TO_CHAR(b.ISSUE_DATE, 'yyyy')= '" & ddlYear.SelectedItem.Text & "'"
Else
SQL_Yr1 = ""
End If
Dim SQL As String = " SELECT a.APP_CAT, a.STFSEC, a.ISSUE_DATE, b.APP_CAT, b.STFSEC, b.ISSUE_DATE FROM ESC_APPLICANT a, ESC_LOSS b WHERE (a.STATUS = 'APPROVE' OR a.STATUS = 'RENEW' OR a.STATUS = 'RETURN')" + SQL_Cat + SQL_Dept + SQL_Yr + "OR b.STATUS = 'LOSS' " + SQL_Cat1 + SQL_Dept1 + SQL_Yr1
i try to run the code above but it give an error:-
One or more errors occurred during processing of command. ORA-00960: ambiguous column naming in select list
[font=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif]Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: One or more errors occurred during processing of command. ORA-00960: ambiguous column naming in select list[/font]
is it something wrong with my select statement?
thanks for reply!
regards;
charlotte