CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 how to use an oracle sequence?

Print topic Send  topic

Author Message
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.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.