473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Oracle Function

31
Can nybody tell me how this works ?
select CHARACTERS(trim(CAST(upc as VARCHAR(20)))) from T1 ;
Here UPC may be a Number or a Varchar type column of T1 table .

Say , Upc = 1256.23 then what is the O/p ??
Again , say Upc = 'Skij' then what is the O/p ??
Dec 12 '06 #1
4 4101
There is no function like characters in oracle i guess.

cast is used for type conversion
ex:to convert a date into varchar

select cast(bday as varchar(20)) from sujatha_example;

CAST(BDAYASVARCHAR(2
--------------------
05/12/06 11:53:08AM
05/12/06 11:54:59AM
07/12/06 03:20:03PM


this is also used as substring function
ex:
SQL> select CAST(empname as varchar(2)) from emp;

CA
--
su

this is similar to
SQL> select substr(empname,1,2) from emp;

SU
--
su

actually empaname is varchar(20) here

if u feel this is useful let me know i'll explain u abt trim function also
Dec 13 '06 #2
pragatiswain
96 Expert
There is no function like characters in oracle i guess.

cast is used for type conversion
ex:to convert a date into varchar

select cast(bday as varchar(20)) from sujatha_example;

CAST(BDAYASVARCHAR(2
--------------------
05/12/06 11:53:08AM
05/12/06 11:54:59AM
07/12/06 03:20:03PM


this is also used as substring function
ex:
SQL> select CAST(empname as varchar(2)) from emp;

CA
--
su

this is similar to
SQL> select substr(empname,1,2) from emp;

SU
--
su

actually empaname is varchar(20) here

if u feel this is useful let me know i'll explain u abt trim function also
To convert to Character you need to use To_Char(integer) function which basically gives you the ascii character corresponding to that integer value.

For your example, I guess, you really don't need that.
Dec 13 '06 #3
suvam
31
Actually , I need to know the pattern of a column(Say Number type).
Say , table T1 has a field F1 Number(6,2) .
if F1 = 123.25 then the pattern will be 999.99 . Is there any SQL function which can evaluate this ?
Dec 15 '06 #4
Actually , I need to know the pattern of a column(Say Number type).
Say , table T1 has a field F1 Number(6,2) .
if F1 = 123.25 then the pattern will be 999.99 . Is there any SQL function which can evaluate this ?

Hey, Try This out:

SELECT TRANSLATE(123.34,'1234567890.','9999999999.') FROM dual;

SELECT TRANSLATE(T1.F1<=your coulmn>,'1234567890.','9999999999.') FROM dual;


Regards,
Pranav.
Dec 22 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Jan Bols | last post by:
I've been trying to install Oracle 8.1.7 on a fresh Mandrake 9.1 O.S for days, but I'm still not able to get it running. I've tried several install instructions that I found on the internet but no...
0
by: Bryan Jackson | last post by:
Greetings, (I am an Oracle newbie -- been working with SQLServer for quite some time, however. I'm using Oracle9i and Oracle9i JDeveloper v9.0.3.1 (build 1107) for my programming environment)....
4
by: Roger Redford | last post by:
Dear Experts, I'm attempting to marry a system to an Oracle 817 datbase. Oracle is my specialty, the back end mainly, so I don't know much about java or javascript. The system uses javascript...
1
by: Andrew Arace | last post by:
I scoured the groups for some hands on code to perform the menial task of exporting table data from an Access 2000 database to Oracle database (in this case, it was oracle 8i but i'm assuming this...
9
by: mcbill20 | last post by:
Hello all. I just installed Oracle 10g developer tools on a machine running XP Pro and Office XP. Before this I had just the Oracle 9 client installed. I the previous configuration, I was able to...
0
by: petro | last post by:
I am trying to deploy an asp.net application to my web server. My application uses system.data.oledb to connect to an oracle database. On my development machine I have the oracle client 10g...
4
by: BookerW | last post by:
I am not sure which forum I should post this on, but here is the problem. I have a front end web application(VB) on asp,net 1.1 framework. Inside of the code, I have the following lines to...
0
by: bw171 | last post by:
Hopefully, I frame this problem/question correctly. I have some code written/updated in visual studio 2003. This code when setup on other machines where I have installed the Oracle 9i client, and...
1
by: =?Utf-8?B?Ym9va2VyQG1ndA==?= | last post by:
Hopefully, I frame this problem/question correctly. I have some code written/updated in visual studio 2003. This code when setup on other machines where I have installed the Oracle 9i client,...
8
by: colmkav | last post by:
Can someone tell me how I can access the return value of a function called from Oracle as opposed to a store proc from oracle? my oracle function is get_num_dates_varposfile. I am only used to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.