Subject | using Gen_id from a stored proc |
---|---|
Author | Rhett Guthrie |
Post date | 2001-03-21T18:34:40Z |
I am trying to write a simple stored proc that returns the results of
running Gen_Id. I am trying to use this code:
Create Procedure GeneratePrimaryKey
Returns ("PK" Integer )
As Begin
"PK" = Gen_Id( PrimaryKeyGenerator, 1 );
End !!
Set Term ; !!
I execute this code using both of these:
Execute Procedure GeneratePrimaryKey
Select PK From GeneratePrimaryKey
However, though the PrimarykeyGenerator value is being incremented with
both approaches, neither of these approaches are actually returning the
generated value. I get back a table with one column and no data.
Does anyone have any idea what I am doing wrong?
Thanks,
Rhett
running Gen_Id. I am trying to use this code:
Create Procedure GeneratePrimaryKey
Returns ("PK" Integer )
As Begin
"PK" = Gen_Id( PrimaryKeyGenerator, 1 );
End !!
Set Term ; !!
I execute this code using both of these:
Execute Procedure GeneratePrimaryKey
Select PK From GeneratePrimaryKey
However, though the PrimarykeyGenerator value is being incremented with
both approaches, neither of these approaches are actually returning the
generated value. I get back a table with one column and no data.
Does anyone have any idea what I am doing wrong?
Thanks,
Rhett