PublicDataSet getqualitystatistics (DateTime start_date,datetime end_date,stringModality,stringhospital_id) {StringBuilder SQL=NewStringBuilder (); List<DbParameter> paras =NewList<dbparameter>(); Idbhelper DBHelper=Dbfactory.createdbhleper (); DataSet DS=NewDataSet (); Switch(sqltype) { Case "MSSQL2008": Break; Case "Oracle": SQL. Append ("begin"); //evaluation of image quality in departmentSql. Append (@"open:var_1 for ' SELECT COUNT (*) NUM, NVL (b.dept_image_quality,2) Quality,to_char (a.registration_date, ' mm ') MONTH from Patient_registration A left JOIN quality_evaluation B on a.registration_id=b.reg_id WHERE to_char (a.registr Ation_date, ' Yyyy-mm-dd hh:mi:ss ') >= '"+start_date+""'" ) . Append (@"and To_char (a.registration_date, "Yyyy-mm-dd hh:mi:ss") <= ""+end_date+""and modality=""+modality+""and hospital_id=""+hospital_id+""'") . Append (@"GROUP by B.dept_image_quality,to_char (a.registration_date, "mm") ORDER by B.dept_image_quality,to_char (A. Registration_date, ' mm ') '; "); //SQL. Append (""); ////In-Department report quality evaluation //SQL. Append ("Begin");Sql. Append (@"open:var_2 for ' SELECT COUNT (*) NUM, NVL (b.dept_report_quality,2) Quality,to_char (a.registration_date, ' mm ') MONTH from Patient_registration A left JOIN quality_evaluation B on a.registration_id=b.reg_id WHERE to_char (a.registr Ation_date, ' Yyyy-mm-dd hh:mi:ss ') >= '"+start_date+""'") . Append ("and To_char (a.registration_date, "Yyyy-mm-dd hh:mi:ss") <= ""+end_date+""and modality=""+modality+""and hospital_id=""+hospital_id+""'") . Append (@"GROUP by B.dept_report_quality,to_char (a.registration_date, "mm") ORDER by B.dept_report_quality,to_char (A. Registration_date, ' mm ') '; "); //SQL. Append ("END;"); ////Clinical evaluation of image quality //SQL. Append ("Begin");Sql. Append (@"open:var_3 for ' SELECT COUNT (*) NUM, NVL (b.clinic_image_quality,2) Quality,to_char (a.registration_date, ' mm ') MONTH from Patient_registration A left JOIN quality_evaluation B on a.registration_id=b.reg_id WHERE to_char (A.regis Tration_date, ' Yyyy-mm-dd hh:mi:ss ') >= '"+start_date+"' and To_char (a.registration_date, ' yyyy-mm-dd hh:mi:ss ') <= '"+end_date+""and modality=""+modality+""and hospital_id=""+hospital_id+""'") . Append (@"GROUP by B.clinic_image_quality,to_char (a.registration_date, "mm") ORDER by B.clinic_image_quality,to_char (A. Registration_date, ' mm ') '; "); //SQL. Append ("END;"); ////Clinical Report Quality evaluation //SQL. Append ("Begin");Sql. Append (@"open:var_4 for ' SELECT COUNT (*) NUM, NVL (b.clinic_report_quality,2) Quality,to_char (a.registration_date, ' mm ') MONTH from Patient_registration A left JOIN quality_evaluation B on a.registration_id=b.reg_id WHERE to_char (A.regis Tration_date, ' Yyyy-mm-dd hh:mi:ss ') >= '"+start_date+"' and To_char (a.registration_date, ' yyyy-mm-dd hh:mi:ss ') <= '"+end_date+""and modality=""+modality+""and hospital_id=""+hospital_id+""'") . Append ("GROUP by B.clinic_report_quality,to_char (a.registration_date, "mm") ORDER by B.clinic_report_quality,to_char (A . Registration_date, ' mm ') '; "); Sql. Append ("end;"); varp =NewOracleParameter (": var_1", Oracledbtype.refcursor); P.direction=ParameterDirection.Output; paras. ADD (P); varP2=NewOracleParameter (": var_2", Oracledbtype.refcursor); P2. Direction=ParameterDirection.Output; paras. ADD (p2); varp3=NewOracleParameter (": Var_3", Oracledbtype.refcursor); P3. Direction=ParameterDirection.Output; paras. ADD (p3); varp4=NewOracleParameter (": Var_4", Oracledbtype.refcursor); P4. Direction=ParameterDirection.Output; paras. ADD (p4); DS=DBHelper. Query (SQL. ToString (), paras); Break; default: Break; } returnds; The above code returns 4 datasets. Don't note, open:var_1. for"Inside the statement, all the single quotes will be converted into two single quotes."
Oracle multiple statements executed simultaneously (e.g. two datasets returned)