Re: IsNumeric Function Like MS SQL??



Thanks Scott,

I may have found an alternative way of doing this, how does this look:

Select case when MyVarCharField is not null and MyVarCharField <> ''
then Cast(MyVarCharField as Decimal(11,3)) else cast(null as
decimal(11,3)) end as MyDecimalField From MyFunkyTable

I'm trying to do this blind as I don't have full time access to the
Progess server (the joys of this strange contract). This works with
the data I have in a MS SQL server DB, I'm assured that the data will
"always" be Null as Zero Lenght String or a number in this column.

Thanks for your help on this...

Andy



Scott Auge wrote:
In article <1139231409.515693.310900@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"AndyW" <AndrewMWalker@xxxxxxxxxxxxxx> wrote:

Hi

I'm new at this progress stuff so I'm hoping someone can help me.

In MS SQL server we have a functions called IsNumeric and IsDate.
These allow you to evaluate data before processing it.

We have a DB where everything is stored as VarChar fields (I'm told
this is for good reason)

They lied. You're stuck working with screwy data so prepare to deal
with screwy ways to work with it.


What I'm trying to do is convert these VarChars to their correct data
types when I select them. In SQL Server I'd do this:

Select Case When IsNumeric(myVarCharField)= 1 then Cast(myVarCharField
as Decimal(11,3) ) else Cast(Null as Decimal(11,3) ) end As
MyDcecimalField From MyTable.

You got to table scan it and then decide if you want it or not.

FOR EACH MyTable NO-LOCK:
IF YourFunction(MyTable.A) THEN DO: ...
END. /* FOR EACH MyTable */


We're using Progress 9, can anyone tell me how to convert my MS SQL so
that it works with this version please.

I don't think so dude. There are resources to change it into MySQL and
PostgreSQL databases though.


Thanks

Andy

You should put down what version of Progress you are using also as well
as operating system.

--

.



Relevant Pages

  • Re: IsNumeric Function Like MS SQL??
    ... I'm new at this progress stuff so I'm hoping someone can help me. ... In MS SQL server we have a functions called IsNumeric and IsDate. ... You're stuck working with screwy data so prepare to deal ... FOR EACH MyTable NO-LOCK: ...
    (comp.databases.progress)
  • Biztalk Server 2004 - Database synchronization
    ... I have a requirement where in I need to synchronize my legacy Progress ... row to get inserted into my SQL Server table as well. ... various options to access this database from biztalk? ...
    (microsoft.public.biztalk.general)
  • Re: Biztalk Server 2004 - Database synchronization
    ... There are cases where these types of problems are well addressed by BizTalk ... > I have a requirement where in I need to synchronize my legacy Progress ... > database to SQL Server. ... > row to get inserted into my SQL Server table as well. ...
    (microsoft.public.biztalk.general)
  • Date functions in sql statements
    ... I am working for a company that uses both SQL server and Progress dbs. ... They want to use SQL Server Reporting Services to generate a whole ... I'd like to somehow pull the month and year out of sysdate and concat ...
    (comp.databases.progress)
  • Re: Progress ODBC Connection Problem
    ... SELECT prod, cono, whse ... trying to connect to a progress 9.1E db. ... I have the Datadirect drivers ... SQL Server Inport & Export Wizard ...
    (microsoft.public.sqlserver.odbc)