kburnett
|
| Posted: 10/10/2002, 1:56 PM |
|
so if i have a primary key that is a number from an oracle sequence, were do i put the code to get the nextval?
i have tried using a custom insert as sql and as a table. nothing.
help?
|
|
|
 |
Tom
|
| Posted: 10/12/2002, 8:43 PM |
|
I assume that you mean on insert for the PK
Since this is a field you really don't want to display, make a hidden field for it (let's call it myid). Then either set the property of the default value to mysequence.nextval or use the before insert event to set fldMyId = mysequence.nextval.
You may need some quotes around it.
|
|
|
 |
george l.
|
| Posted: 10/14/2002, 8:36 AM |
|
Here's how I do it.
From "After Insert Event":
$db = new clsDBDD_DEV();
$userid = CCGetDBValue("select admindstdb_id_sq.currval from dual",$db);
|
|
|
 |
kburnett
|
| Posted: 10/14/2002, 9:13 AM |
|
function WI_QUICK_POLL1_ds_BeforeBuildInsert()
{
global $WI_QUICK_POLL;
if($WI_QUICK_POLL1->ds->PID->GetValue == "")
{
$DB = new clsDBConnection1();
$NEW_ID = CCGetDBValue("select WI_MKT_MASTER_SEQ.nextval from DUAL",$DB);
$WI_QUICK_POLL1->ds->PID->SetValue($NEW_ID);
}
}
this is what i have. and i get the ol' "call to a non-member function" error. not sure why at this poing the SetValue would not work.
|
|
|
 |
|