The second argument in the Ocidefinebyname function only has an uppercase string

Source: Internet
Author: User
Tags stmt oracle database


PHP Web page code, using the Ocidefinebyname function, after testing, found that the second argument only uppercase string.

Appendix to find out the use of this function
Ocidefinebyname

Allow the SELECT directive to use PHP variables.

Syntax: boolean ocidefinebyname (int stmt, string ColumnName, mixed &variable, int [type]);

Return Value: Boolean value

Function Type: Database function


Content Description

This function is used to define the specified PHP variable so that it can be used by the SELECT command in the SQL instruction. Be aware of the case, because the names of the fields in the Oracle database are actually uppercase names. The parameter stmt is a string pointer after Oracle parsing (ociparse). The parameter ColumnName is the field name on the Oracle datasheet. Parameter variable must precede the & symbol, table PHP variable address. Parameter type is usually omitted. Note that when you want to use the new data type Lob/rowid/bfile, which is unique to Oracle 8, you need to perform the Ocinewdescriptor () function first. A true value is returned when the function is executed successfully.

if (! ( $conn = Ocilogon ("Mobile_query", "Mobile_query", "FIDS")) {$this->con_temp = "Network connection error.
                "; } else {$sql = "select ' d ' as Scaord, flight as Vsioflightno,to_char (flight.flight_pkg. Get_datetime (SDT), ' Yyyy-mm-dd ') as Sdate,domint,stime,cs_type, ' Guangzhou ' as Aanam, route_n_1_l as banam,ordest_n_l as CanAm, ( Select Al.description_2 from Airl al where Al.carrier_iata=v.carrier_iata and rownum<2) as Airline,to_char (Flight.fli Ght_pkg. Get_datetime (SDT), ' Hh24:mi ') as Sdt,to_char (flight.flight_pkg. Get_datetime (est_d), ' Hh24:mi ') as Est_d,to_char (flight.flight_pkg. Get_datetime (act_d), ' Hh24:mi ') as act_d,park_1,remark_l as status,rem_c_2,gate_1 as belt_gate,checkins as Ex_check from Depf_v v where to_date (flight.flight_pkg. Get_datetime (V.SDT), ' Yyyy-mm-dd ') =to_date (sysdate, ' yyyy-mm-dd ') and lower (v.flight) = Lower (' ". $keyword.
                    "')"; $sql = $sql.
                    "UNION ALL"; $sql = $sql. "Select ' A ' as Scaord, flight as Vsioflightno,to_char (flight.flight_pkg. Get_datetime (SDT), ' Yyyy-mm-dd ') as sdate,domint,stime,cs_type,ordest_n_l as Aanam, route_n_1_l as Banam, ' Guangzhou ' as CanAm, ( Select Al.description_2 from Airl al where Al.carrier_iata=v.carrier_iata and rownum<2) as Airline,to_char (Flight.fli Ght_pkg. Get_datetime (SDT), ' Hh24:mi ') as Sdt,to_char (flight.flight_pkg. Get_datetime (est_d), ' Hh24:mi ') as Est_d,to_char (flight.flight_pkg. Get_datetime (act_d), ' Hh24:mi ') as act_d,park_1,remark_l as status,rem_c_2,belt_1 as belt_gate,exits as Ex_check from Arrf_v v where to_date (flight.flight_pkg. Get_datetime (V.SDT), ' Yyyy-mm-dd ') =to_date (sysdate, ' yyyy-mm-dd ') and lower (v.flight) = Lower (' ". $keyword.
                    "')";
										
                    $stmt = Oci_parse ($conn, $sql);
                    Ocidefinebyname ($stmt, "Scaord", & $scaord);
                    Ocidefinebyname ($stmt, "Vsioflightno", & $vsiofightno);
                    Ocidefinebyname ($stmt, "Sdate", & $sdate); OcIdefinebyname ($stmt, "Domint", & $domint);
                    Ocidefinebyname ($stmt, "Stime", & $stime);
                    Ocidefinebyname ($stmt, "Cs_type", & $cs _type);
                    Ocidefinebyname ($stmt, "Aanam", & $aanam);
                    Ocidefinebyname ($stmt, "Banam", & $banam);
                    Ocidefinebyname ($stmt, "CANAM", & $canam);
                    Ocidefinebyname ($stmt, "AIRLINE", & $airline);
                    Ocidefinebyname ($stmt, "SDT", & $SDT);
                    Ocidefinebyname ($stmt, "Est_d", & $est _d);
                    Ocidefinebyname ($stmt, "Act_d", & $act _d);
                    Ocidefinebyname ($stmt, "Park_1", & $park _1);
                    Ocidefinebyname ($stmt, "STATUS", & $status);
                    Ocidefinebyname ($stmt, "rem_c_2", & $rem _c_2);
                    Ocidefinebyname ($stmt, "Belt_gate", & $belt _gate);
    Ocidefinebyname ($stmt, "Ex_check", & $ex _check);                if (!oci_execute ($stmt)) {$oerr = Ocierror ($stmt); $this->con_temp + = "Execute Code:".
                        $oerr ["Code"]; if ($oerr ["code"]) {$this->con_temp + = "Error:".
                        $oerr ["message"]; }} else {if (Ocifetch ($stmt)) {$this->con_te MP = $airline. "[" . $vsiofightno.
                            "] The flight information is: \ n"; if ($sdate) {$this->con_temp = $this->con_temp. "[Flight Date]:". $sdate.
                            "\ n";  } if ($aanam) {$this->con_temp = $this->con_temp. "[Voyage]:". $aanam.
                            "--";  } if ($banam) {$this->con_temp = $this-> con_temp. $banam.
                            "--"; if ($canam) {$this->con_temp = $this->con_temp. $can Am.
                            "\ n"; if ($ex _check) {$this->con_temp = $this->con_temp. ($scaord = = "D")? [Check-in counter]: ":" [Gate]: "). $ex _check.
                            "\ n"; if ($SDT) {$this->con_temp = $this->con_temp. ($scaord = = "D")? [Scheduled departure time]: ":" [Planned arrival time]: "). $SDT.
                            "\ n"; if ($est _d) {$this->con_temp = $this->con_temp. ($scaord = = "D")? [Estimated time of departure]: ":" [Estimated time of arrival]: "). $est _d.
                            "\ n"; if ($act _d) {$this->con_temp = $this->con_temp. ($scaord = = "D")? [Actual departure time]: ":"[Actual arrival time]: "). $act _d.
                            "\ n"; if ($park _1) {$this->con_temp = $this->con_temp. "[Aircraft gate]:". $park _1.
                            "\ n"; if ($belt _gate) {$this->con_temp = $this->con_temp. ($scaord = = "D")? "[Gate]:": "[Baggage carousel]:"). $belt _gate.
                            "\ n"; if ($status) {$this->con_temp = $this->con_temp. "[Flight current status]:". $status.
                            "\ n"; }} else {$this->con_temp + = "The flight number you are looking for [". $keyword.
                        "], flight information is not \ n";
                }} ocifreestatement ($stmt); } ocilogoff ($conn);




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.