[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
[mv] Multi-Segmented SQL Index Keys
****** message to minivend-users from "James Guillot" <jwguillot@huntforpro.com> ******
I have two questions about segmented keys. The
mail archive search seems to be down.
I'm using RedHat Linux 6.1, Minivend 4.04, and
MySQL 3.22.32. Everything works fine
except I want to use segmented primary indexes.
1st question:
I have a file f4208 which has a segmented index
based on two fields pgcpgp CHAR(8)
and pgmcat CHAR(3). How do you tell minivend
that the primary key has multiple fields?
I considered concating the two fields, but
there are other situations where I have
a multi-segment indexes that are numeric for
segments 2 and 3.
2nd question:
This syntax
[calc] $clv = [data table="f4208"
column="pgclv" key="[perl]$cpgp[/perl] and
pgmcat=[sql-param imprgr]"] [/calc]
results in
select pgclv from f4208 where pgcpgp = 'GATA
and pgmcat=DFLT'
which doesn't work because pgcpgp is being
compared to the whole string.
But if I add a bogus numeric field (pgfoo) to
the top of f4208 and make it the primary key the
following
syntax works!
[calc] $clv = [data table="f4208" column="pgclv"
key="1 and pgcpgp='[perl]$cpgp[/perl]' and
pgmcat='[sql-param imprgr]'"] [/calc]
results in
select pgclv from f4208 where pgfoo=1 and
pgcpgp='GATA' and pgmcat='DFLT'
which returns the correct results! I'd rather
not have to use the bogus pgf00 field if
I don't have to. Anybody have any suggestions?
Thanks!
James W. Guillot
MIS Manager
Hunt Forest Products, Inc.
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list