|  | 
      
        |  |  |  |  
        |  |  
 
    
      |  |  |  |  
    |  | 
	
		
        
         
 
	
		| Computers Sidetrack to Computers, Questions on your home computer? Posting just for registered members.... |  
	
		|  |  
	
	
	
	
		|  08-16-2012, 07:13 PM | #1 |  
	| Registered User 
				 
				Join Date: Aug 2010 Location: A village some where 
					Posts: 3,436
				 | 
				
				need help with SQL code
			 
 I am working out of a oracle data base and the interface uses SQL. I can not get my if then statements to work, all i am trying to do is this. The column produces a number and i want the number to be replaced with txt. For example if column x = 31 then break else column x = 40 the coaching etc.
 Any cookie cutter code i can play with would be awesome, thanks for looking.
 |  
|  |  
	|   |   |  
	
	
		|  08-16-2012, 08:11 PM | #2 |  
	| Old Guy 
				 
				Join Date: Oct 2004 Location: Mansfield, MA 
					Posts: 8,760
				 | I'll post it tomorrowPosted from my iPhone/Mobile device
 |  
|  |  
	|   |   |  
	
	
		|  08-16-2012, 08:51 PM | #3 |  
	| Registered User 
				 
				Join Date: Aug 2010 Location: A village some where 
					Posts: 3,436
				 | 
	Quote: 
	
		| 
					Originally Posted by striperman36  I'll post it tomorrowPosted from my iPhone/Mobile device
 |  Thanks, im sure i am missing something stupid simple to many hours infront of code.
Posted from my iPhone/Mobile device |  
|  |  
	|   |   |  
	
	
		|  08-17-2012, 08:56 AM | #4 |  
	| Old Guy 
				 
				Join Date: Oct 2004 Location: Mansfield, MA 
					Posts: 8,760
				 | to convert numbers to char use the to_char function
 selection to_char(x,'9999') from tables where
 
 or y = to_char(x,'9999')
 
 the second operator is the mask you want the conversion to use when converting
 
 
 Pl_SQL obscurity again.
 |  
|  |  
	|   |   |  
	
	
		|  08-17-2012, 10:48 AM | #5 |  
	| Registered User 
				 
				Join Date: Aug 2010 Location: A village some where 
					Posts: 3,436
				 | I have the conversions with no problem but will this do the same as a if,then statement as the column produces 7 different 2 digit numbers.Posted from my iPhone/Mobile device
 |  
|  |  
	|   |   |  
	
	
		|  08-17-2012, 11:48 AM | #6 |  
	| Old Guy 
				 
				Join Date: Oct 2004 Location: Mansfield, MA 
					Posts: 8,760
				 | 
	Quote: 
	
		| 
					Originally Posted by iamskippy  I have the conversions with no problem but will this do the same as a if,then statement as the column produces 7 different 2 digit numbers.Posted from my iPhone/Mobile device
 |  every value will be converted yes,
 
to_char(x,'99')
 
its how the variables are processed regardless of the variable value as long as it doe not exceed two characters. |  
|  |  
	|   |   |  
	
	
		|  08-17-2012, 11:13 AM | #7 |  
	| Registered User 
				 
				Join Date: Nov 2003 Location: RI 
					Posts: 21,501
				 | Sounds like an impedance problem. Convert your JAVA_XL function to bit-hex_char. Input the print spooler bypassing the SQL evaporator. 
 If that fails, go to Tosche station and just get a new power converter.
 
 -spence
 |  
|  |  
	|   |   |  
	
	
		|  08-17-2012, 11:49 AM | #8 |  
	| Old Guy 
				 
				Join Date: Oct 2004 Location: Mansfield, MA 
					Posts: 8,760
				 | 
	Quote: 
	
		| 
					Originally Posted by spence  Sounds like an impedance problem. Convert your JAVA_XL function to bit-hex_char. Input the print spooler bypassing the SQL evaporator. 
 If that fails, go to Tosche station and just get a new power converter.
 
 -spence
 |  if you bypass the SQL evaporator you also bypass the Heisenberg compensator |  
|  |  
	|   |   |  
	
	
		|  08-17-2012, 11:54 AM | #9 |  
	| Old Guy 
				 
				Join Date: Oct 2004 Location: Mansfield, MA 
					Posts: 8,760
				 | 
	Quote: 
	
		| 
					Originally Posted by spence  Sounds like an impedance problem. Convert your JAVA_XL function to bit-hex_char. Input the print spooler bypassing the SQL evaporator. 
 If that fails, go to Tosche station and just get a new power converter.
 
 -spence
 |  if you bypass the SQL evaporator you also bypass the Heisenberg compensator |  
|  |  
	|   |   |  
	
		|  |  
	| 
	|  Posting Rules |  
	| 
		
		You may not post new threads You may not post replies You may not post attachments You may not edit your posts 
 HTML code is Off 
 |  |  |  
 All times are GMT -5. The time now is 07:38 AM. |  |  |