dbTalk Databases Forums  

Money Data

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Money Data in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Laurence
 
Posts: n/a

Default Money Data - 11-28-2008 , 10:17 AM






Hi ,

I'm in the process of migrating a SQLServer database to Oracle. This
is the first Oracle database I've been involved with and I'm aware
that there is no money data type in Oracle. I appreciate that the
columns that need to hold money will need to be number datatypes, and
I notice that number(19,4) seems to crop up frequently in gateway
documents.

My question is, is there any way in which the currency symbol can be
retrieved with the data without needing to alter the SQL that exists
now ? This will need to work irrespective of the type of program that
connects to the database - UNIX/C/COBOL and VB/ASP/.NET. If it's not
possible, how is the SQL altered to achieve this ?

Thanks in advance.

Laurence

Reply With Quote
  #2  
Old   
gym dot scuba dot kennedy at gmail
 
Posts: n/a

Default Re: Money Data - 11-28-2008 , 10:34 AM







"Laurence" <i.l.breeze (AT) open (DOT) ac.uk> wrote

Quote:
Hi ,

I'm in the process of migrating a SQLServer database to Oracle. This
is the first Oracle database I've been involved with and I'm aware
that there is no money data type in Oracle. I appreciate that the
columns that need to hold money will need to be number datatypes, and
I notice that number(19,4) seems to crop up frequently in gateway
documents.

My question is, is there any way in which the currency symbol can be
retrieved with the data without needing to alter the SQL that exists
now ? This will need to work irrespective of the type of program that
connects to the database - UNIX/C/COBOL and VB/ASP/.NET. If it's not
possible, how is the SQL altered to achieve this ?

Thanks in advance.

Laurence
It sounds like you want to alter a number to look like $xxx.xx or whatever
the currency is that you desire. You can set the nls_currency for the
particular connection and request the number be converted to a string
to_char(field, format string) see the docs.
Jim




Reply With Quote
  #3  
Old   
gym dot scuba dot kennedy at gmail
 
Posts: n/a

Default Re: Money Data - 11-28-2008 , 10:34 AM




"Laurence" <i.l.breeze (AT) open (DOT) ac.uk> wrote

Quote:
Hi ,

I'm in the process of migrating a SQLServer database to Oracle. This
is the first Oracle database I've been involved with and I'm aware
that there is no money data type in Oracle. I appreciate that the
columns that need to hold money will need to be number datatypes, and
I notice that number(19,4) seems to crop up frequently in gateway
documents.

My question is, is there any way in which the currency symbol can be
retrieved with the data without needing to alter the SQL that exists
now ? This will need to work irrespective of the type of program that
connects to the database - UNIX/C/COBOL and VB/ASP/.NET. If it's not
possible, how is the SQL altered to achieve this ?

Thanks in advance.

Laurence
It sounds like you want to alter a number to look like $xxx.xx or whatever
the currency is that you desire. You can set the nls_currency for the
particular connection and request the number be converted to a string
to_char(field, format string) see the docs.
Jim




Reply With Quote
  #4  
Old   
gym dot scuba dot kennedy at gmail
 
Posts: n/a

Default Re: Money Data - 11-28-2008 , 10:34 AM




"Laurence" <i.l.breeze (AT) open (DOT) ac.uk> wrote

Quote:
Hi ,

I'm in the process of migrating a SQLServer database to Oracle. This
is the first Oracle database I've been involved with and I'm aware
that there is no money data type in Oracle. I appreciate that the
columns that need to hold money will need to be number datatypes, and
I notice that number(19,4) seems to crop up frequently in gateway
documents.

My question is, is there any way in which the currency symbol can be
retrieved with the data without needing to alter the SQL that exists
now ? This will need to work irrespective of the type of program that
connects to the database - UNIX/C/COBOL and VB/ASP/.NET. If it's not
possible, how is the SQL altered to achieve this ?

Thanks in advance.

Laurence
It sounds like you want to alter a number to look like $xxx.xx or whatever
the currency is that you desire. You can set the nls_currency for the
particular connection and request the number be converted to a string
to_char(field, format string) see the docs.
Jim




Reply With Quote
  #5  
Old   
gym dot scuba dot kennedy at gmail
 
Posts: n/a

Default Re: Money Data - 11-28-2008 , 10:34 AM




"Laurence" <i.l.breeze (AT) open (DOT) ac.uk> wrote

Quote:
Hi ,

I'm in the process of migrating a SQLServer database to Oracle. This
is the first Oracle database I've been involved with and I'm aware
that there is no money data type in Oracle. I appreciate that the
columns that need to hold money will need to be number datatypes, and
I notice that number(19,4) seems to crop up frequently in gateway
documents.

My question is, is there any way in which the currency symbol can be
retrieved with the data without needing to alter the SQL that exists
now ? This will need to work irrespective of the type of program that
connects to the database - UNIX/C/COBOL and VB/ASP/.NET. If it's not
possible, how is the SQL altered to achieve this ?

Thanks in advance.

Laurence
It sounds like you want to alter a number to look like $xxx.xx or whatever
the currency is that you desire. You can set the nls_currency for the
particular connection and request the number be converted to a string
to_char(field, format string) see the docs.
Jim




Reply With Quote
  #6  
Old   
Vladimir M. Zakharychev
 
Posts: n/a

Default Re: Money Data - 11-28-2008 , 12:01 PM



On Nov 28, 7:17*pm, Laurence <i.l.bre... (AT) open (DOT) ac.uk> wrote:
Quote:
Hi ,

I'm in the process of migrating a SQLServer database to Oracle. *This
is the first Oracle database I've been involved with and I'm aware
that there is no money data type in Oracle. *I appreciate that the
columns that need to hold money will need to be number datatypes, and
I notice that number(19,4) seems to crop up frequently in gateway
documents.

My question is, is there any way in which the currency symbol can be
retrieved with the data without needing to alter the SQL that exists
now ? *This will need to work irrespective of the type of program that
connects to the database - UNIX/C/COBOL and VB/ASP/.NET. *If it's not
possible, how is the SQL altered to achieve this ?

Thanks in advance.

Laurence
Afaik, currency symbol is not stored with MONEY datatype, only the
value, so it's a bit unclear how you retrieve it now. Can you post an
example? And, as a side note, SQL Server's currency symbols in
literals support, as in

DECLARE @amount AS MONEY
SET @amount = $100

is not available in Oracle, so if your code uses anything like this,
it will need to be altered to remove currency symbols from such
literals.

Regards,
Vladimir M. Zakharychev
N-Networks, makers of Dynamic PSP(tm)
http://www.dynamicpsp.com


Reply With Quote
  #7  
Old   
Vladimir M. Zakharychev
 
Posts: n/a

Default Re: Money Data - 11-28-2008 , 12:01 PM



On Nov 28, 7:17*pm, Laurence <i.l.bre... (AT) open (DOT) ac.uk> wrote:
Quote:
Hi ,

I'm in the process of migrating a SQLServer database to Oracle. *This
is the first Oracle database I've been involved with and I'm aware
that there is no money data type in Oracle. *I appreciate that the
columns that need to hold money will need to be number datatypes, and
I notice that number(19,4) seems to crop up frequently in gateway
documents.

My question is, is there any way in which the currency symbol can be
retrieved with the data without needing to alter the SQL that exists
now ? *This will need to work irrespective of the type of program that
connects to the database - UNIX/C/COBOL and VB/ASP/.NET. *If it's not
possible, how is the SQL altered to achieve this ?

Thanks in advance.

Laurence
Afaik, currency symbol is not stored with MONEY datatype, only the
value, so it's a bit unclear how you retrieve it now. Can you post an
example? And, as a side note, SQL Server's currency symbols in
literals support, as in

DECLARE @amount AS MONEY
SET @amount = $100

is not available in Oracle, so if your code uses anything like this,
it will need to be altered to remove currency symbols from such
literals.

Regards,
Vladimir M. Zakharychev
N-Networks, makers of Dynamic PSP(tm)
http://www.dynamicpsp.com


Reply With Quote
  #8  
Old   
Vladimir M. Zakharychev
 
Posts: n/a

Default Re: Money Data - 11-28-2008 , 12:01 PM



On Nov 28, 7:17*pm, Laurence <i.l.bre... (AT) open (DOT) ac.uk> wrote:
Quote:
Hi ,

I'm in the process of migrating a SQLServer database to Oracle. *This
is the first Oracle database I've been involved with and I'm aware
that there is no money data type in Oracle. *I appreciate that the
columns that need to hold money will need to be number datatypes, and
I notice that number(19,4) seems to crop up frequently in gateway
documents.

My question is, is there any way in which the currency symbol can be
retrieved with the data without needing to alter the SQL that exists
now ? *This will need to work irrespective of the type of program that
connects to the database - UNIX/C/COBOL and VB/ASP/.NET. *If it's not
possible, how is the SQL altered to achieve this ?

Thanks in advance.

Laurence
Afaik, currency symbol is not stored with MONEY datatype, only the
value, so it's a bit unclear how you retrieve it now. Can you post an
example? And, as a side note, SQL Server's currency symbols in
literals support, as in

DECLARE @amount AS MONEY
SET @amount = $100

is not available in Oracle, so if your code uses anything like this,
it will need to be altered to remove currency symbols from such
literals.

Regards,
Vladimir M. Zakharychev
N-Networks, makers of Dynamic PSP(tm)
http://www.dynamicpsp.com


Reply With Quote
  #9  
Old   
Vladimir M. Zakharychev
 
Posts: n/a

Default Re: Money Data - 11-28-2008 , 12:01 PM



On Nov 28, 7:17*pm, Laurence <i.l.bre... (AT) open (DOT) ac.uk> wrote:
Quote:
Hi ,

I'm in the process of migrating a SQLServer database to Oracle. *This
is the first Oracle database I've been involved with and I'm aware
that there is no money data type in Oracle. *I appreciate that the
columns that need to hold money will need to be number datatypes, and
I notice that number(19,4) seems to crop up frequently in gateway
documents.

My question is, is there any way in which the currency symbol can be
retrieved with the data without needing to alter the SQL that exists
now ? *This will need to work irrespective of the type of program that
connects to the database - UNIX/C/COBOL and VB/ASP/.NET. *If it's not
possible, how is the SQL altered to achieve this ?

Thanks in advance.

Laurence
Afaik, currency symbol is not stored with MONEY datatype, only the
value, so it's a bit unclear how you retrieve it now. Can you post an
example? And, as a side note, SQL Server's currency symbols in
literals support, as in

DECLARE @amount AS MONEY
SET @amount = $100

is not available in Oracle, so if your code uses anything like this,
it will need to be altered to remove currency symbols from such
literals.

Regards,
Vladimir M. Zakharychev
N-Networks, makers of Dynamic PSP(tm)
http://www.dynamicpsp.com


Reply With Quote
  #10  
Old   
Mark D Powell
 
Posts: n/a

Default Re: Money Data - 11-29-2008 , 04:12 PM



On Nov 28, 11:34*am, "gym dot scuba dot kennedy at gmail"
<kenned... (AT) verizon (DOT) net> wrote:
Quote:
"Laurence" <i.l.bre... (AT) open (DOT) ac.uk> wrote in message

news:d5d414a8-2dd6-4efc-b8e7-09eb9874e24c (AT) x14g2000yqk (DOT) googlegroups.com...



Hi ,

I'm in the process of migrating a SQLServer database to Oracle. *This
is the first Oracle database I've been involved with and I'm aware
that there is no money data type in Oracle. *I appreciate that the
columns that need to hold money will need to be number datatypes, and
I notice that number(19,4) seems to crop up frequently in gateway
documents.

My question is, is there any way in which the currency symbol can be
retrieved with the data without needing to alter the SQL that exists
now ? *This will need to work irrespective of the type of program that
connects to the database - UNIX/C/COBOL and VB/ASP/.NET. *If it's not
possible, how is the SQL altered to achieve this ?

Thanks in advance.

Laurence

It sounds like you want to alter a number to look like $xxx.xx or whatever
the currency is that you desire. *You can set the nls_currency for the
particular connection and request the number be converted to a string
to_char(field, format string) *see the docs.
Jim- Hide quoted text -

- Show quoted text -
I agree with Jim. The specific document in question that explains the
to_char function and format masks is the SQL manual.

http://download.oracle.com/docs/cd/B...htm#SQLRF06130

HTH -- Mark D Powell --


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.