Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] Multi-Segmented SQL Index Keys



******    message to minivend-users from Mike Heins <mikeh@minivend.com>     ******

Quoting 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.

I don't really understand the issue of multi-segmented keys and why
you would use them. I can understand some parts of it, I guess, but
how do you get that value back to work with it?

> 
> 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.

This should never work. You would have to use this instead:

    [query
	list=1
	sql="select pgclv from f4208 where your conditions LIMIT 1"
	][sql-code][/query]

That could replace your data tag, which was never intended to do
more than select one field based on a simple primary key.

-- 
Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.8220 fax 7501 <heins@akopia.com>

Any man who is under 30, and is not liberal, has not heart; and any man
who is over 30, and is not a conservative, has not brains.
 -- Winston Churchill
-
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


Search for: Match: Format: Sort by: