function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
thardinthardin 

SOQL: SYSDATE, GetDate(), Now(), Today(), etc.?

I did not find anything about this in the v6.0 API guide.

I would like to submit a query having a select condition to restrict by a Date field. I would like to use the current datetime rather than have to dynamically compose my query each time.

Oracle uses SYSDATE - I was hoping that might work since the SF backend DB is Oracle. No go.

I tried MS-SQL syntax: GetDate() - also no-go.

Tried Now, Now(), Today, Today()


Thanks -
Todd Hardin,
Customer Systems Inc.
DevAngelDevAngel
Functions are not supported in the current version of SOQL.
qmanqman
Hey Todd,

It looks like you want to do some SQL functionality with sforce. Have you thought about DBAmp? It is SQL wrapper to the sforce api and is open source. For more info, see www.forceamp.com or post a question on the open source forum for DBAmp.

Bill
thardinthardin
Thank you for the suggestion - I've give DBAmp a quick look a coupel weeks ago.

For this particular case I am trying to assist a customer that wants to make use to the DataLoader to perform some exports of the Product2 object. The customer needs to keep it simple and wanted to see what they could accomplish with the SF providede tools rather than paying for consulting time to write something custom.


Thanks -
Todd Hardin,
Customer Systems Inc.
qmanqman

Hi Todd,


I'm not sure I understand the custom coding/paying part since DBAmp is free. Anyway, if you are looking at DataLoader for exporting then let me share a quote from a DBAmp user who just replaced DataLoader exports with DBAmp:


"We had a process using DataLoader that pulled down (into .csv) a number of SFDC objects including Accounts and Opportunities.


With SFDC DataLoader, Opps (20,056 records) to 00:08:23 to download. With DBAmp, it takes 00:01:56."


Your mileage may varied based on batch sizes, etc. and you should do your own timing tests with your data.

 If you are exporting large record sets, you should give the Replication features of DBAmp a look.


Good Luck with your efforts,


Bill

Message Edited by qman on 11-22-2005 07:58 PM

Message Edited by qman on 11-22-2005 08:00 PM

EnderEnder
That is a lot slower than any query I've seen with the dataloader. Were they exactly the same query?
qmanqman
Yeah, I wondered about the DataLoader times myself and the user reconfirmed them. I believe they were full downloads of the objects with many custom fields on each object.

Bill
SuperfellSuperfell
"With SFDC DataLoader, Opps (20,056 records) to 00:08:23 to download. With DBAmp, it takes 00:01:56."

But thats DBAmp going to a locally cached copy of the data, right ?
qmanqman
Nope, no caching of data by DBAmp.

DBAmp uses a batch size of 1000 when replicating and I think the read-ahead querymore thread of the toolkit gives a big boost in performance. I regularly get 15K records a minute throughput with DBAmp/Office Toolkit.

The thing I don't know is the user's DataLoader configuration. But the other thing to consider is that the DataLoader time does not include the importing of the csv into a database table. So if your final destination is a SQL Server table, DBAmp is definitely a fast way to export Salesforce data.

I just did a quick test with 30K of Note objects: DBAmp(into SQL Server table) 2:13 mins, DataLoader (into csv file) 3:05 mins.

Bill

Message Edited by qman on 11-22-2005 11:16 PM

SuperfellSuperfell
Wow, i knew the read-ahead stuff would help, never thought it would help that much.
qmanqman
Yep, the Office Toolkit rocks!