OT: Anyone good with Oracle9i SQL?

Ford SportTrac Forum

Help Support Ford SportTrac Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Casey B

Well-Known Member
Joined
Oct 12, 2005
Messages
732
Reaction score
0
Location
Augusta, GA
I'm in an Intro to Oracle9i SQL class and I'm having trouble with an assignment. Actually just one of the question on the assignment is giving me fits. I thought I would share because of the overwhelming amount of knowledge floating around this site;).



SQL built-in function to convert the following string of text.

String, ‘both the UPDATE commands and the ALTER TABLE command’



• replace ‘A’ with ‘b’ in the string.

• Remove ‘UPDATE’ and ‘ALTER’ from the string.

• Find out the position of ‘a’ of ‘and’ in the string.

• Convert the string to upper case and lower case.



I just have to give the syntax for the SQL statement. Thanks in advance.
 
I dont know Oracle, just Microsoft. Maybe this will help you get started.



-- replace ‘A’ with ‘b’ in the string.

SELECT REPLACE('both the UPDATE commands and the ALTER TABLE command’,'A','b')

GO



-- Remove ‘UPDATE’ and ‘ALTER’ from the string.

SELECT REPLACE('both the UPDATE commands and the ALTER TABLE command’,'UPDATE','')

GO



SELECT REPLACE('both the UPDATE commands and the ALTER TABLE command’,'ALTER','b')

GO



-- Find out the position of ‘a’ of ‘and’ in the string.

SELECT CHARINDEX('a','both the UPDATE commands and the ALTER TABLE command')

GO



-- Convert the string to upper case and lower case.



SELECT UPPER('both the UPDATE commands and the ALTER TABLE command’)

GO



SELECT LOWER('both the UPDATE commands and the ALTER TABLE command’)

GO
 
Thanks RichardG. I turned in the assignment last night. I was really unsure abouth location of 'a' command but I figured the others out. I don't recall seeing CHARINDEX in the Oracle text but I used some other command. I don't have the assignment with me and I can't remember exactly what I put. I guess I'll find out when it's graded:). Thanks for the input.
 

Latest posts

Top