I want to retrieve data from two Select
statements in the following piece of code and I get
Oracle.DataAccess.Client.OracleException: 'ORA-00933: SQL command not properly ended'
exception.
Edit: I actually replaced the queries with these: "Select id from T_penalty_order; Select id from T_payment;"
and I still get the same error
"Oracle.DataAccess.Client.OracleException: 'ORA-00933: SQL command not properly ended'
using (var connection = new OracleConnection(connectionString))
using (var command = connection.CreateCommand())
{
connection.Open();
command.CommandText = "select id from t_penalty_order where protokol_no = :invoiceNumber; select A.NAME, A.SURNAME , A.FATHER_NAME, P.PROTOKOL_NO, P.PROTOKOL_TARIHI , P.PENALTY_FINE, A.FIN, PA.AMOUNT, P.LOCATION_DESCRIPTION, P.QARAR_TARIHI , e.name as \"KANUN\", P.IS_PAID from t_penalty_order p JOIN t_applicant a on p.applicant_id = a.id JOIN t_payment pa on p.id = pa.penalty_order_id JOIN t_penalty_order_kanun_maddesi km ON KM.PENALTY_ORDER_ID = p.id JOIN t_enum_value e ON km.kanun_maddesi_enum = e.id where km.kanun_maddesi_enum = e.id and p.protokol_no = :invoiceNumber group by a.name, a.surname, A.FATHER_NAME, P.PROTOKOL_NO, P. PROTOKOL_TARIHI , P.PENALTY_FINE, A.FIN, PA.AMOUNT, P.LOCATION_DESCRIPTION, P.QARAR_TARIHI , e.name, P.IS_PAID;";
command.Parameters.Add(new OracleParameter(@"invoiceNumber", OracleDbType.Varchar2, 255)).Value = request.identificationCode.invoiceNumber;
using (var reader = command.ExecuteReader())
{
do
{
while (reader.Read())
{
generalInfoResponse.account = new Account();
generalInfoResponse.account = null;
generalInfoResponse.invoice = new Invoice[1];
generalInfoResponse.invoice = null;
generalInfoResponse.response = new Response();
generalInfoResponse.response.code = 111;
generalInfoResponse.response.message = reader.GetInt32(0).ToString();
}
//Console.WriteLine("--next command--");
} while (reader.NextResult());
}
}