質問 > 管理機能 > 高度な設定SQLについて |
管理機能
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | 下へ |
投稿者 | スレッド |
---|---|
angie |
投稿日時: 2011/8/23 20:42
対応状況: −−−
|
常連 登録日: 2011/6/10 居住地: 投稿: 46 |
高度な設定SQLについて 教えてください。
受注データを抽出するCSV出力を作成したいのですが、 '' as お届け先コード , mp1.pref_name || deliv_addr01 as お届け先住所1 , deliv_addr02 as お届け先住所2 , '' as お届け先住所3 , deliv_name01 || ' ' || deliv_name02 as お届け先名称1 , '' as お届け先名称2 , deliv_tel01 || '-' || deliv_tel02 || '-' || deliv_tel03 as お届け先電話番号 , deliv_zip01 || deliv_zip02 as お届け先郵便番号 , customer_id as 顧客コード , mp2.pref_name || order_addr01 as ご依頼者住所1 , order_addr02 as ご依頼者住所2 , order_name01 || ' ' || order_name02 as ご依頼者名称1 , '' as ご依頼者名称2 , order_tel01 || '-' || order_tel02 || '-' || order_tel03 as ご依頼者電話番号 , order_zip01 || order_zip02 as ご依頼者郵便番号 from dtb_order , mtb_pref mp1, mtb_pref mp2 where deliv_no is null and status < 3 and dtb_order.deliv_pref = mp1.pref_id and dtb_order.order_pref = mp2.pref_id を実行すると、 [nativecode=ERROR: operator does not exist: text = smallint LINE 19: and dtb_order.deliv_pref = mp1.pref_id ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.] とエラーがでるのですが、 何をどうすればいいのでしょうか? ---------------------------- [EC-CUBE] 2.4.4 [PHP] PHP 5.2.13 [データベース] PostgreSQL 8.4.1 ---------------------------- |
ECCUORE |
投稿日時: 2011/8/24 9:23
対応状況: −−−
|
長老 登録日: 2009/10/22 居住地: 東京 投稿: 248 |
Re: 高度な設定SQLについて 暗黙の型変換によるエラーです。
カラムの型 deliv_pref text pref_id int2 dtb_order.deliv_pref = mp1.pref_id ↓ dtb_order.deliv_pref = cast (mp1.pref_id as text)
|
angie |
投稿日時: 2011/8/24 9:58
対応状況: −−−
|
常連 登録日: 2011/6/10 居住地: 投稿: 46 |
Re: 高度な設定SQLについて castをどう書いたらいいのか、よくわかりませんでした。
ご丁寧にありがとうございました。 助かりました。 |
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | トップ |