;***********************************************************************
;Licensed Materials - Property of IBM
;
;BI and PM: UDA
;
;(C) Copyright IBM Corp. 2005, 2020
;
;U.S. Government Users Restricted Rights - Use, duplication, or disclosure 
;by GSA ADP Schedule Contract with IBM Corp.
;
;Unless specifically authorized by IBM, you may not modify any part of this
;file. Where modification is authorized, you must reproduce any copyright
;notices contained in this file and specifically identify which
;modifications have been made by your organization. YOU ARE SOLELY
;RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF ANY MODIFICATIONS TO
;THIS FILE AND ASSUME ALL RISKS ASSOCIATED WITH THE USE AND DISTRIBUTION
;OF THE MODIFIED FILE. IBM will not provide support relating to
;unauthorized changes you make to this file.
;***********************************************************************
; $Header: $
;
; Module:
;    cogdmod_gp.ini
;
; Purpose:
;    This module contains the Greenplum gateway information.
;
; Notes:
;    Do NOT modify this file.  Doing so could result in unknown behavior
;    by the Greenplum gateway, possibly resulting in application aborts.
;
; ************************************************************************
 
[DATABASE:GREENPLUM]
Disable_Subquery_With_Parameters=T
Keyword Alias=" as \"%s\" "
SQL_API_SQLDESCRIBEPARAM="FALSE"

;No SQLCancel() is called
SQL_API_SQLCANCEL="FALSE"

;Cancel request and drop connection
;DROP_CONNECTION_ON_CANCEL="T"

[Exceptions Commands DATABASE:GREENPLUM]
Select="select "
Insert="insert "
Update="update "
Delete="delete "
Call="call "
Select_Star="T"
Max_Stmt_Len=""

[Exceptions Clauses DATABASE:GREENPLUM]
From="from"
Where="where"
Group_By="Group By"
Having="having"
Window=
With=
With_Recursive=

[Exceptions Tables DATABASE:GREENPLUM]
Derived=T
Joined=F
Simple_And_Joined=T
Tbl_Ref_Limit=""
SubSelect_Limit=""
Table_Constructor=T
UniqueName_Prefix="coguda"

[Exceptions Joins DATABASE:GREENPLUM]
Inner=T
Left_Outer=T
Right_Outer=T
Full_Outer=T
Cross=T
On_Condition_Or_Predicate=T
Nested_Outer=T
Inner_Tbl_Restrict=F
Optnl_Tbl_Restrict=F
Non_Equi_Joins=T
One_Outer=F
Natural=T
Left_Nested=T
Right_Nested=T
Two_Sided_Join_Restrict=F
Optnl_Tbl_Join_Restrict=F
Optnl_Tbl_Join_Filter=T
Optnl_Tbl_Filter=T
Prsrv_Tbl_Join_Filter=T
Prsrv_Tbl_Filter=T
On_Condition_Set_Functions=T
On_Condition_Subqueries=T
Full_Non_Equi_Join=F
On_Condition_In_Predicate=T
On_Condition_Not_Predicate=T
On_Condition_Like_Predicate=T
On_Condition_Between_Predicate=T
On_Condition_IsNull_Predicate=T
Non_Join_Expr=T
Non_Join_Non_Equi_Expr=T
Only_Eql_With_And=F
On_Condition_Functions=T
Two_Sided_Join_Restrict_Filter=F
Nested_Inner=T
Product_Join=T
Outer_Non_Equi_Join=T
On_Condition_No_Expr=T
Outer_Syntax=T
Left_Pre=
;Left_Eql=" LEFT OUTER JOIN "
Left_Post=
Right_Pre=
;Right_Eql=" RIGHT OUTER JOIN "
Right_Post=
;Full_Syntax=" FULL OUTER JOIN "
Full_Pre=
Full_Post=
;Inner_Syntax=" INNER JOIN "
Inner_Col_Pre=
Inner_Col_Post=
;Cross_Syntax=" CROSS JOIN "
;Union_Syntax=" UNION "
;Natural_Syntax=" NATURAL JOIN "

[Exceptions Predicates DATABASE:GREENPLUM]
Between="between"
In="in"
Like="like"
Is_Null="is null"
Any="any"
All=
Exists="exists"
NotLike="not like"

[Exceptions Aggregates DATABASE:GREENPLUM]
Max="max"
Min="min"
Sum="sum"
Avg="avg"
Count="count"
Count_Star="count(*)"
Stddev="stddev"
Stddev_Pop="stddev_pop"
Stddev_Samp="stddev_samp"
Variance="variance"
Var_Pop="var_pop"
Var_Samp="var_samp"
Grouping=
Rank=
Dense_Rank=
Percent_Rank=
Cume_Dist=
Percentile_Cont=
Percentile_Disc=
First_Value=
Last_Value=
Percentile=F

[Exceptions OLAP Functions DATABASE:GREENPLUM]
Olap_Min="min"
Olap_Max="max"
Olap_Sum="sum"
Olap_Avg="avg"
Olap_Count="count"
Olap_Count_Star="count(*)"
Olap_Stddev="stddev"
Olap_Stddev_Pop="stddev_pop"
Olap_Stddev_Samp="stddev_samp"
Olap_Variance="variance"
Olap_Var_Pop="var_pop"
Olap_Var_Samp="var_samp"
Olap_Rank="rank"
Olap_Dense_Rank="dense_rank"
Olap_Percent_Rank=
Olap_Cume_Dist=
Olap_Percentile_Cont=
Olap_Percentile_Disc=
; Vendor imposing ordering in window
Olap_First_Value=
; Vendor imposing ordering in window
Olap_Last_Value=
Olap_Row_Number="row_number"
Olap_Ratio_To_Report=
Olap_Ntile="ntile"
; Olap_Count_Default="ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING"
; Olap_Sum_Default="ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING"
Olap_Last_Value_Default="ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING"

[Exceptions Set Operators DATABASE:GREENPLUM]
Union="union"
Union_All=T
Intersect="intersect"
Intersect_All=T
Except=" except "
Except_All=T
Distinct="distinct"
Order_By="order by"

[Exceptions Operators DATABASE:GREENPLUM]
Add="+"
Sub="-"
Mul="*"
Div="/"
Eql="="
Neq="<>"
Grt=">"
Geq=">="
Les="<"
Leq="<="
Neg="-"
And="and"
Or="or"
Not="not"
Assign="="

[Exceptions Value Expressions DATABASE:GREENPLUM]
Case_Simple=T
Case_Searched=T
Coalesce=T
Nullif=T
Grouping_Sets=T
Rollup=T
Cube=T
Position=T 
Char_Length=F
Octet_Length=F
Substring=T
Upper=T
Lower=T
StrCat=T
Cast=C
Abs=T
Floor=T
Ceiling=C
ln=T
Exp=T
Mod=F
Sqrt=T
Power=T
Current_Date=T
;Unable to get timezone type via ODBC so disabled
Current_Time=F
Current_TimeStamp=F
LocalTime=F
LocalTimestamp=F
; Aspects of Extract can be mapped via entries in the built in section
Extract=C
Extract_Year=coguda#extract_year
Extract_Month=coguda#extract_month
Extract_Day=coguda#extract_day
Extract_Hours=coguda#extract_hour
Extract_Minutes=coguda#extract_minute
Trim=T
Row_Value_Constructors=T
Olap_Window_Order_By=T
 
[Exceptions General DATABASE:GREENPLUM]
Aggregate_In_Expr=T
Aggregate_Value_Expr=T
Correlated_Subqueries=T
Cross_Product=T
Distinct_Aggregates=T
Distinct_Aggr_In_Case=T
Group_By_Expr=T
Group_By_Ordinal=T
Group_By_Alias=T
Multiple_Distinct=T
Count_Non_Distinct=T
Count_Value_Expr=T
Count_Literal=T
Is_Null_Value_Expr=T
Is_Null_Value_Parm=T
Like_Value_Expr=T
Subquery_In_Having=T
Subquery_In_Group_By=T
Subquery_In_Case=F
Count_Blob=T
Expression_In_In=T
Null_Order=F
Olap_Null_Order=F
Olap_Distinct=T
Nested_Olap_Functions=F
Empty_String_Is_Null=F
Order_By_In_Derived_Table=T
Interval_As_VarChar=F
Boolean_Comparison=T
Derived_Column_List=T
With_Column_List=F
Aggr_With_Interval=T
Nested_Case=T
Not_In_Subquery=T
Nulls_Sort_Last=T
Order_By_Alias=T
Order_By_Name=T
Substring_On_Expr=T
Subqueries=T
Subquery_Column_Alias=T
Parameter_In_Select_List=T
Remove_Parameter_Cast=T
Subquery_With_Parameters=T
Like_With_Parameters=T
Like_With_Escape=T
Comments=T
Integer_Division_Truncation=T
 
[Exceptions Literals DATABASE:GREENPLUM]
Date_Literal=T
Timestamp_Literal=T
Time_Literal=T
Interval_Literal=F
IntervalYM_Literal=F
TimeTZ_Literal=F
TimestampTZ_Literal=F
NChar_Literal=T  

[Exceptions Misc DATABASE:GREENPLUM]

[Exceptions Delimiters DATABASE:GREENPLUM]
; The RDBMS is accepting double quotes for quoted identifiers. For non-ODBC based connections
; enable the appropriate delimeter entries with respect to if catalog, schemas, procedures and
; table functions would be supported.
;Catalog_Delimiter="\""
;Schema_Delimiter="\""
;Table_Delimiter="\""
;Column_Delimiter="\""
;Procedure_Delimiter="\""
;Wholename_Delimiter="\""
;Table_Function_PreStr="TABLE( "
;Table_Function_PostStr=" )"
; ANSI style dashdash is also supported
Comment_Begin="/* "
Comment_End=" */ "
 
[Exceptions Separators DATABASE:GREENPLUM]
Catalog_Separator="."
Schema_Separator="."
Table_Separator="."
 
[Exceptions Blob Expressions DATABASE:GREENPLUM]
Blob_In_Substring=T
Blob_In_Trim=F
Blob_In_StrCat=F
Blob_In_IsNull=F
Blob_In_Substring_Return_Blob=F
 
;b stands for boolean.
;c stands for character.
;x stands for text.
;d stands for date.
;i stands for the interval.
;n stands for the numeric.
;s stands for the timestamp.
;t stands for the time.
;y stands for time with time zone
;z stands for timestamp with time zone
 
[Database Functions DATABASE:GREENPLUM]
n:ceiling(%1n)=CEIL(%1);

 
[Builtin Functions DATABASE:GREENPLUM]
d:_add_days(%1d,%2n)=cast (%1 + (interval '1 day' * floor(%2)) as date);
d:_add_months(%1d,%2n)=(cast(%1 + (interval '1 month' * floor(%2)) as date));
d:_add_years(%1d,%2n)=cast(%1 + (interval '1 year' * floor(%2)) as date);
d:_first_of_month(%1d)=cast(date_trunc('month', %1) as date);
d:_last_of_month(%1d)=(cast(cast(date_trunc('month',%1) as date) + interval '1 month' - interval '1 day' as date));
s:_add_days(%1s,%2n)=(%1 + (interval '1 day' * floor(%2)));
s:_add_months(%1s,%2n)=(%1 + (interval '1 month' * floor(%2)));
s:_add_years(%1s,%2n)=(%1 + (interval '1 year' * floor(%2)));
s:_first_of_month(%1s)=%1 - ( EXTRACT( DAY FROM %1 ) * INTERVAL '1 DAY' ) + INTERVAL '1 DAY';
s:_last_of_month(%1s)=%1 - ( EXTRACT( DAY FROM %1 ) * INTERVAL '1 DAY' ) + INTERVAL '1 MONTH';
s:_make_timestamp(%1n,%2n,%3n)=cast(TO_TIMESTAMP('%1-%2-%3','YYYY-MM-DD') as timestamp without time zone);
s:_add_hours(%1s,%2n)=%1 + (INTERVAL '1 hour' * FLOOR(%2));
s:_add_minutes(%1s,%2n)=%1 + (INTERVAL '1 minute' * FLOOR(%2));
s:_add_seconds(%1s,%2n)=%1 + (INTERVAL '1 second' * FLOOR(%2));
n:_days_between(%1ds,%2ds)=cast(%1 as date) - cast(%2 as date);
;n:_months_between(%1ds,%2ds)=;
n:_years_between(%1ds,%2ds)=((extract(year from %1) - extract(year from %2)));
n:_hours_between(%1ds,%2ds)=cast(extract('epoch' from %2 - %1 ) / 3600 as integer);
n:_minutes_between(%1ds,%2ds)=cast(extract('epoch' from %2 - %1 ) /60 as integer);
n:_seconds_between(%1ds,%2ds)=extract('epoch' from %2 - %1 );
n:_days_to_end_of_month(%1ds)=cast(extract('day' from ((date_trunc('month',%1) + interval '1 month' - interval '1 day') - cast(%1 as date) )) as integer);
n:_day_of_year(%1ds)=cast(extract(doy from %1) as integer);
n:_day_of_week(%1ds, %2n)=(mod(cast(extract(dow from %1) +7-%2 as int),7)+1);
;n:_age(%1ds)=;
;n:_ymdint_between(%1ds,%2ds)=;
; must be iso 8601 compliant
;n:_week_of_year(%1ds)=;
;n:_round(%1n, %2n)=; 

n:coguda#extract_year(%1ds)=extract(year from %1);
n:coguda#extract_month(%1ds)=extract(month from %1);
n:coguda#extract_day(%1ds)=extract(day from %1);
n:coguda#extract_hour(%1st)=extract(hour from %1);
n:coguda#extract_minute(%1st)=extract(minute from %1);
;n:coguda#extract_second(%1st)=;

[Operator Addition]
 
[Operator Subtraction]
 
[Operator Multiplication]
 
[Operator Division]
 
[Operator Comparison]
TS=DT,OK
DT=TS,OK

[Operator Cast DATABASE:GREENPLUM]
AD=AD,NA
BL=AD,NA
CH=CH,CH:DB,DB:DM,DM:DT,DT:FL,FL:IT,IT:NU,NU:QD,QD:SM,SM:TM,TM:TS,TS:VC,VC
DB=DB,DB:DM,DM:FL,FL:IT,IT:NU,NU:QD,QD:SM,SM
DM=CH,CH:DB,DB:DM,DM:FL,FL:IT,IT:NU,NU:QD,QD:SM,SM:VC,VC
DT=CH,CH:DT,DT:TS,TS:VC,VC
FL=DB,DB:DM,DM:FL,FL:IT,IT:NU,NU:QD,QD:SM,SM
IT=CH,CH:DB,DB:DM,DM:FL,FL:IT,IT:NU,NU:QD,QD:SM,SM:VC,VC
IV=AD,NA
IY=AD,NA
NA=CH,CH:DB,DB:DM,DM:DT,DT:FL,FL:IT,IT:NU,NU:QD,QD:SM,SM:TM,TM:TS,TS:VC,VC
NC=AD,NA
NU=CH,CH:DB,DB:DM,DM:FL,FL:IT,IT:NU,NU:QD,QD:SM,SM:VC,VC
QD=CH,CH:DB,DB:DM,DM:FL,FL:IT,IT:NU,NU:QD,QD:SM,SM:VC,VC
SM=CH,CH:DB,DB:DM,DM:FL,FL:IT,IT:NU,NU:QD,QD:SM,SM:VC,VC
TM=TM,TM
TS=DT,DT:TM,TM:TS,TS
TT=AD,NA
TZ=AD,NA
VC=CH,CH:DB,DB:DM,DM:DT,DT:FL,FL:IT,IT:NU,NU:QD,QD:SM,SM:TM,TM:TS,TS:VC,VC

[Directives Session]