Kettle 连 Salesforce 拉数据

获取安全Token后, 在kettle里设置的密码是 password+Token 比如密码是123, token是789, 那就输入123789

Salesforce里的Entity与普通数据库的表不一样, 不是每一列都可以filter, 一般只有日期或数字等类型的字段支持filter, 具体可以查阅Salesforce SOQL的文档来得知.

开发过程中还遇到一个Kettle的Spoon突然打不开的问题, 而且没有任何报错信息, 后来发现是JVM的问题. Spoon调用javaw, javaw 没有任何输出的界面, rootcause是JVM不能获取足够的内存资源, 更改了"-Xmx3200m" 参数降低了内存申请的大小后 解决了问题, 或者装个64位的jdk彻底解决 

salesforce 的时间函数

https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_dateformats.htm

Date Literals

A fieldExpression can use a date literal to compare a range of values to the value in a date or dateTime field. Each literal is a range of time beginning with midnight (00:00:00). To find a value within the range, use =. To find values on either side of the range, use > or <. The following table shows the available list of date literals, the ranges they represent, and examples.

Date LiteralRangeExample
YESTERDAYStarts 00:00:00 the day before and continues for 24 hours.SELECT Id FROM Account WHERE CreatedDate = YESTERDAY
TODAYStarts 00:00:00 of the current day and continues for 24 hours.SELECT Id FROM Account WHERE CreatedDate > TODAY
TOMORROWStarts 00:00:00 after the current day and continues for 24 hours.SELECT Id FROM Opportunity WHERE CloseDate = TOMORROW
LAST_WEEKStarts 00:00:00 on the first day of the week before the most recent first day of the week and continues for seven full days. Your locale determines the first day of the week.SELECT Id FROM Account WHERE CreatedDate > LAST_WEEK
THIS_WEEKStarts 00:00:00 on the most recent first day of the week before the current day and continues for seven full days. Your locale determines the first day of the week.SELECT Id FROM Account WHERE CreatedDate < THIS_WEEK
NEXT_WEEKStarts 00:00:00 on the most recent first day of the week after the current day and continues for seven full days. Your locale determines the first day of the week.SELECT Id FROM Opportunity WHERE CloseDate = NEXT_WEEK
LAST_MONTHStarts 00:00:00 on the first day of the month before the current day and continues for all the days of that month.SELECT Id FROM Opportunity WHERE CloseDate > LAST_MONTH
THIS_MONTHStarts 00:00:00 on the first day of the month that the current day is in and continues for all the days of that month.SELECT Id FROM Account WHERE CreatedDate < THIS_MONTH
NEXT_MONTHStarts 00:00:00 on the first day of the month after the month that the current day is in and continues for all the days of that month.SELECT Id FROM Opportunity WHERE CloseDate = NEXT_MONTH
LAST_90_DAYSStarts 00:00:00 of the current day and continues for the past 90 days.SELECT Id FROM Account WHERE CreatedDate = LAST_90_DAYS
NEXT_90_DAYSStarts 00:00:00 of the current day and continues for the next 90 days.SELECT Id FROM Opportunity WHERE CloseDate > NEXT_90_DAYS
LAST_N_DAYS:nFor the number n provided, starts 00:00:00 of the current day and continues for the past n days.SELECT Id FROM Account WHERE CreatedDate = LAST_N_DAYS:365
NEXT_N_DAYS:nFor the number n provided, starts 00:00:00 of the current day and continues for the next n days.SELECT Id FROM Opportunity WHERE CloseDate > NEXT_N_DAYS:15
NEXT_N_WEEKS:nFor the number n provided, starts 00:00:00 of the first day of the next week and continues for the next n weeks.SELECT Id FROM Opportunity WHERE CloseDate > NEXT_N_WEEKS:4
LAST_N_WEEKS:nFor the number n provided, starts 00:00:00 of the last day of the previous week and continues for the past n weeks.SELECT Id FROM Account WHERE CreatedDate = LAST_N_WEEKS:52
NEXT_N_MONTHS:nFor the number n provided, starts 00:00:00 of the first day of the next month and continues for the next n months.SELECT Id FROM Opportunity WHERE CloseDate > NEXT_N_MONTHS:2
LAST_N_MONTHS:nFor the number n provided, starts 00:00:00 of the last day of the previous month and continues for the past n months.SELECT Id FROM Account WHERE CreatedDate = LAST_N_MONTHS:12
THIS_QUARTERStarts 00:00:00 of the current quarter and continues to the end of the current quarter.SELECT Id FROM Account WHERE CreatedDate = THIS_QUARTER
LAST_QUARTERStarts 00:00:00 of the previous quarter and continues to the end of that quarter.SELECT Id FROM Account WHERE CreatedDate > LAST_QUARTER
NEXT_QUARTERStarts 00:00:00 of the next quarter and continues to the end of that quarter.SELECT Id FROM Account WHERE CreatedDate < NEXT_QUARTER
NEXT_N_QUARTERS:nStarts 00:00:00 of the next quarter and continues to the end of the nth quarter.SELECT Id FROM Account WHERE CreatedDate < NEXT_N_QUARTERS:2
LAST_N_QUARTERS:nStarts 00:00:00 of the previous quarter and continues to the end of the previous nth quarter.SELECT Id FROM Account WHERE CreatedDate > LAST_N_QUARTERS:2
THIS_YEARStarts 00:00:00 on January 1 of the current year and continues through the end of December 31 of the current year.SELECT Id FROM Opportunity WHERE CloseDate = THIS_YEAR
LAST_YEARStarts 00:00:00 on January 1 of the previous year and continues through the end of December 31 of that year.SELECT Id FROM Opportunity WHERE CloseDate > LAST_YEAR
NEXT_YEARStarts 00:00:00 on January 1 of the following year and continues through the end of December 31 of that year.SELECT Id FROM Opportunity WHERE CloseDate < NEXT_YEAR
NEXT_N_YEARS:nStarts 00:00:00 on January 1 of the following year and continues through the end of December 31 of the nth year.SELECT Id FROM Opportunity WHERE CloseDate < NEXT_N_YEARS:5
LAST_N_YEARS:nStarts 00:00:00 on January 1 of the previous year and continues through the end of December 31 of the previous nth year.SELECT Id FROM Opportunity WHERE CloseDate > LAST_N_YEARS:5
THIS_FISCAL_QUARTERStarts 00:00:00 on the first day of the current fiscal quarter and continues through the end of the last day of the fiscal quarter. The fiscal year is defined on the Fiscal Year page in Setup.SELECT Id FROM Account WHERE CreatedDate = THIS_FISCAL_QUARTER
LAST_FISCAL_QUARTERStarts 00:00:00 on the first day of the last fiscal quarter and continues through the end of the last day of that fiscal quarter. The fiscal year is defined on the Fiscal Year page in Setup.SELECT Id FROM Account WHERE CreatedDate > LAST_FISCAL_QUARTER
NEXT_FISCAL_QUARTERStarts 00:00:00 on the first day of the next fiscal quarter and continues through the end of the last day of that fiscal quarter. The fiscal year is defined on the Fiscal Year page in Setup.SELECT Id FROM Account WHERE CreatedDate < NEXT_FISCAL_QUARTER
NEXT_N_FISCAL_​QUARTERS:nStarts 00:00:00 on the first day of the next fiscal quarter and continues through the end of the last day of the nth fiscal quarter. The fiscal year is defined on the Fiscal Year page in Setup.SELECT Id FROM Account WHERE CreatedDate < NEXT_N_FISCAL_QUARTERS:6
LAST_N_FISCAL_​QUARTERS:nStarts 00:00:00 on the first day of the last fiscal quarter and continues through the end of the last day of the previous nth fiscal quarter. The fiscal year is defined on the Fiscal Year page in Setup.SELECT Id FROM Account WHERE CreatedDate > LAST_N_FISCAL_QUARTERS:6
THIS_FISCAL_YEARStarts 00:00:00 on the first day of the current fiscal year and continues through the end of the last day of the fiscal year. The fiscal year is defined on the Fiscal Year page in Setup.SELECT Id FROM Opportunity WHERE CloseDate = THIS_FISCAL_YEAR
LAST_FISCAL_YEARStarts 00:00:00 on the first day of the last fiscal year and continues through the end of the last day of that fiscal year. The fiscal year is defined on the Fiscal Year page in Setup.SELECT Id FROM Opportunity WHERE CloseDate > LAST_FISCAL_YEAR
NEXT_FISCAL_YEARStarts 00:00:00 on the first day of the next fiscal year and continues through the end of the last day of that fiscal year. The fiscal year is defined on the Fiscal Year page in Setup.SELECT Id FROM Opportunity WHERE CloseDate < NEXT_FISCAL_YEAR
NEXT_N_FISCAL_​YEARS:nStarts 00:00:00 on the first day of the next fiscal year and continues through the end of the last day of the nth fiscal year. The fiscal year is defined on the Fiscal Year page in Setup.SELECT Id FROM Opportunity WHERE CloseDate < NEXT_N_FISCAL_YEARS:3
LAST_N_FISCAL_​YEARS:nStarts 00:00:00 on the first day of the last fiscal year and continues through the end of the last day of the previous nth fiscal year. The fiscal year is defined on the Fiscal Year page in Setup.SELECT Id FROM Opportunity WHERE CloseDate > LAST_N_FISCAL_YEARS:3

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

爱知菜

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值