| Author |
CURRENT USER and LAST USER
|
|
| Clive Collie 2005-10-27, 7:40 am |
| 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.
| |
| Breck Carter [TeamSybase] 2005-10-27, 7:40 am |
| 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@dillisto
ne.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/A...7/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
| |
| Clive Collie 2005-10-27, 7:40 am |
| 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@risi
ngroad.com> wrote in
message news:euhcl1pv13dt5c3
8ap97oq5skp5tjnh3ar@
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@dillisto
ne.com> wrote:
>
>
> --
> SQL Anywhere Studio 9 Developer's Guide
> Buy the book:
> http://www.amazon.com/exec/obidos/A...7/risingroad-20
> bcarter@risingroad.com
> RisingRoad SQL Anywhere and MobiLink Professional Services
> www.risingroad.com
| |
| Nick Elson 2005-10-27, 7:40 am |
| 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@dillisto
ne.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@risi
ngroad.com> wrote in
> message news:euhcl1pv13dt5c3
8ap97oq5skp5tjnh3ar@
4ax.com...
>
>
| |
| Clive Collie 2005-10-27, 7:40 am |
| 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@syb
ase.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@dillisto
ne.com> wrote in message
> news:43564d54@forums
-1-dub...
>
>
| |
| Breck Carter [TeamSybase] 2005-10-27, 7:40 am |
| On 19 Oct 2005 07:21:59 -0700, "Clive Collie"
<clive. doentdospam@dillisto
ne.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/A...7/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
| |
| Nick Elson 2005-10-27, 7:40 am |
| 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
|
|
|
|