Monday, March 14, 2011

Oracle PHP returning clause statement

If you just want to retrieve an auto-increment field like an integer, you don't have to use the oci_new_descriptor function:

   $dbh = ociplogon("username","pw","sid");

   $query = "INSERT INTO employees (name) VALUES ('Jones') RETURNING employee_no INTO :employee_no";
   $stmt = oci_parse($dbh, $query);

   // oci_new_descriptor not necessary...

   // Bind the variable to the parsed statement.
   // I used '8' as the minimum length - otherwise it was setting the default length to '1', so when an employee_no like 18366 was returned, the variable would be set to '1' (the first digit), so make sure you set a length.
   oci_bind_by_name($stmt, ":employee_no", $employee_no, 8);
   oci_execute($stmt, OCI_DEFAULT);

   // Commit the change
   oci_commit($dbh);

   // Free resources associated with the statement
   oci_free_statement($stmt);

  print "new employee no is: $employee_no";

Proxmox installation display out of range

Reference:  https://forum.proxmox.com/threads/proxmox-ve-screen-out-of-range.131297/