Re: [Info-Ingres] String Manipulations



Hi Puneet,

I think you will get a faster response if you reply to the group. May I
suggest also that you spend some time looking at previous postings.
Some of your questions may have been answered in the past. For the
syntax related questions, you need to refer to your manuals.

Myself, I would not use stored db procedures for text manipulation. I
believe databases are for retrieving data not business logic. I think
there are much better text processing / substitution tools. I'm an old
unix man so I tend to live in the past with awk, grep, sed and vi.
These co-operate beautifully with Ingres scripting so you can set up a
repeatable process.

But dont underestimate the power of MS tools such as Word, Access and
possibly the most powerful tool on the planet - Excel. You can link
these tools to ingres and use regular vb scripts to modify data. hmmm
am I wandering off topic?

Paul





________________________________

From: Puneet Bagoria [mailto:puneet138@xxxxxxxxx]
Sent: Thursday, 15 March 2007 9:54 PM
To: Paul White
Subject: Re: [Info-Ingres] String Manipulations


Hi Paul,

The scenario is something like this
I have one table which as data as 1-2-3 , now i have another
table where 1,2,3 are mapped to some string values , taking values 1,2,3
i have to create a string mapping something like A>B>C . The string are
defined in some other table.
I wanted to know how can we iterate records writing scripts,
what is the syntax or what could be the best possible to this, I think I
have to use a procedure.

Thanks,
Puneet


On 3/15/07, Paul White <pwhite@xxxxxxxxxxxxxxxxx> wrote:

Hi Puneet,

Do you mean something like this?

create newtable1 as
select
left(olddata,1) as f1,
right(left(olddata,3),2 as f2,

right(left(olddata,5),2 as f3
from oldtable

create newtable2 as
select L1.lookupvalue f1, L2.lookupvalue f2 ,
L3.lookupvalue f3
from newtable1 N1
left join lookup1 L1 on N1.f1 = L1.lookupfield

left join lookup2 L2 on N1.f2 = L2.lookupfield

left join lookup3 L3 on N1.f3 = L3.lookupfield


create newtable3 as
select trim(f1) + '>' + trim(f2) + '>' + trim(f3)
from newtable2


For variable length fields you can use text search.


How much data are you converting?


________________________________

From: info-ingres-bounces@xxxxxxxxxxxxxxxxxxxxxxxxx
[mailto:info-ingres-bounces@xxxxxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
Puneet Bagoria
Sent: Thursday, 15 March 2007 7:42 PM
To: Info-Ingres@xxxxxxxxxxxxxxxxxxxxxxxxx
Subject: [Info-Ingres] String Manipulations




Hi ,

I have data in table column like this 1-2-3 .. I
need to manipulate this string and make a new format something like this
A>B>C(A,B,C are the values present in different table,these will be
retrieved querying the table using the values 1,2,3)

Can any one please provide any workaround to
manipulate strings while using SQL test.

Thanks,
Puneet


_______________________________________________
Info-Ingres mailing list
Info-Ingres@xxxxxxxxxxxxxxxxxxxxxxxxx

http://www.kettleriverconsulting.com/mailman/listinfo/info-ingres






Relevant Pages

  • Re: Extract value from table cell
    ... Is there anyway I can do string ... > manipulations in VB for Microsfot word. ... You can go to Tools> References and add a reference to the Microsoft ...
    (microsoft.public.word.vba.beginners)
  • Re: Efficient fixed width string substition puzzle
    ... I am essentially dealing with data records similar to ... > is a string, StringBuilders, or character array. ... > manipulations, I want to grab a copy of the record as a string. ... It sounds like keeping it in a char array is indeed going to be ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Can Turing machines do arithmetic?
    ... it's an issue of defining the string ... >>manipulations necessary to represent addition. ...
    (comp.programming)
  • Re: Introduction and Question re: Row Delimiter probs
    ... My preference for text ... > manipulations is PERL. ... > local string variable, and check the length of the string, then output ...
    (microsoft.public.sqlserver.dts)
  • Re: [Info-Ingres] String Manipulations
    ... create newtable1 as ... Puneet Bagoria ... Subject: String Manipulations ... Can any one please provide any workaround to manipulate strings ...
    (comp.databases.ingres)

Loading