adi
Posts: 1
|
Posted: 05/29/2004, 2:42 AM |
|
Hi,
I've been trying to use CCS with Perl, and the problem is that:
After inserting a record (with a record form), I want to get the auto incremented number. I am using mySql, and I know about the last_insert_id() function it provides. I'm trying to do this "SELECT last_insert_id()" on the After Insert Execution, but I always get 0. I think it's becuse that I make a new connection to the database, and I dont use the last connection the CCS Insert query used.
I also dont know how to access the last connection that the CCS Insert query used.
If anyone finds a way to solve it, I'll be grateful.
Regards,
Adi.
|
|
|
Last Hero
|
Posted: 05/31/2004, 1:43 AM |
|
use form datasource:
$formname->{ds}
|
|
|
Alibae Newkirk
|
Posted: 01/09/2005, 7:15 PM |
|
Sorry, I cant help you. i use ccs to create all my web applications along with komodo but i cant figure this thing out. I stumble across your forum message while looking for information regarding the last_insert_id subroute supposedly provide it with the DB package that ccs uses . You can find me at alibae.com or e-mail me at the above address and we can keep intact regarding this matter. I'll look into this further when I have more free time .
|
|
|
Last Hero
|
Posted: 01/10/2005, 2:00 AM |
|
in afterinsert event:
$formname->{ds}->query("SELECT last_insert_id() as lst");
$formname->{ds}->next_record();
$last = $formname->{ds}->f("lst);
|
|
|
|