Difference between revisions of "OE.PRODUCTS (view)"

From dbscript Online Help
Jump to: navigation, search
(New page: == wikibot == {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" |- | '''view | OE.PRODUCTS |- |} <pre> </pre>)
 
 
(4 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
|-
+
|- valign="top"
| '''view
+
| '''View
 
| OE.PRODUCTS
 
| OE.PRODUCTS
|-
 
 
|}
 
|}
  
 +
=== Source ===
 
<pre>
 
<pre>
 
+
CREATE OR REPLACE VIEW OE.PRODUCTS AS
 +
SELECT i.product_id
 +
,      d.language_id
 +
,      CASE WHEN d.language_id IS NOT NULL
 +
            THEN d.translated_name
 +
            ELSE TRANSLATE(i.product_name USING NCHAR_CS)
 +
      END    AS product_name
 +
,      i.category_id
 +
,      CASE WHEN d.language_id IS NOT NULL
 +
            THEN d.translated_description
 +
            ELSE TRANSLATE(i.product_description USING NCHAR_CS)
 +
      END    AS product_description
 +
,      i.weight_class
 +
,      i.warranty_period
 +
,      i.supplier_id
 +
,      i.product_status
 +
,      i.list_price
 +
,      i.min_price
 +
,      i.catalog_url
 +
FROM  product_information  i
 +
,      product_descriptions d
 +
WHERE  d.product_id  (+) = i.product_id
 +
AND    d.language_id (+) = sys_context('USERENV','LANG')
 
</pre>
 
</pre>

Latest revision as of 10:35, 27 August 2011

wikibot[edit]

View OE.PRODUCTS

Source[edit]

CREATE OR REPLACE VIEW OE.PRODUCTS AS 
SELECT i.product_id
,      d.language_id
,      CASE WHEN d.language_id IS NOT NULL
            THEN d.translated_name
            ELSE TRANSLATE(i.product_name USING NCHAR_CS)
       END    AS product_name
,      i.category_id
,      CASE WHEN d.language_id IS NOT NULL
            THEN d.translated_description
            ELSE TRANSLATE(i.product_description USING NCHAR_CS)
       END    AS product_description
,      i.weight_class
,      i.warranty_period
,      i.supplier_id
,      i.product_status
,      i.list_price
,      i.min_price
,      i.catalog_url
FROM   product_information  i
,      product_descriptions d
WHERE  d.product_id  (+) = i.product_id
AND    d.language_id (+) = sys_context('USERENV','LANG')