Re: [Info-Ingres] String Manipulations
- From: "Paul White" <pwhite@xxxxxxxxxxxxxxxxx>
- Date: Fri, 16 Mar 2007 10:39:29 +1100
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
- Follow-Ups:
- Re: [Info-Ingres] String Manipulations
- From: Emiliano
- Re: [Info-Ingres] String Manipulations
- Prev by Date: Call for Papers: UK Ingres User Association Conference 2007
- Next by Date: Re: [Info-Ingres] String Manipulations
- Previous by thread: Re: [Info-Ingres] String Manipulations
- Next by thread: Re: [Info-Ingres] String Manipulations
- Index(es):
Relevant Pages
|
Loading