View Full Version : need help with SQL code


iamskippy
08-16-2012, 07:13 PM
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.

striperman36
08-16-2012, 08:11 PM
I'll post it tomorrow
Posted from my iPhone/Mobile device

iamskippy
08-16-2012, 08:51 PM
I'll post it tomorrow
Posted 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

striperman36
08-17-2012, 08:56 AM
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.

iamskippy
08-17-2012, 10:48 AM
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

spence
08-17-2012, 11:13 AM
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

striperman36
08-17-2012, 11:48 AM
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.

striperman36
08-17-2012, 11:49 AM
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

striperman36
08-17-2012, 11:54 AM
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