Skip to content

Commit

Permalink
db2
Browse files Browse the repository at this point in the history
  • Loading branch information
sqlparser committed Jul 7, 2020
1 parent 4c46f31 commit a7a8c16
Show file tree
Hide file tree
Showing 10 changed files with 354 additions and 279 deletions.
99 changes: 54 additions & 45 deletions sqlfun/db2/date.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,55 @@
{
"funcName": "DATE",
"arguments": [
{
"argument": {
"arguName": "expression",
"description": "An expression that returns a value of one of the following built-in data types: DATE, TIMESTAMP, numeric, or character string that is not a CLOB."
}
},
{
"argument": {
"arguName": "yyyynnn",
"description": "An expression that returns a value of one of the following built-in data types: DATE, TIMESTAMP, numeric, or character string that is not a CLOB."
}
},
{
"argument": {
"arguName": "yyyy",
"description": "An expression that returns a value of one of the following built-in data types: DATE, TIMESTAMP, numeric, or character string that is not a CLOB."
}
},
{
"argument": {
"arguName": "nnn",
"description": "An expression that returns a value of one of the following built-in data types: DATE, TIMESTAMP, numeric, or character string that is not a CLOB."
}
},
{
"argument": {
"arguName": "n",
"description": "An expression that returns a value of one of the following built-in data types: DATE, TIMESTAMP, numeric, or character string that is not a CLOB."
}
}
],
"returnType": "",
"description": "The DATE function returns a date from a value.",
"targetDBs": [
"10.0",
"11.1"
],
"category": "Cast scalar functions",
"ansiCompatible": "",
"package": "",
"docLink": "https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.sql.ref.doc/doc/r0000784.html",
"sample": "DATE(RECEIVED)"
{
"funcName": "DATE",
"arguments": [
{
"argument": {
"arguName": "expression",
"description": "An expression that returns a value of one of the following built-in data types: DATE, TIMESTAMP, numeric, or character string that is not a CLOB."
}
},
{
"argument": {
"arguName": "yyyynnn",
"description": "An expression that returns a value of one of the following built-in data types: DATE, TIMESTAMP, numeric, or character string that is not a CLOB."
}
},
{
"argument": {
"arguName": "yyyy",
"description": "An expression that returns a value of one of the following built-in data types: DATE, TIMESTAMP, numeric, or character string that is not a CLOB."
}
},
{
"argument": {
"arguName": "nnn",
"description": "An expression that returns a value of one of the following built-in data types: DATE, TIMESTAMP, numeric, or character string that is not a CLOB."
}
},
{
"argument": {
"arguName": "n",
"description": "An expression that returns a value of one of the following built-in data types: DATE, TIMESTAMP, numeric, or character string that is not a CLOB."
}
}
],
"returnType": "",
"description": "The DATE function returns a date from a value.",
"targetDBs": [
"10.0",
"11.1"
],
"category": "Cast scalar functions",
"ansiCompatible": "",
"package": "",
"docLink": "https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.sql.ref.doc/doc/r0000784.html",
"sample": "DATE(RECEIVED)",
"translation":[
{
"informix":{"funcName":"CURRENT"},
"oracle":{"funcName":"TO_DATE"},
"postgresql":{"funcName":"CURRENT_DATE"},
"sqlserver":{"funcName":"CONVERT","arguments":["DATE","expression"]},
"sybase":{"funcName":"CONVERT","arguments":["DATE","expression"]}
}
]
}
59 changes: 32 additions & 27 deletions sqlfun/db2/variance.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
{
"funcName": "VARIANCE",
"arguments": [
{
"argument": {
"arguName": "expression",
"description": "An expression that returns a value of any built-in numeric data type."
}
},
{
"argument": {
"arguName": "n",
"description": "An expression that returns a value of any built-in numeric data type."
}
}
],
"returnType": "",
"description": "The VARIANCE function returns the biased variance (division by n) of a set of numbers.",
"targetDBs": [
"10.0",
"11.1"
],
"category": "Aggregate functions",
"ansiCompatible": "",
"package": "",
"docLink": "https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.sql.ref.doc/doc/r0000766.html",
"sample": "VARIANCE \u003d SUM(expression**2)/COUNT(expression) - (SUM(expression)/COUNT(expression))**2"
{
"funcName": "VARIANCE",
"arguments": [
{
"argument": {
"arguName": "expression",
"description": "An expression that returns a value of any built-in numeric data type."
}
},
{
"argument": {
"arguName": "n",
"description": "An expression that returns a value of any built-in numeric data type."
}
}
],
"returnType": "",
"description": "The VARIANCE function returns the biased variance (division by n) of a set of numbers.",
"targetDBs": [
"10.0",
"11.1"
],
"category": "Aggregate functions",
"ansiCompatible": "",
"package": "",
"docLink": "https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.sql.ref.doc/doc/r0000766.html",
"sample": "VARIANCE \u003d SUM(expression**2)/COUNT(expression) - (SUM(expression)/COUNT(expression))**2",
"translation":[
{
"sqlserver":{"funcName":"VAR"}
}
]
}
35 changes: 22 additions & 13 deletions sqlfun/mysql/date.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
{
"funcName": "DATE",
"description": "Extract the date part of a date or datetime expression",
"targetDBs": [
"6.0",
"7.0",
"8.0"
],
"category": "Date and Time Functions",
"ansiCompatible": "",
"package": "",
"docLink": "https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.htmll#function_date",
"sample": "SELECT something FROM tbl_name WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) \u003c\u003d date_col;"
{
"funcName": "DATE",
"description": "Extract the date part of a date or datetime expression",
"targetDBs": [
"6.0",
"7.0",
"8.0"
],
"category": "Date and Time Functions",
"ansiCompatible": "",
"package": "",
"docLink": "https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.htmll#function_date",
"sample": "SELECT something FROM tbl_name WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) \u003c\u003d date_col;",
"translation":[
{
"informix":{"funcName":"CURRENT"},
"oracle":{"funcName":"TO_DATE"},
"postgresql":{"funcName":"CURRENT_DATE"},
"sqlserver":{"funcName":"CONVERT","arguments":["DATE","expression"]},
"sybase":{"funcName":"CONVERT","arguments":["DATE","expression"]}
}
]
}
32 changes: 19 additions & 13 deletions sqlfun/mysql/var_pop.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
{
"funcName": "VAR_POP",
"returnType": "Returns the population standard deviation of expr (the square root of VAR_POP()).",
"description": "Return the population standard variance",
"targetDBs": [
"6.0",
"7.0",
"8.0"
],
"category": "Aggregate (GROUP BY) Functions",
"ansiCompatible": "",
"package": "",
"docLink": "https://dev.mysql.com/doc/refman/8.0/en/group-by-functions.htmll#function_var-pop"
{
"funcName": "VAR_POP",
"returnType": "Returns the population standard deviation of expr (the square root of VAR_POP()).",
"description": "Return the population standard variance",
"targetDBs": [
"6.0",
"7.0",
"8.0"
],
"category": "Aggregate (GROUP BY) Functions",
"ansiCompatible": "",
"package": "",
"docLink": "https://dev.mysql.com/doc/refman/8.0/en/group-by-functions.htmll#function_var-pop",
"translation":[
{
"sqlserver":{"funcName":"VARP"}
}
]

}
31 changes: 18 additions & 13 deletions sqlfun/mysql/variance.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
{
"funcName": "VARIANCE",
"returnType": "Returns the population standard variance of expr.",
"description": "Return the population standard variance",
"targetDBs": [
"6.0",
"7.0",
"8.0"
],
"category": "Aggregate (GROUP BY) Functions",
"ansiCompatible": "",
"package": "",
"docLink": "https://dev.mysql.com/doc/refman/8.0/en/group-by-functions.htmll#function_variance"
{
"funcName": "VARIANCE",
"returnType": "Returns the population standard variance of expr.",
"description": "Return the population standard variance",
"targetDBs": [
"6.0",
"7.0",
"8.0"
],
"category": "Aggregate (GROUP BY) Functions",
"ansiCompatible": "",
"package": "",
"docLink": "https://dev.mysql.com/doc/refman/8.0/en/group-by-functions.htmll#function_variance",
"translation":[
{
"sqlserver":{"funcName":"VAR"}
}
]
}
53 changes: 29 additions & 24 deletions sqlfun/oracle/var_pop.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
{
"funcName": "VAR_POP",
"arguments": [
{
"argument": {
"arguName": "expression",
"description": "A numeric expression that is used in the calculation."
}
}
],
"returnType": "The VAR_POP function returns a numeric value.",
"description": "The Oracle/PLSQL VAR_POP function returns the population variance of a set of numbers.",
"targetDBs": [
"Oracle 12c",
"Oracle 11g",
"Oracle 10g",
"Oracle 9i",
"Oracle 8i"
],
"category": "Analytic Functions",
"ansiCompatible": "",
"package": "",
"docLink": "https://www.techonthenet.com/oracle/functions/var_pop.php",
"sample": "select VAR_POP(data_length)\nfrom all_tab_columns;"
{
"funcName": "VAR_POP",
"arguments": [
{
"argument": {
"arguName": "expression",
"description": "A numeric expression that is used in the calculation."
}
}
],
"returnType": "The VAR_POP function returns a numeric value.",
"description": "The Oracle/PLSQL VAR_POP function returns the population variance of a set of numbers.",
"targetDBs": [
"Oracle 12c",
"Oracle 11g",
"Oracle 10g",
"Oracle 9i",
"Oracle 8i"
],
"category": "Analytic Functions",
"ansiCompatible": "",
"package": "",
"docLink": "https://www.techonthenet.com/oracle/functions/var_pop.php",
"sample": "select VAR_POP(data_length)\nfrom all_tab_columns;",
"translation":[
{
"sqlserver":{"funcName":"VARP"}
}
]
}
53 changes: 29 additions & 24 deletions sqlfun/oracle/variance.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
{
"funcName": "VARIANCE",
"arguments": [
{
"argument": {
"arguName": "expression",
"description": "A numeric expression that is used in the calculation."
}
}
],
"returnType": "The VARIANCE function returns a numeric value.",
"description": "The Oracle/PLSQL VARIANCE function returns the variance of a set of numbers.",
"targetDBs": [
"Oracle 12c",
"Oracle 11g",
"Oracle 10g",
"Oracle 9i",
"Oracle 8i"
],
"category": "Analytic Functions",
"ansiCompatible": "",
"package": "",
"docLink": "https://www.techonthenet.com/oracle/functions/variance.php",
"sample": "select VARIANCE(char_length)\nfrom all_tab_columns;"
{
"funcName": "VARIANCE",
"arguments": [
{
"argument": {
"arguName": "expression",
"description": "A numeric expression that is used in the calculation."
}
}
],
"returnType": "The VARIANCE function returns a numeric value.",
"description": "The Oracle/PLSQL VARIANCE function returns the variance of a set of numbers.",
"targetDBs": [
"Oracle 12c",
"Oracle 11g",
"Oracle 10g",
"Oracle 9i",
"Oracle 8i"
],
"category": "Analytic Functions",
"ansiCompatible": "",
"package": "",
"docLink": "https://www.techonthenet.com/oracle/functions/variance.php",
"sample": "select VARIANCE(char_length)\nfrom all_tab_columns;",
"translation":[
{
"sqlserver":{"funcName":"VAR"}
}
]
}
Loading

0 comments on commit a7a8c16

Please sign in to comment.