Mailing List Archive

query error in products search
Hi all.

I use the following code in the promo component
to show only items in stock

[query arrayref=main

SELECT m.sku, m.timed_promotion, m.start_date, m.finish_date
FROM [either]__UI_MERCH_TABLE__[or]merchandising[/either] m, inventory i
WHERE m.featured = '[control promo_type specials]'
AND i.sku = m.sku
AND i.quantity >= 1

"][/query]


runs OK, but now I try to use locale options in the products database,
and I have the following error:

Died in server spawn: Bad column name (from m.sku): 'm.sku' at
/home/interch/interchange/lib/Vend/SQL_Parser.pm line 838.


The database configuration is:

Database products products.txt __SQLDSN__
Database products KEY sku
Database products HIDE_FIELD inactive
Database products COLUMN_DEF "sku=char(64) NOT NULL PRIMARY KEY"
Database products COLUMN_DEF "description=varchar(128) NOT NULL"
Database products COLUMN_DEF "title=varchar(128) DEFAULT '' NOT NULL"
Database products INDEX title
Database products COLUMN_DEF "template_page=varchar(64)"
Database products COLUMN_DEF "comment=TEXT"
Database products COLUMN_DEF "thumb=varchar(128)"
Database products COLUMN_DEF "image=varchar(64)"
Database products COLUMN_DEF "price=DECIMAL(12,2) NOT NULL"
Database products INDEX price
Database products COLUMN_DEF "category=varchar(64) NOT NULL DEFAULT ''"
Database products INDEX category
Database products COLUMN_DEF "prod_group=varchar(64) NOT NULL
DEFAULT ''"
Database products INDEX prod_group
Database products COLUMN_DEF "nontaxable=CHAR(3)"
Database products COLUMN_DEF "weight=varchar(12) DEFAULT '0' NOT NULL"
Database products COLUMN_DEF "size=varchar(96)"
Database products COLUMN_DEF "color=varchar(96)"
Database products COLUMN_DEF "author=varchar(255)"
Database products COLUMN_DEF "related=text"
Database products COLUMN_DEF "featured=varchar(32)"
Database products COLUMN_DEF "inactive=varchar(3) DEFAULT ''"
Database products COLUMN_DEF "gift_cert=varchar(3) DEFAULT ''"
Database products NUMERIC price

Variable CURLOCALE es_ES
include dbconf/locales/default.cfg

# Options
Database options MAP_OPTIONS share __CURLOCALE__ options___CURLOCALE__
Database options MAP o_label __CURLOCALE__ options___CURLOCALE__::o_label
Database options MAP description __CURLOCALE__
options___CURLOCALE__::description
ifdef SQLDSN
Database options___CURLOCALE__ options___CURLOCALE__.txt __SQLDSN__
endif
ifndef SQLDSN
Database options___CURLOCALE__ options___CURLOCALE__.txt TAB
endif

# Products
Database products MAP_OPTIONS share __CURLOCALE__ products___CURLOCALE__
area area___CURLOCALE__ cat cat___CURLOCALE__
Database products MAP description __CURLOCALE__
products___CURLOCALE__::description
Database products MAP description fallback 1
Database products MAP title __CURLOCALE__ products___CURLOCALE__::title
Database products MAP title fallback 1
Database products MAP comment __CURLOCALE__ products___CURLOCALE__::comment
Database products MAP comment fallback 1
Database products MAP prod_group __CURLOCALE__
products___CURLOCALE__::prod_group
Database products MAP prod_group fallback 1
Database products MAP category __CURLOCALE__
products___CURLOCALE__::category
Database products MAP category fallback 1
ifdef SQLDSN
Database products___CURLOCALE__ products___CURLOCALE__.txt __SQLDSN__
Database products___CURLOCALE__ COLUMN_DEF "sku=char(64) NOT NULL
PRIMARY KEY"
Database products___CURLOCALE__ COLUMN_DEF "description=varchar(128) NOT
NULL"
Database products___CURLOCALE__ COLUMN_DEF "title=varchar(128) DEFAULT
'' NOT NULL"
Database products___CURLOCALE__ COLUMN_DEF "comment=TEXT"
Database products___CURLOCALE__ COLUMN_DEF "category=varchar(64) NOT
NULL DEFAULT ''"
Database products___CURLOCALE__ COLUMN_DEF "prod_group=varchar(64) NOT
NULL DEFAULT ''"
endif
ifndef SQLDSN
Database products___CURLOCALE__ products___CURLOCALE__.txt TAB
endif



best regards
Salvador Caballé

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: query error in products search - more Info [ In reply to ]
> Hi all.
>
> I use the following code in the promo component
> to show only items in stock
>
> [.query arrayref=main
>
> SELECT m.sku, m.timed_promotion, m.start_date, m.finish_date
> FROM [either]__UI_MERCH_TABLE__[or]merchandising[/either] m, inventory i
> WHERE m.featured = '[control promo_type specials]'
> AND i.sku = m.sku
> AND i.quantity >= 1
>
> "][/query]
>
>
> runs OK, but now I try to use locale options in the products
database, and I have the following error:
>
> Died in server spawn: Bad column name (from m.sku): 'm.sku' at
/home/interch/interchange/lib/Vend/SQL_Parser.pm line 838.


More info:

No errors with a single table SQL query

if I disable the localized products table,

#Variable CURLOCALE es_ES
#include dbconf/locales/default.cfg

and restarts Interchange
the 2 tables SQL query works OK and no errors


Seems a bug in SQL_Parser.pm


Salvador


_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: query error in products search [ In reply to ]
On 04/28/2015 10:50 PM, Salvador Caballe wrote:
> Hi all.
>
> I use the following code in the promo component
> to show only items in stock
>
> [.query arrayref=main
>
> SELECT m.sku, m.timed_promotion, m.start_date, m.finish_date
> FROM [either]__UI_MERCH_TABLE__[or]merchandising[/either] m, inventory i
> WHERE m.featured = '[control promo_type specials]'
> AND i.sku = m.sku
> AND i.quantity >= 1
>
> "][/query]
>
>
> runs OK, but now I try to use locale options in the products database, and I have the following error:
>
> Died in server spawn: Bad column name (from m.sku): 'm.sku' at /home/interch/interchange/lib/Vend/SQL_Parser.pm line 838.

Unfortunately the support for MAP and queries using multiple tables is limited / missing.

Regards
Racke

>
>
> The database configuration is:
>
> Database products products.txt __SQLDSN__
> Database products KEY sku
> Database products HIDE_FIELD inactive
> Database products COLUMN_DEF "sku=char(64) NOT NULL PRIMARY KEY"
> Database products COLUMN_DEF "description=varchar(128) NOT NULL"
> Database products COLUMN_DEF "title=varchar(128) DEFAULT '' NOT NULL"
> Database products INDEX title
> Database products COLUMN_DEF "template_page=varchar(64)"
> Database products COLUMN_DEF "comment=TEXT"
> Database products COLUMN_DEF "thumb=varchar(128)"
> Database products COLUMN_DEF "image=varchar(64)"
> Database products COLUMN_DEF "price=DECIMAL(12,2) NOT NULL"
> Database products INDEX price
> Database products COLUMN_DEF "category=varchar(64) NOT NULL DEFAULT ''"
> Database products INDEX category
> Database products COLUMN_DEF "prod_group=varchar(64) NOT NULL DEFAULT ''"
> Database products INDEX prod_group
> Database products COLUMN_DEF "nontaxable=CHAR(3)"
> Database products COLUMN_DEF "weight=varchar(12) DEFAULT '0' NOT NULL"
> Database products COLUMN_DEF "size=varchar(96)"
> Database products COLUMN_DEF "color=varchar(96)"
> Database products COLUMN_DEF "author=varchar(255)"
> Database products COLUMN_DEF "related=text"
> Database products COLUMN_DEF "featured=varchar(32)"
> Database products COLUMN_DEF "inactive=varchar(3) DEFAULT ''"
> Database products COLUMN_DEF "gift_cert=varchar(3) DEFAULT ''"
> Database products NUMERIC price
>
> Variable CURLOCALE es_ES
> include dbconf/locales/default.cfg
>
> # Options
> Database options MAP_OPTIONS share __CURLOCALE__ options___CURLOCALE__
> Database options MAP o_label __CURLOCALE__ options___CURLOCALE__::o_label
> Database options MAP description __CURLOCALE__ options___CURLOCALE__::description
> ifdef SQLDSN
> Database options___CURLOCALE__ options___CURLOCALE__.txt __SQLDSN__
> endif
> ifndef SQLDSN
> Database options___CURLOCALE__ options___CURLOCALE__.txt TAB
> endif
>
> # Products
> Database products MAP_OPTIONS share __CURLOCALE__ products___CURLOCALE__ area area___CURLOCALE__ cat cat___CURLOCALE__
> Database products MAP description __CURLOCALE__ products___CURLOCALE__::description
> Database products MAP description fallback 1
> Database products MAP title __CURLOCALE__ products___CURLOCALE__::title
> Database products MAP title fallback 1
> Database products MAP comment __CURLOCALE__ products___CURLOCALE__::comment
> Database products MAP comment fallback 1
> Database products MAP prod_group __CURLOCALE__ products___CURLOCALE__::prod_group
> Database products MAP prod_group fallback 1
> Database products MAP category __CURLOCALE__ products___CURLOCALE__::category
> Database products MAP category fallback 1
> ifdef SQLDSN
> Database products___CURLOCALE__ products___CURLOCALE__.txt __SQLDSN__
> Database products___CURLOCALE__ COLUMN_DEF "sku=char(64) NOT NULL PRIMARY KEY"
> Database products___CURLOCALE__ COLUMN_DEF "description=varchar(128) NOT NULL"
> Database products___CURLOCALE__ COLUMN_DEF "title=varchar(128) DEFAULT '' NOT NULL"
> Database products___CURLOCALE__ COLUMN_DEF "comment=TEXT"
> Database products___CURLOCALE__ COLUMN_DEF "category=varchar(64) NOT NULL DEFAULT ''"
> Database products___CURLOCALE__ COLUMN_DEF "prod_group=varchar(64) NOT NULL DEFAULT ''"
> endif
> ifndef SQLDSN
> Database products___CURLOCALE__ products___CURLOCALE__.txt TAB
> endif
>
>
>
> best regards
> Salvador Caballé
>
> _______________________________________________
> interchange-users mailing list
> interchange-users@icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users


--
Modern Perl, Dancer and eCommerce consulting.

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: query error in products search [ In reply to ]
El 30/04/15 a les 08:42, Stefan Hornburg (Racke) ha escrit:
> On 04/28/2015 10:50 PM, Salvador Caballe wrote:
>> Hi all.
>>
>> I use the following code in the promo component
>> to show only items in stock
>>
>> [.query arrayref=main
>>
>> SELECT m.sku, m.timed_promotion, m.start_date, m.finish_date
>> FROM [either]__UI_MERCH_TABLE__[or]merchandising[/either] m, inventory i
>> WHERE m.featured = '[control promo_type specials]'
>> AND i.sku = m.sku
>> AND i.quantity >= 1
>>
>> "][/query]
>>
>>
>> runs OK, but now I try to use locale options in the products database, and I have the following error:
>>
>> Died in server spawn: Bad column name (from m.sku): 'm.sku' at /home/interch/interchange/lib/Vend/SQL_Parser.pm line 838.
>
> Unfortunately the support for MAP and queries using multiple tables is limited / missing.
>
> Regards
> Racke
>
>>


Is possible to do the same multimple table query with interchange
search instead SQL ??

Salvador



_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users