Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Plus ?

Status
Not open for further replies.

BIS

Technical User
Jun 1, 2001
1,893
NL
Hello,
I don't know if I am in the right forum, so sorry if I am not. I am an almost total blank when it comes to this but let me try to explain.
I have a box with amongst other stuff Oracle 8i I think. On this machine is also SQL Plus. I have managed to do the simple stuff like "update TABLE set FIELD=xxx where FIELD=xxx;" but thats about it. My question is this. Suppose I have a field which is a number. I want to increment this number on a schedule basis, this I can do with a cron job. What is the command to increment a field? For example, I want something like "update TABLE set FIELD=(value of field)+1" - is this possible?
 
Code:
UPDATE table
SET field_name = field_name + 1
WHERE fidle_name = whatever;
[\CODE]

Sounds like you could benefit from access to some Oracle documentation. I recommend that you join the "Oracle Technology Network" community. Go to the [URL unfurl="true"]www.oracle.com[/URL] website and you will find a link to this on the home page. You have to sign up, but it is free. Once you have joined you can visit 

[URL unfurl="true"]http://otn.oracle.com/docs/products/oracle8i/content.html[/URL]

to see Oracle 8i documentation. You probably need to look at both the SQL*Plus Reference and the SQL Reference.
 
Thanks ! The problem as I can see it is that the 'whatever' value in your example will change. I would like to have something automated that updates that field with a value of 1 every, say, 15 minutes. Can I replace the 'whatever' with a wildcard equivalent? Or just leave it out?
 
BIS, do you have a unique identifier for the record that you will want to update ?
Best of Irish Luck, David.
djwilkes@hotmail.com
 
ALl, thank you. It works for my purposes simply by doing "update TABLE set FIELD=FIELD+1" for example. I didn't know this, but now I do. Next step is off to oracle.com and start learning. Thank you both for your input.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top