将mssql导出到sqllite后使用代码的问题

时间:2016-09-23 00:00:20

标签: perl sqlite template-toolkit dancer

我正在尝试将网站从使用MS-SQL数据库转移到SQLite。因此,我将MS-SQL数据库导出到SQLite并将其与Dancer成功连接,后者是使用Template Toolkit的轻量级Perl Web框架。

我现在遇到了FOREACH循环的问题。数据正常传递 - 使用debug to_dumper($ test)语句进行测试 - 但TT没有显示它。您是否意识到MS-SSQL和SQLite之间存在任何差异?其他FOREACH循环似乎也具有相同的非显示数据问题。

非常感谢任何想法!

传递的数据的尾部是:

cdr

memcached查询与基于MS-SQL的站点使用相同:

{
    'OneLiner' => 'Cruise on the Kerala backwaters',
    'Meta_Descr' => 'Get inspired by the trip ideas on our Traveller\'s Palm website. We are passionate about India and will be delighted to help you in designing your own tailor-made tour.',
    'PageName' => 'Popular Tours',
    'Introduction' => 'Tried and tested by thousands of clients over thirty years, these tours are the classics that always deliver. Tweaked and perfected based on our clients\' feedback these tours give you that perfect introduction to India or are the quickest way to travel between your old favourites. Rajasthan, Kerala, Goa and North India all feature on these tours and with good reason.

  We\'d also be happy to make any personalized changes or additions to these itineraries if you so choose and add your personal twist to these well-loved highlights.',
    'Meta_Title' => 'Popular Tours - Experience India | Traveller\'s Palm',
    'url' => 'popular-tours',
    'Themes_id' => 7,
    'Meta_Keywords' => 'popular holidays india, tailor-made popular india tours, popular india custom tour'
  },
  {
    'Meta_Title' => 'Romance - Experience India | Traveller\'s Palm',
    'Introduction' => 'Muslin draped four poster bed or a gently moving boat in the tropical backwaters? Tracking a tiger or exploring a working farm? Your romantic getaway can be what you want it to be; a sybaritic time with your beloved or an active and adventurous time shared with your spouse.',
    'Meta_Descr' => 'Get inspired by the trip ideas on our Traveller\'s Palm website. We are passionate about India and will be delighted to help you experience the romance of travel in India.',
    'PageName' => 'Romance',
    'OneLiner' => 'Looking for a romantic getaway',
    'Meta_Keywords' => 'romantic holidays india, tailor-made india romantic holidays, india honeymoon tour',
    'Themes_id' => 12,
    'url' => 'romance'
  }
]; in /home/user/webapps/travelo/lib/xxx/MemcacheDB.pm l. 1483

TT中的相关html部分是:

sub themes {
return memcached_get_or_set('themes',sub {
my $qry =  "SELECT pagename,introduction,url, oneliner,
                    meta_title,meta_descr,meta_keywords,themes_id
             FROM themes";

my $test = database('sqlserver')
            ->selectall_arrayref( $qry, { Slice => {} } );
debug to_dumper($test);
return $test;
});
}

0 个答案:

没有答案