Welcome Guest, Not a member yet? Register   Sign In
Oracle Nextval issue
#11

[eluser]dignityandshame[/eluser]
So this morning I was playing around and somehow it started incrementing by 4 instead of 3. It's back to 3 now and I'm not sure if I did anything to cause it to jump to 4, but...kinda creepy.

Here's the test code I've been using:

Code:
echo "Before!<br>";
$sql = 'select testlog.schedule_seq.nextval from dual';
echo $sql."<br>";
$query = $this->db->query($sql);
echo "After!<br>";
$row = $query->row();
echo "nextval: ".$row->NEXTVAL."<br>";

And the output:

Code:
Before!
select testlog.schedule_seq.nextval from dual
After!
nextval: 169

And then a refresh of the page:

Code:
Before!
select testlog.schedule_seq.nextval from dual
After!
nextval: 172

Here's the php/oci8 code I used:

Code:
$conn = oci_connect('xxxxx', 'xxxxx', '//xxx.xxx.xxx.xxx/xxx');
$query = 'select testlog.schedule_seq.nextval from dual';

$stid = oci_parse($conn, $query);
$r = oci_execute($stid, OCI_DEFAULT);

while ($row = oci_fetch_row($stid)) {
  foreach($row as $item) {
      echo $item."<br>";
  }
}

oci_close($conn);

which returns this:

Code:
177

and after a refresh, this:

Code:
178


Messages In This Thread
Oracle Nextval issue - by El Forum - 04-02-2009, 03:42 PM
Oracle Nextval issue - by El Forum - 04-02-2009, 04:22 PM
Oracle Nextval issue - by El Forum - 04-02-2009, 04:31 PM
Oracle Nextval issue - by El Forum - 04-02-2009, 04:42 PM
Oracle Nextval issue - by El Forum - 04-02-2009, 05:44 PM
Oracle Nextval issue - by El Forum - 04-02-2009, 05:56 PM
Oracle Nextval issue - by El Forum - 04-02-2009, 06:27 PM
Oracle Nextval issue - by El Forum - 04-02-2009, 06:37 PM
Oracle Nextval issue - by El Forum - 04-02-2009, 10:27 PM
Oracle Nextval issue - by El Forum - 04-03-2009, 04:41 AM
Oracle Nextval issue - by El Forum - 04-03-2009, 08:32 AM
Oracle Nextval issue - by El Forum - 10-15-2009, 09:52 AM
Oracle Nextval issue - by El Forum - 10-20-2009, 04:02 PM
Oracle Nextval issue - by El Forum - 03-07-2010, 05:20 PM
Oracle Nextval issue - by El Forum - 05-13-2013, 04:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB