Hi Dan,

Here is one way of doing it...
(That is if you are using <@USERREFERENCE> for keeping state between
pages)

there is @@identity column which is tied to the database user, but since
everyone coming through witango are the same user, I can't see this
doing any good.

The following will create a table that will probably need to be clear
periodically or right after you obtain the data.

A. Add a column to the table you are inserting into 
Column: Table_UserRef char (40)

B. Create a table called LastID
With the following columns
1. LI_UserRef char (40)
2. LI_Table char (40)
3. LI_ID

C. Create an insert after trigger on the table you are inserting to
Something like this...

---begin trigger---
Create trigger GetLastIdentity after insert order 1 on [Insert Table]
Referencing new as New Identity
For each row
Begin
   Insert into LastID(LI_UserRef,LI_Table,LI_ID)
values(New_Identity.Table_UserRef,'Table Name
Here',New_Identity.Table_AutoID)
End
---end trigger---

D. then in the Witango create a search action
Type: Summary of all Rows
Select Column: max(LI_ID)
Criteria: LI_UserRef = <@USERREFERENCE> and LI_Table = 'Table Name Here'

Just a suggestion  

Ben Johansen - http://www.pcforge.com
Authorized WiTango Reseller http://www.pcforge.com/WiTangoGoodies.htm 
Latest downloads & List Archives @ http://www.witango.ws


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Dan Stein
Sent: Tuesday, May 21, 2002 8:58 AM
To: Multiple recipients of list witango-talk
Subject: Witango-Talk: Next WiTango_SQL conundrum

OK I have fixed everything else data is where it needs to be and
everyone
was a big help.

Here is my next issue.

When I create a course with create_course.taf after the insert there is
a
DBMS that gets Max course_ID and set's it to a local variable.

That is because I need to know what the course_ID that was assigned by
SQL
to the inserted course.  I then use this to insert into the
course_crosslink
table the course_ID and some other values.

It looks like sometimes it failed to set the correct course ID I guess
there
was some fast enough data entry going on from more than one person so
the
Max did not get the right number. At least it is the only thing I can
think
of that would cause the missing course_ID's in course_crosslink. Since
the
insert action comes right the DBMS I can see how it could fail without
an
error message to the user which I think I would have heard about.

I know there is some way to lock the table or someway to make sure I
retrieve the correct value but I don't know how to write it in WiTango
or as
a DBMS.



-- 
Dan Stein
Digital Software Solutions
799 Evergreen Circle
Telford PA 18969
215-799-0192
610-256-2843
Fax 413-410-9682
FMP,Tango, EDI,SQL 7
[EMAIL PROTECTED]
www.dss-db.com


________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body


________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

Reply via email to