Hi Sathish,
I want to insert a new record everytime user logs in
Main Topics
Browse All Topicshi Experts,
I have a simple program which updates a table with current date when user logs in.
For some reason the insert QUERY is throwing Error: LAST_LOGIN: invalid identifier, where as I do have a column called LAST_LOGIN ni my table.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
No, I am on DbVisualizer.
Already tried with Schema name... still the same error
13:05:53 [DESC - 0 row(s), 0.000 secs] [Error Code: 900, SQL State: 42000] ORA-00900: invalid SQL statement
... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 sec [0 successful, 0 warnings, 1 errors]
Some progress...
I shifted the queries... and this time a different error:
13:39:39 [INSERT - 0 row(s), 0.000 secs] [Error Code: 1, SQL State: 23000] ORA-00001: unique constraint (VSLAND.SYS_C0031967) violated
... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 sec [0 successful, 0 warnings, 1 errors]
> The database experts suggested me to use 2 tables instead of one :(
absolutely its 2
one for the user details, and the other to store times they logged in. The foreign key would be the user id
> And after switching (as suggested by you), it is working fine....
you don't need to switch, the select is redundant and should be removed
Hi Charles,
Heres what I thought. Can you please suggest me if its correct or completely absurd :)
I am thinking of keeping one table for all the user details, like access_type, fname, lname and everything but no LOGIN_TIME.
and another table with just two fiels, ID and LOGIN_TIME. Everytime user logs in, insert a new row.
Then I can do Count(*) on this table for a given date range, and make use of a JOIN to get Fname and Lname from the other table.
> But Mick, I need to know users access_Type, based on this I will hide/unhide "Admin" Tab on the page
but you don't need it to insert the login time, they are unrelated.
You would have code elsewhere to load the user, but this method is only concerned with inserting login time
> I am thinking of keeping one table for all the user details, like access_type, fname, lname and everything but no LOGIN_TIME.
> and another table with just two fiels, ID and LOGIN_TIME. Everytime user logs in, insert a new row.
Thats what I already suggested :)
> Hmmm.. why do we need ID on this one Charles?
Not necessary
Business Accounts
Answer for Membership
by: dravidnsrPosted on 2009-11-02 at 10:26:35ID: 25722071
for update u can use update query only know y ur using insert query ??
i think some not nullable ur not insert ...