11-29-2010, 02:20 PM
[eluser]Brad K Morse[/eluser]
the name of the sequence for the SP_COMMENTS table, is for the SP_COMMENTS_ID field, the name of the sequence is SP_COMMENTS_SEQUENCE
It increments it by 1.
I am stuck with this
I have seen in other examples getting it from "dual", I tried getting it from("SP_COMMENTS") as well, but still unsure
Displays: A Database Error Occurred
Error Number:
SELECT SP_COMMENTS_SEQUENCE.NEXTVAL AS NEXTID FROM dual
Screenshot of error: http://cl.ly/3R363Y1K2z1J3P2Z1I03
Unfortunately there is no error number.
the name of the sequence for the SP_COMMENTS table, is for the SP_COMMENTS_ID field, the name of the sequence is SP_COMMENTS_SEQUENCE
It increments it by 1.
I am stuck with this
Code:
function getNextId() {
$this->db->select("SP_COMMENTS_SEQUENCE.NEXTVAL AS NEXTID", FALSE);
$this->db->from("dual");
$query = $this->db->get();
$row = $query->row();
print $row->NEXTID;
}
I have seen in other examples getting it from "dual", I tried getting it from("SP_COMMENTS") as well, but still unsure
Displays: A Database Error Occurred
Error Number:
SELECT SP_COMMENTS_SEQUENCE.NEXTVAL AS NEXTID FROM dual
Screenshot of error: http://cl.ly/3R363Y1K2z1J3P2Z1I03
Unfortunately there is no error number.