Home > Archive > SQL Anywhere Mobile > October 2005 > User Login into 'values' of insert









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author User Login into 'values' of insert
AKB IT Solutions Ltda

2005-10-27, 8:21 am

Hello,

I would like to know, as get the user login in mobilink (or user login
in my pda), in an event of upload_insert, so that I can use inside of my
'Values'.

Thanks

--


Rodrigo Defavari
Developer
AKB IT Solutions Ltda. - Tel: 19 3466-9672
rodrigo.defavari@akbit.com

Evite imprimir ! Pense em sua responsabilidade e compromisso com o MEIO
AMBIENTE.


Greg Fenton

2005-10-27, 8:21 am

AKB IT Solutions Ltda wrote:
> I would like to know, as get the user login in mobilink (or user login
> in my pda), in an event of upload_insert, so that I can use inside of my
> 'Values'.
>


You didn't indicate what your consolidated database is, so let's assume
you are using a SQLAnywhere consolidated.

One approach we use is to create a SQLAnywhere database variable in the
begin_connection event. This event fires once at the beginning of each
database connection that the ML server initiates with the consolidated.
So to create a variable:

CREATE VARIABLE @username VARCHAR(128)

One of the first events to fire during a synchronization session is the
connection-level begin_synchronizatio
n event, and that event is passed
the ml_username. So you can now set the database variable to that value:

SET @username = ?

Since a database variable is tied to a database connection, throughout
the rest of the synchronization session that variable will be available.
So for your upload_insert event, you could use "@username". For example:

INSERT INTO my_table (pk_col, col1, col2, non_sync_col)
VALUES (?, ?, ?, @username)

(again, this is just an example).

Hope this helps,
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com