ADO Read Oracle result set

Source: Internet
Author: User

1 /**2 3 4 5   */

---Oracle to return data using cursors, read in ADO6 PROCEDUREIsdt_vehicle_task_check (P_carnuminch VARCHAR2,7 cur_out out Sys_refcursor8) is9G_has_taskvarchar2( +);--Task NumberTen BEGIN One A Select Max(t.task_id) - intoG_has_task - fromt_isdt_vehicle_task_last T the whereT.car_num=P_carnum - andRowNum= 1 - Order byT.created_datedesc; - + ifG_has_task is not NULL Then - + A OPENCur_out for at Selectt.task_id, - Ds.id, - Ds.site_code, - Ds.center_lon, - Ds.center_lat, - Ds.latlons, in DS.CENTER_LON_BD, - DS.CENTER_LAT_BD, to DS.LATLONS_BD + fromt_isdt_vehicle_task_last T - Inner Joint_isdt_delivery_site DS the ont.sender_site_id=ds.id * andDs.state= 1 $ whereT.car_num=P_carnumPanax Notoginseng andRowNum= 1 - Order byT.created_datedesc; the + /*OPEN Cur_cartask for A Select Vi.id as vehicleid,st.task_id as TaskID from T_isdt_vehicle_task_last St the INNER JOIN T_isdt_vehicle_info VI on Vi.car_num=st.car_num + where st.car_num = p_carnum and rownum = 1 - ORDER BY st.created_date Desc; $ */ $ --There are tasks - ----p_state: = 1; - Else the - OPENCur_out forWuyi Select "' astask_id, the "' asID, - "' asSite_code, Wu "' asCenter_lon, - "' asCenter_lat, About "' asLatlons, $ "' asCENTER_LON_BD, - "' asCENTER_LAT_BD, - "' asLATLONS_BD - fromdual; A + /*OPEN Cur_cartask for the Select ' As Vehicleid, ' as TaskID from dual;*/ - $ --No task exists the ----p_state: = 0; the End if; the ENDIsdt_vehicle_task_check;

ADO Read Oracle Leibiao

 <summary>//WYG 2017-3-10//</summary>/<param name= "Vehicleno" ></ param>//<returns></returns> public list<areasite> checkvehicleintask (string Vehiclen O, out string vehicleid, out string taskId) {Vehicleid = TaskId = string.            Empty;            var list = new list<areasite> ();            Database Database = Dbhelper.createdatabase (); DbCommand command = database. Getstoredproccommand ("Isdt_vehicle_data_sync.            Isdt_vehicle_task_check "); Database.                     Addinparameter (Command, "P_carnum", dbtype.string, Vehicleno); using (IDataReader reader = database. ExecuteReader (command)) {while (reader. Read ()) {list.                ADD (New Areasite (reader)); } if (reader. NextResult ()) {if (!reader).                 IsDBNull (0)) {       Vehicleid = reader.                    GetString (0); } if (!reader. IsDBNull (1)) {taskId = reader.                    GetString (1);        }}} return list; }

Multiple cursor information returned in Oracle: http://www.360doc.com/content/10/0511/23/1121193_27150614.shtml

ADO Read Oracle result set

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.