data manip in SELECT &Oracle placeholder

wxdqz

New Member
My SELECT statements are a little odd because we are doing some data manipulation within the select statement.

Example)

SELECT area_code || '-' || substr(phone_number,1,3) || '-' || substr(phone_number,4,7)
FROM phone_num_table;

which would return something like 123-456-7890

OCIDefineByName($phone_statement,"area_code|| '-' || substr(phone_number,1,3) || '-' || substr(PHONE_NUMBER,4,7) \"Number\"",$num);

If I want to use OCIDefineByName, I get an error which I assume is because of the data manipulation. So my question is this...

Is there a way for me to use OCIDefineByName with this manipulation? Or should I just take out the data manipulation from my select and do that after I get the data. Will it make my queries faster?
 
Back
Top