Welcome Guest, Not a member yet? Register   Sign In
storing record in tables, that relate to multiple id's
#5

[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

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.


Messages In This Thread
storing record in tables, that relate to multiple id's - by El Forum - 11-29-2010, 08:32 AM
storing record in tables, that relate to multiple id's - by El Forum - 11-29-2010, 10:13 AM
storing record in tables, that relate to multiple id's - by El Forum - 11-29-2010, 10:34 AM
storing record in tables, that relate to multiple id's - by El Forum - 11-29-2010, 10:48 AM
storing record in tables, that relate to multiple id's - by El Forum - 11-29-2010, 02:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB