Problem with decimal datatype!

Can someone help me?
I'm trying to write some stored procedures using sql anywhere. I've
declared one of the columns in one of my tables to be of type
DECIMAL(3,1). However, when I insert a number like11.3, I just keep
getting error messages ( "value 11.3 out of range for destination" ).
I've tried using other datatypes, and have checked the online help, but
with no luck. I keep getting the same error message. Can anyone tell me
why I keep getting this message?
Thanks, Mike

0
Mike
10/24/1999 7:17:58 PM
sybase.sqlanywhere.general 32637 articles. 4 followers. Follow

5 Replies
327 Views

Similar Articles

[PageSpeed] 17

Can you provide some DDL that I can use to reproduce this?
-- 
Jim Egan [TeamSybase]
Houston, TX
0
eganjp
10/25/1999 1:42:42 AM
What is DDL.

Jim Egan wrote:

> Can you provide some DDL that I can use to reproduce this?
> --
> Jim Egan [TeamSybase]
> Houston, TX

0
Mike
10/25/1999 6:25:55 PM
Mike R. wrote:
> 
> What is DDL.

Data Definition Language. Jim wants to see the underlying table
structure. Perhaps you could post the CREATE TABLE statement, as well as
any constraints you have added (primary/foreign keys, unique indexes,
CHECK constraints, etc.).

It would probably help if you could post a SMALL stored procedure that
generates the error, too.

Kathleen

> 
> Jim Egan wrote:
> 
> > Can you provide some DDL that I can use to reproduce this?
> > --
> > Jim Egan [TeamSybase]
> > Houston, TX
0
Kathleen
10/25/1999 7:05:47 PM
This is a multi-part message in MIME format.
--------------6FF175E103BCD760725ED098
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Here are the files you requested. I've included the CREATE table file, along
with two stored procedures ( one calls the other ), and my test sript to
insert some data into the table. If I insert 11.3 as a value for the
magnitude column, I get the error, but when I insert something like 9.3, it
works. Again, I've tried changing things around a bit and I can't get rid of
this error message. Also, if you have any other suggestions regarding my
code, I would like to hear it. Thanks, Mike R.

Kathleen Beaumont wrote:

> Mike R. wrote:
> >
> > What is DDL.
>
> Data Definition Language. Jim wants to see the underlying table
> structure. Perhaps you could post the CREATE TABLE statement, as well as
> any constraints you have added (primary/foreign keys, unique indexes,
> CHECK constraints, etc.).
>
> It would probably help if you could post a SMALL stored procedure that
> generates the error, too.
>
> Kathleen
>
> >
> > Jim Egan wrote:
> >
> > > Can you provide some DDL that I can use to reproduce this?
> > > --
> > > Jim Egan [TeamSybase]
> > > Houston, TX

--------------6FF175E103BCD760725ED098
Content-Type: text/plain; charset=us-ascii;
 name="new_general_cat.sql"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="new_general_cat.sql"

//*********************************************************
//*Created by     Mike Reinsch                            *
//*Creation date  10/3/1999                               *
//*Purpose        Create New General Cat table            *
//*********************************************************
//Last modification date: 10/18/1999
//Modification purpose:
//*********************************************************

DROP TABLE new_general_cat;

CREATE TABLE new_general_cat
(
   ngc_number           CHAR(5)      NOT NULL PRIMARY KEY,
   name                 VARCHAR(50)  NULL,
   constellation        VARCHAR(50)  NULL,
   magnitude            DECIMAL(3,1) NULL,
   distance             VARCHAR(50)  NULL,
   object_type          VARCHAR(50)  NULL,
   last_mod_date        DATETIME     NULL
)

--------------6FF175E103BCD760725ED098
Content-Type: text/plain; charset=us-ascii;
 name="bt_insert_ngc.sql"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="bt_insert_ngc.sql"

//*******************************************************************
//*Created by     Mike Reinsch                                      *
//*Creation date  10/2/1999                                         *
//*File Name      bt_insert_ngc                                     *
//*Purpose        Insert a record into the new_general_cat table    *
//*******************************************************************
//Last modification: 10/18/1999
//Modification purpose:
//***************************************************************

DROP PROCEDURE bt_insert_ngc;

CREATE PROCEDURE bt_insert_ngc
(
   IN p_ngc_number      CHAR(5),       //PRIMARY KEY
   IN p_name            VARCHAR(50),   //NULL
   IN p_constellation   VARCHAR(50),   //NULL
   IN p_magnitude       DECIMAL(2,1),  //NULL
   IN p_distance        VARCHAR(50),   //NULL
   IN p_object_type     VARCHAR(50)    //NULL
)

BEGIN

   DECLARE last_date DATETIME;

   IF EXISTS (SELECT ngc_number FROM new_general_cat WHERE ngc_number = p_ngc_number) THEN
      
      PRINT 'That object is already in the ngc table!';
      RETURN;

   ELSE

      BEGIN

      SET last_date = now();

      CALL ut_insert_ngc
      (
         p_ngc_number,
         p_name,
         p_constellation,
         p_magnitude,
         p_distance,
         p_object_type,
         last_date
      );

      END

   END IF;

END

--------------6FF175E103BCD760725ED098
Content-Type: text/plain; charset=us-ascii;
 name="ut_insert_ngc.sql"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ut_insert_ngc.sql"

//*******************************************************************
//*Created by       Mike Reinsch                                    *
//*Creation date    10/2/1999                                       *
//*File Name        ut_insert_ngc.sql                               *
//*Purpose          Insert a record into the new_general_cat table  *
//*******************************************************************
//Last modification: 10/18/1999
//Modification purpose:
//*******************************************************************

DROP PROCEDURE ut_insert_ngc;

CREATE PROCEDURE ut_insert_ngc
(
   IN p_ngc_number      CHAR(5),       //PRIMARY KEY
   IN p_name            VARCHAR(50),   //NULL
   IN p_constellation   VARCHAR(50),   //NULL
   IN p_magnitude       DECIMAL(2,1),  //NULL
   IN p_distance        VARCHAR(50),   //NULL
   IN p_object_type     VARCHAR(50),   //NULL
   IN p_last_date       DATETIME       //NULL
)

BEGIN

   INSERT INTO
      dba.new_general_cat
      (  ngc_number,
         name,
         constellation,
         magnitude,
         distance,
         object_type,
         last_mod_date  )

   VALUES
      (  p_ngc_number,
         p_name,
         p_constellation,
         p_magnitude,
         p_distance,
         p_object_type,
         p_last_date  );

END

--------------6FF175E103BCD760725ED098
Content-Type: text/plain; charset=us-ascii;
 name="test_insert_ngc.sql"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="test_insert_ngc.sql"

EXECUTE bt_insert_ngc
p_ngc_number = 224,
p_name = 'Andromeda Galaxy',
p_constellation = 'Andromeda',
p_magnitude = 3.7,
p_distance = '2.9 Million Light Years',
p_object_type = 'Spiral Galaxy'
GO

EXECUTE bt_insert_ngc
p_ngc_number = 1952,
p_name = 'Crab Nebula',
p_constellation = 'Taurus',
p_magnitude = 9.3,
p_distance = 'Unknown',
p_object_type = 'Super nova remnent'
GO

SELECT *
FROM  new_general_cat

--------------6FF175E103BCD760725ED098--

0
Mike
10/25/1999 9:31:46 PM
I was hoping for something a bit smaller.  Especially during Monday Night 
Football. <g>

Check your stored procedures.  The input parameter is specified as 
DECIMAL(2,1) while the table is DECIMAL(3,1).
-- 
Jim Egan [TeamSybase]
Houston, TX
0
eganjp
10/26/1999 2:09:29 AM
Reply:

Similar Artilces:

decimal datatype problem
I have the following code in my app (PB 9.0.1.7119 & ASE 11.0.3): decimal out //at the moment: dw_1.GetItemNumber(1, "field_1") is equal to 17,17 out = dw_1.GetItemNumber(1, "field_1") //after assignment out = 17,17000000000000256 What cases that situation? I happens very seldom. Do I have to round the value like the following: out = Round(dw_1.GetItemNumber(1, "field_1"), 2) BTW: field_1 is numeric(12,2) use this: decimal{2} c.burns "Piotr Nadolny" <pnad@o2.pl> ha scritto nel messaggio news:4063e9db@forums-2-dub...

Decimal datatype problem
Hi I am having some problems with the Decimal datatype in SQL 2005. I am using Visual Web Developer 2008 Express edition to develop a website that stores a value in a decimal column in a MSSQL 2005 database. I use the following command to store the value:Dim db As New TestDatabaseDataContextDim NewEntry As New TestTable NewEntry.TestDecimal= "52.123532" db.TestTable.InsertOnSubmit(NewEntry) db.SubmitChanges() When I then check the record in the database, it says 52.000000. What happened to the other 6 numbers on the right side? Check that the InsertOnSubmit code defines&nb...

datatype decimal problem
Hi   In my project i m using money datatype for 'fair fare' feild While retreiving into form that value is coming like suppose if the value is 3234 for that fare, in the web page it is showing like 3234.0000 4 zeros are coming. i want to show  2 numerics after decimal like 3234.00 ,500.50 like that .   please help me ,urgent. THANKS.     You can use on SQL server Convert(Varchar(20),YourMoneyTypefield,1) for example select Convert(Varchar(20),cast('33333.33' as money),1) in .NET you can use  Format(5459.4, "##,##0.00") Thanks JPazgierTh...

MySQL with PB5
Hi, I need to develope an application using MySQL (ver max-3.23.49) with MyODBC (ver 2.50.39) and PB5. I found a serious problem as describe below: 1. I have a table says WireDiameter code char(10) PK, sizeinmm decimal(5,2), sizeininch decimal(5,3) 2. Create a screen with datawindow for maintenance. 3. When I key in sizeinmm = 0.15 and sizeininch =0.012 and save (dw_1.update() ), the value save to table become 1.5 and 1.2. It seems like PB has converted the value to scientific notation (like 1.50000+e02 or whatever..). Does anyone has any idea about ...

MySQL with PB5
Hi, I need to develope an application using MySQL (ver max-3.23.49) with MyODBC (ver 2.50.39) and PB5. I found a serious problem as describe below: 1. I have a table says WireDiameter code char(10) PK, sizeinmm decimal(5,2), sizeininch decimal(5,3) 2. Create a screen with datawindow for maintenance. 3. When I key in sizeinmm = 0.15 and sizeininch =0.012 and save (dw_1.update() ), the value save to table become 1.5 and 1.2. It seems like PB has converted the value to scientific notation (like 1.50000+e02 or whatever..). Does anyone has any idea about ...

Problems Problems Problems
So, I have OpenSUSE installed on my laptop and everything is working well, except the wireless. It almost seems that every time I run a KDE distro I can not get the internet to work. I've run YaST and used iwconfig. nothing is working for me. Please help -ZAD -- zadnik18 ------------------------------------------------------------------------ someone is going to tell you to supply some more information 'My wireless doesn't work - a primer on what I should do next - openSUSE Forums' (http://tinyurl.com/6peanc) this is one of the stick...

Problems, problems, problems
Name: Product: Firefox Summary: Problems, problems, problems Comments: I use FF all the time for work - I'm a software tester - the add-ons are invaluable. But v3.5 really has been a disappointment. It just keeps hanging all the time. And when Internet Explorer windows pop up, FF often just dies. It can't even restart itself - I have to manually kill the process every time; every update, every add-on that updates, "restart" fails - it's so frustrating. I hope v3.6 will be addressing this - PLEASE! Browser Details: Mozilla/4.0 (compatible; MSIE 7....

Problems, problems, problems
Name: Hans Halvorsen Email: capricorn_at_online.no Product: Thunderbird Summary: Problems, problems, problems Comments: Hi, I downloaded Thunderbird some time ago, and I was over-satisfied whit it and how well it worked. In fact it worked 100% PERFECTLY UNTIL I got an newer update version of it. Since then I' ve had nothing BUT trouble! I've checked adresses, notes, password, deleted accounts and made new one's, checked sign-ins and sign-outs, passwords inside and out, upside and down, so many times that my frustration now is about to turn into pure and major ...

Problems problems and problems.
Name: A.A. Product: Firefox Summary: Problems problems and problems. Comments: I am not specific, but in short I can not use This site to listen music anymore, while I can in IE explorer. Just to let you guys know, new version messed something up. http://hypem.com/ Browser Details: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not CC) the sender for them to see it. ...

PROBLEMS, PROBLEMS, PROBLEMS.
Name: Product: Firefox Summary: PROBLEMS, PROBLEMS, PROBLEMS. Comments: Does Google's Chrome browser block out Firefox? Am having a lot of trouble getting Firefox to run after I run Chrome. No trouble what-so- ever before running Chrome. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1064 Safari/532.5 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not CC) the sender for them to see ...

Problems with decimal's datatypes in ACCESS 2000
Dear who may concern, I'd like to ask you a question, did you ever had a problem with decimal's data type using Power Builder 8.0 and Microsoft Access 2000. Thanks in advance. Regards depends. (as I re-call the problem I had PB did not recognize the type in the DB painter ) once I set the access 2000 data type to number/double with auto decimal then PB saw the field type as a double it starting to work. auto decimal may not matter. HTH "Antonio" <amolina@trevenque.es> wrote in message news:3f584604$1@forums-1-dub... > > Dear who ma...

CLR.NET datatype for decimal is System.String or Decimal
CLR.NET datatype for decimal is System.String or System.Decimal the documentation says System.string while it is mapped to DbType.decimal I need some understanding on this. any help thanks vsv ...

Problem with my problem?
Hi, folks. Three days ago, I posted that Sunbird was refusing to import the ICS file from the Firefox Calendar Extension. Nobody replied, so I can only assume that one of three situations exists: 1) The file is corrupt, and no one wants to give me the bad news; 2) This is a known problem with Sunbird, but no one knows the solution; 3) Everyone is hard at work 24/7 trying to figure out the solution to my problem (LOL). I've already discovered that I can copy and paste each event from the calendar extension to Sunbird one by one. Before I devote many hours of my life to th...

Problem after problem...
I'm done doing this. I can't setup .TEXT and the developer has next to nothing on his help page. For the past month I've been trying to set this up on my server and I'm done with it. My server is running Windows Server 2003 Enterprise SP1, IIS 6.0, ASP.NET 2.0 and SQL Server 2000. I've never been able to run a remote query to SQL Server 2000. I've never been used to SQL 2000 and I've never liked it. I would like to use SQL 2005 if my server were capable, but that's not happening. Every query to the box is expecting SQL Server 2005 and just errors out. I don't know ho...

Web resources about - Problem with decimal datatype! - sybase.sqlanywhere.general

Datatype generic programming in Scala
... level fixpoints and how it can be used to define generic abstractions like catamorphism and anamorphism . These are used extensively in datatype ...

Sabbatical week day 3: Raining datatypes
... 2: I fail at Octave (swizec.com) Learning me a Haskell (swizec.com) Non-Sabbatical (ringingtrue.net) How to insert a file to an Image datatype ...

Integer - Wikipedia, the free encyclopedia
) are formed by the natural numbers (including 0) ( 0 , 1 , 2 , 3 , ...) together with the negatives of the non-zero natural numbers ( −1 , −2, ...

CHARITY - Home Page
Charity is a categorical programming language currently beingdeveloped by The Charity Development Group in The Department of Computer Science ...

Adobe Director 11.5: Upgrade details
Accessibility Adobe Products Acrobat Creative Cloud Creative Suite Digital Marketing Suite Digital Publishing Suite Elements Photoshop Touch ...

Anzo Express - Cambridge Semantics
Semantic collaboration platform providing secure data integration, collaboration, and reporting in Microsoft Excel and on the Web.

Betting the Company on Windows 8
... and create something far less expensive than a PC which is powerful enough for Web browsing. This new platform would optimize for the datatypes ...

Q&A: SQL Date format for credit card - TechRepublic
Hi There, I am very new to MySQL and am creating a database for online payments etc. What datatype do I need to use for the credit card expiry ...

Data types - DBMS 2 : DataBase Management System Services
Analysis of data management technology optimized for specific datatypes, such as text, geospatial, object, RDF, or XML. Related subjects include: ...

Functional Programming with Python – Part 1
... instances wherein any modifications to the string result in a new String instance being created. Imagine the same happening to all the datatypes ...

Resources last updated: 2/12/2016 8:10:17 PM