CURRENT USER and LAST USER

I have a databse that started life under ASA 5 and has been unloaded and 
reloaded in every version up to ASA 9.02. I have various fields with a 
default of CURRENT USER. These get filled with the name of the currently 
logged in user when a record is UPDATE-ed.

However any new tables I add containing a field with default CURRENT USER 
does not get altered during and UPDATE. To do that I need to make it DEFAULT 
LAST USER.

When did this happen?

More importantly how come the old CURRENT USER fields carry on doing what 
they always did even though they look idential to a new CURRENT USER field 
(which now have to be LAST USER) when inspected in ISQL? If they have been 
magically altered to LAST USER fields should it not call them LAST USER in 
ISQL. 


0
Clive
10/19/2005 1:05:12 PM
sybase.sqlanywhere.general 32637 articles. 4 followers. Follow

6 Replies
1005 Views

Similar Articles

[PageSpeed] 4

Do you have triggers keeping those columns up to date?

Because AFAIK DEFAULT CURRENT USER has never worked like DEFAULT LAST
USER... I can check if you want :)

Breck

On 19 Oct 2005 06:05:12 -0700, "Clive Collie"
<clive.doentdospam@dillistone.com> wrote:

>I have a databse that started life under ASA 5 and has been unloaded and 
>reloaded in every version up to ASA 9.02. I have various fields with a 
>default of CURRENT USER. These get filled with the name of the currently 
>logged in user when a record is UPDATE-ed.
>
>However any new tables I add containing a field with default CURRENT USER 
>does not get altered during and UPDATE. To do that I need to make it DEFAULT 
>LAST USER.
>
>When did this happen?
>
>More importantly how come the old CURRENT USER fields carry on doing what 
>they always did even though they look idential to a new CURRENT USER field 
>(which now have to be LAST USER) when inspected in ISQL? If they have been 
>magically altered to LAST USER fields should it not call them LAST USER in 
>ISQL. 
>

--
SQL Anywhere Studio 9 Developer's Guide 
Buy the book: http://www.amazon.com/exec/obidos/ASIN/1556225067/risingroad-20 
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
0
Breck
10/19/2005 1:24:37 PM
Oh dear, that's not good. No need to check I'm sure you are correct. On that 
assumption I have a nasty feeling there is some replication related stuff 
going on here...long forgotten and lying in wait to catch me out.

"Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com> wrote in 
message news:euhcl1pv13dt5c38ap97oq5skp5tjnh3ar@4ax.com...
> Do you have triggers keeping those columns up to date?
>
> Because AFAIK DEFAULT CURRENT USER has never worked like DEFAULT LAST
> USER... I can check if you want :)
>
> Breck
>
> On 19 Oct 2005 06:05:12 -0700, "Clive Collie"
> <clive.doentdospam@dillistone.com> wrote:
>
>>I have a databse that started life under ASA 5 and has been unloaded and
>>reloaded in every version up to ASA 9.02. I have various fields with a
>>default of CURRENT USER. These get filled with the name of the currently
>>logged in user when a record is UPDATE-ed.
>>
>>However any new tables I add containing a field with default CURRENT USER
>>does not get altered during and UPDATE. To do that I need to make it 
>>DEFAULT
>>LAST USER.
>>
>>When did this happen?
>>
>>More importantly how come the old CURRENT USER fields carry on doing what
>>they always did even though they look idential to a new CURRENT USER field
>>(which now have to be LAST USER) when inspected in ISQL? If they have been
>>magically altered to LAST USER fields should it not call them LAST USER in
>>ISQL.
>>
>
> --
> SQL Anywhere Studio 9 Developer's Guide
> Buy the book: 
> http://www.amazon.com/exec/obidos/ASIN/1556225067/risingroad-20
> bcarter@risingroad.com
> RisingRoad SQL Anywhere and MobiLink Professional Services
> www.risingroad.com 


0
Clive
10/19/2005 1:42:44 PM
Clive,

Please don't cross-post

I (too) have already responded to this on the replication newsgroup

Check out my responses and ...

.... you mentioned COMPUTE( CURRENT USER)

that would be a complete different thing and that wasn't even
a feature of version 5; being newly added to ASA 6.




"Clive Collie" <clive.doentdospam@dillistone.com> wrote in message 
news:43564d54@forums-1-dub...
> Oh dear, that's not good. No need to check I'm sure you are correct. On 
> that assumption I have a nasty feeling there is some replication related 
> stuff going on here...long forgotten and lying in wait to catch me out.
>
> "Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com> wrote in 
> message news:euhcl1pv13dt5c38ap97oq5skp5tjnh3ar@4ax.com...
>> Do you have triggers keeping those columns up to date?
>>
>> Because AFAIK DEFAULT CURRENT USER has never worked like DEFAULT LAST
>> USER... I can check if you want :)
>>
>> Breck
>>
>> On 19 Oct 2005 06:05:12 -0700, "Clive Collie"
>> <clive.doentdospam@dillistone.com> wrote:
>>
>>>I have a databse that started life under ASA 5 and has been unloaded and
>>>reloaded in every version up to ASA 9.02. I have various fields with a
>>>default of CURRENT USER. These get filled with the name of the currently
>>>logged in user when a record is UPDATE-ed.
>>>
>>>However any new tables I add containing a field with default CURRENT USER
>>>does not get altered during and UPDATE. To do that I need to make it 
>>>DEFAULT
>>>LAST USER.
>>>
>>>When did this happen?
>>>
>>>More importantly how come the old CURRENT USER fields carry on doing what
>>>they always did even though they look idential to a new CURRENT USER 
>>>field
>>>(which now have to be LAST USER) when inspected in ISQL? If they have 
>>>been
>>>magically altered to LAST USER fields should it not call them LAST USER 
>>>in
>>>ISQL.
>>>
>>
>> --
>> SQL Anywhere Studio 9 Developer's Guide
>> Buy the book: 
>> http://www.amazon.com/exec/obidos/ASIN/1556225067/risingroad-20
>> bcarter@risingroad.com
>> RisingRoad SQL Anywhere and MobiLink Professional Services
>> www.risingroad.com
>
> 


0
Nick
10/19/2005 2:03:48 PM
It wasn't a cross post; I realised there was replication issues going on 
here so altered this post and reposted it.

Any how, with the replies posted, I think I finally dragged long buried 
thoughts from the depths of my brain (I naturally suppress all replication 
related thoughts).

DEFAULT TIMESTAMP and COMPUTE(curent user) fields get altered by 
replication, which I don't want. So we use a BEFORE UPDATE trigger to stamp 
last update time and user, but only if current remote user is null. Totally 
not obvious, but nothing in replication seems to be. Look, now you are going 
to shout at me for talking about replication in the General newsgroup - I 
can't win...


"Nick Elson" <no_spam_nicelson@sybase.com> wrote in message 
news:4356515f@forums-2-dub...
> Clive,
>
> Please don't cross-post
>
> I (too) have already responded to this on the replication newsgroup
>
> Check out my responses and ...
>
> ... you mentioned COMPUTE( CURRENT USER)
>
> that would be a complete different thing and that wasn't even
> a feature of version 5; being newly added to ASA 6.
>
>
>
>
> "Clive Collie" <clive.doentdospam@dillistone.com> wrote in message 
> news:43564d54@forums-1-dub...
>> Oh dear, that's not good. No need to check I'm sure you are correct. On 
>> that assumption I have a nasty feeling there is some replication related 
>> stuff going on here...long forgotten and lying in wait to catch me out.
>>
>> "Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com> wrote in 
>> message news:euhcl1pv13dt5c38ap97oq5skp5tjnh3ar@4ax.com...
>>> Do you have triggers keeping those columns up to date?
>>>
>>> Because AFAIK DEFAULT CURRENT USER has never worked like DEFAULT LAST
>>> USER... I can check if you want :)
>>>
>>> Breck
>>>
>>> On 19 Oct 2005 06:05:12 -0700, "Clive Collie"
>>> <clive.doentdospam@dillistone.com> wrote:
>>>
>>>>I have a databse that started life under ASA 5 and has been unloaded and
>>>>reloaded in every version up to ASA 9.02. I have various fields with a
>>>>default of CURRENT USER. These get filled with the name of the currently
>>>>logged in user when a record is UPDATE-ed.
>>>>
>>>>However any new tables I add containing a field with default CURRENT 
>>>>USER
>>>>does not get altered during and UPDATE. To do that I need to make it 
>>>>DEFAULT
>>>>LAST USER.
>>>>
>>>>When did this happen?
>>>>
>>>>More importantly how come the old CURRENT USER fields carry on doing 
>>>>what
>>>>they always did even though they look idential to a new CURRENT USER 
>>>>field
>>>>(which now have to be LAST USER) when inspected in ISQL? If they have 
>>>>been
>>>>magically altered to LAST USER fields should it not call them LAST USER 
>>>>in
>>>>ISQL.
>>>>
>>>
>>> --
>>> SQL Anywhere Studio 9 Developer's Guide
>>> Buy the book: 
>>> http://www.amazon.com/exec/obidos/ASIN/1556225067/risingroad-20
>>> bcarter@risingroad.com
>>> RisingRoad SQL Anywhere and MobiLink Professional Services
>>> www.risingroad.com
>>
>>
>
> 


0
Clive
10/19/2005 2:21:59 PM
On 19 Oct 2005 07:21:59 -0700, "Clive Collie"
<clive.doentdospam@dillistone.com> wrote:

>you are going 
>to shout at me

For someone who has lived through distributing database data, being
shouted at is probably a vacation :)

Breck

--
SQL Anywhere Studio 9 Developer's Guide 
Buy the book: http://www.amazon.com/exec/obidos/ASIN/1556225067/risingroad-20 
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
0
Breck
10/19/2005 3:31:28 PM
Wasn't really shouting

    (-; though shouting at Breck can sometimes bring  it's own benefits ;-) 
....

Since the postings were really related I just didn't want the
context to be lost due to the inevitable smearing of the focus
across multiple newsgroups.  [I do now appreciate the intent
of doing the multiple postings though]

If you are now clear on what COMPUTE() is/was [not] doing
for you I suspect your concerns have been addressed.  Just
glad to hear you have reached that point in your process.


Hope all this noise helped 


0
Nick
10/20/2005 2:48:24 PM
Reply:

Similar Artilces:

CURRENT USER, LAST USER and Replication
I have a databse that started life under ASA 5 and has been unloaded and reloaded in every version up to ASA 9.02. I have various fields with a default of CURRENT USER. These get filled with the name of the currently logged in user when a record is UPDATE-ed. However any new tables I add containing a field with default CURRENT USER does not get altered during and UPDATE. To do that I need to make it DEFAULT LAST USER. How come the old CURRENT USER fields carry on doing what they always did even though they look idential to a new CURRENT USER field (which now have to be LAST...

User in SQLAnywhere = user in App..?
Hi everybody... I create a GROUP, this's a owner the my database, next I create users, for example: User1 --> password1 User2 --> password2 User3 --> password3 to everyone i have diferents permissions. My APP use all the tables of group owner and I login with the user and password of my owner, now I want to access to my app with the users (User1,User2,User3) I want to know how to use to my users create in sql for to access to my aplication. My app is create with pfc's. thanks my folks for yours helps..... Dav...

get User ID from current user
hi, i'm trying to log database activity. therefore i need the user-id of the currently logged-in user. For the login i used the login-controls that come with VWD and set up a MS SQL Server 2000 Database for data storage. That part works fine, but i've found no way to get the id.i'd be glad for some hints.Thx, SönkeP.S.: found things linke user.identity.name and membershipuser.providerkey (or sth) - but this didn't help me. Are you aware of where the users are stored in the database?  Did you configure the personalization providers from the default?  If not, open up ASPNETDB.MDF a...

Accessing Profile of users other than current user.
I want to access profile of other users. I want to allow my members to visit other members profile. I am not going to disply the senstive information. The default sql profile provider access to profile of current user only. Hi you need to use the getProfile function as follows:ProfileCommon UserProfile = Profile.GetProfile(UserName); UserProfile.PropertyName1=....   Please read this related thread : http://forums.asp.net/p/1243638/2279740.aspx   Regards,Regards,Anas Ghanem.Note:Please Don't hesitate to click "Report Abuse" link if you noticed something wron...

updating user data of current user
Hey I would like to know if someone can direct me to code  samples on how to update data of current logged in user, coming from labels and textboxes thats typed in by the current logged in user!I would apprecaite this so much, I have been hitting my head trying to figure this out for about 12 long hours...Thank you so much  Do you program with C# or VB? I assume that you have a table (outside of the Membership database table) that holds the fields that you want to have updated data.  Is this the case? Also, I'm thinking you will just be getting update values from textb...

Getting the user name of the currently logged in user
I'm writing my first custom module. Just as an experimental project I would just display information about the currently logged in user. I can get the User Id, but I don't know where to get the rest of the information. How do I get this? Hi, Just create a new UserController to get the information about one user via the method GetUser(PortalId, UserId) and store it into a UserInfo. Then you can get the rest of the information from this UserInfo [VB] Dim myUser As New UserInfo Dim myUserController As New UserController myUser = myUserController.GetUser(PortalId, Use...

Install application for all users vs. current user
An installer is created for an application using InnoSetup. During Setup, there is the option to choose whether to install for all users or for current user only. Application settings are then written to either HKCU\Software\{application name} or HKU\Software\{application name} depending on which one is chosen. Now my question is: When the application starts, how does it know whether it was installed for 'all users' or 'current user'? Option 1: Check if key exists under HKU ... .. if exists, then app was installed for all users .. if not exists, ...

How to List out Current Log on Users
Dear All,              I want the efficent way to display Current Log on Users - Users in online.  If u store session of all user in database then u can easily get the online user by checking the session state stored in database.  Add the Login info in the database . Check this info regularly after some time interval and show on the page Thanks & Regards Sandeep If you want something you never had, do something you have never done! Try storing the online persons count in the Application State Aminhttp://3...

how to get the user id of the currently logged in user?
hi,       m develoing a site whereby employees are supposed to log in and take orders.  the users are being created thru the ASP web Administration tool and stored by default into the SQL Server Database named AspNetDB.mdf that's stored in the App_Data folder of our website. the database is created auomatically. How to display the userid as this userid is too complicated and there can be many users with the same username. You can use the Membership class to get the info about a user: Membership.GetUser() The GetUser method can also take a username as a...

How to check if current user is admin or power user?
Hello, how can I check if the current user is either an administrator or a power user? -- Mit freundlichen Grüßen/Regards Heiko Adams Fachinformatiker Anwendungsentwicklung Tel.: +49 (95 65) 94 22 - 42 Fax : +49 (95 65) 94 22 - 22 Mail: heiko.adams@regenspurger.de Web: http://www.regenspurger.de / www.kigapro.de If you go get a software package called SVCOM it has the API functions coded that allows you to get that information www.aldynsoftware.com/svcom.html "Heiko Adams" <heiko.adams@regenspurger.de> wrote in message news:144404@forums.c...

creating a new user logs out the current user
Hi everybody, I am developing a web application, currently I am working on the security aspect of the web app. The problem I am having is when I create a new account (when I sign in as an admin user) using CreatNewUser Wizard, a new user is created and it automatically logs out the current user(Admin) and get itself  logged in. Could anybody help me out here. Thanking you in anticipation. Regards. There is a property on the <asp:createuserwizard> control called "LoginCreatedUser" (this is a Boolean) that allows you to control whether a newly created user is au...

Current User Logs out after creating new user.
Hi,  I am using the asp.net membership provider for managing users in my application. I have created the required database in SQL server 2005. I am using the standard membership controls provided. (Login control, CreateUserWizard control etc.) . As per business logic of my application, the user do not create their account themselves. The Admin user creates them instead. For user creation, I have created a page with the CreateUserWizard control. I have made necessary membership settings entries for the web.config file. So, the user gets created without any line of code. But...

Thread.CurrentPrincipal in web apps //HttpContext.Current.User = new GenericPrincipal(HttpContext.Current.User.Identity, roles);
If you look at the MS App and Profile block, it does the following to create a principal for the current request. Thread.CurrentPrincipal = new ExtendedPrincipal(aGenericIdentityObject); Historically, in web apps, I've used more along the lines of: HttpContext.Current.User = new GenericPrincipal(HttpContext.Current.User.Identity, roles); However, changing this line to Thread.CurrentPrincipal = new ExtendedPrincipal(HttpContext.Current.User.Identity, roles); seems to work, too. Is setting Thread.CurrentPrincipal a more flexible mechanism than setting the HttpContext.Cur...

Register a user in the HttpContext.Current.User.Identity.Name
We need to somehow register an AD authenticated username into the HttpContext.Current.User object.  I found the following code somewhere here in these forums a while ago. I can't recall who posted it but please accept my appreciation. But I'm unsure how to actually use it to assign a new user. Can someone maybe point out how to do this?  1            HttpContext context = HttpContext.Current;2            // Get the service provider from the context3  &...

Web resources about - CURRENT USER and LAST USER - sybase.sqlanywhere.general

Heliospheric current sheet - Wikipedia, the free encyclopedia
A /m². The thickness of the current sheet is about 10,000 km. The underlying magnetic field is called the interplanetary magnetic field , and ...

Just Dance 2016 review: a really fun game to boogie to that lacks current music
I am a hot, sweaty mess. Why? Because I've just finished dancing (yes, dancing) to Demi Lovato's &quot;Cool For The Summer&quot;.

Light all of the bulbs in the rotating puzzler Current Stream
If you enjoy casual puzzles with a simple concept yet increasingly challenging levels, then the new Current Stream will get you energized. Your ...

Current Links
**Most-Recent Must-Reads:** * **Paul Krugman**: [The Not-So-Bad Economy](http://equitablegrowth.org/?p=16781) * **Matthew Rognlie**: [What Lower ...

Muslim Americans: Current political climate worse than after 9/11
CNN Muslim Americans: Current political climate worse than after 9/11 CNN (CNN) It was never this bad, not even after 9/11. That's what many ...

Overwhelming 81 Percent Of Current And Former Military Have Unfavorable View Of Clinton
Overwhelming 81 Percent Of Current And Former Military Have Unfavorable View Of Clinton

Paul Ryan comes up empty when pressed on what's wrong with our current refugee screening process
That wonky wonk House Speaker Paul Ryan really needs to bone up on our refugee screening program , because he really doesn't get it. Steve Benen: ...

‘Mockingjay Part 2’ Racks Up $16M In Thursday Night Previews; Current Global B.O. At $43M
... 1 which made $17M. Among the franchise’s Thursday pre-openings, Catching Fire is the best with $25.25M from shows starting at 8PM. Current global ...

See How Deepest Ocean Currents Move
A vividly detailed animation of deep ocean current reveals a deep-sea world full of dynamic activity.

Is Macy's Stock a Steal at Its Current Price?
Attention long-term investors: Macy's stock is attractively priced following weak quarterly results and the recent sell-off.

Resources last updated: 12/11/2015 5:31:04 AM