Path: newssvr20.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!in.100proofnews.com!in.100proofnews.com!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
From: Daniel Morgan <damorgan@exxesolutions.com>
Newsgroups: comp.databases.oracle.misc
Subject: Re: insert user and data login in a table
Date: Tue, 09 Sep 2003 08:10:35 -0700
Organization: ATS
Message-ID: <1063120214.770763@yasure>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
References: <nrh7b.304160$Ny5.9467912@twister2.libero.it> <nsl7b.304965$Ny5.9484299@twister2.libero.it>
In-Reply-To: <nsl7b.304965$Ny5.9484299@twister2.libero.it>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cache-Post-Path: yasure!unknown@pond178.drizzle.com
X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/)
X-Complaints-To: abuse@supernews.com
Lines: 37
Xref: newssvr20.news.prodigy.com comp.databases.oracle.misc:131467

Maurizio wrote:

>thank to everybody
>Maurizio
>
>"Maurizio" <hillbon@tin.it> ha scritto nel messaggio
>news:nrh7b.304160$Ny5.9467912@twister2.libero.it...
>  
>
>>I desired know like i can insert in automatic the [user] and the [date] of
>>login of a consumer in a table.
>>Thank you in advance
>>Maurizio
>>
>>    
>>
Don't be so fast to thank them. There is a far far easier way:

CREATE TABLE test (
somefield    VARCHAR2(10),
username   VARCHAR2(30) DEFAULT USER,
insertdate   DATE DEFAULT SYSDATE);

INSERT INTO test (somefield) VALUES ('ABC');
COMMIT;

SELECT * FROM test;

You did, after all, say "automatic".

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan@x.washington.edu
(replace 'x' with a 'u' to reply)

