simple query in oracle does not works

Delphi XE8 and oracle 11g windows 7 64

this veri simple query:

select * from VS_LOG_MAPPING
where Data_run between  current_date -1 and current_date

run good in toad  but does not extract any data in delphi both in design mode and run time.

if I remove the where clause or put where data_run < current_date, then extracts the data also in delphi.

Some suggestion for this strange behavior?
0
Angelo
7/24/2015 12:48:57 PM
embarcadero.delphi.firedac 822 articles. 2 followers. Follow

7 Replies
683 Views

Similar Articles

[PageSpeed] 30

It's better to use params for your query, especially for datetime fields.

select * from VS_LOG_MAPPING where Data_run between :date1 and :date2

qry.ParamByName('date1').AsDateTime:= Now-1;
qry.ParamByName('date2').AsDateTime:=Now;
0
Robert
7/24/2015 3:15:21 PM
You probably want to use the current_timestamp macro. Read about it 
here: 
http://docwiki.embarcadero.com/RADStudio/XE8/en/Preprocessing_Command_Text_%28FireDAC%29

Angelo Mangiaracina wrote:
> Delphi XE8 and oracle 11g windows 7 64
>
> this veri simple query:
>
> select * from VS_LOG_MAPPING
> where Data_run between  current_date -1 and current_date
>
> run good in toad  but does not extract any data in delphi both in design mode and run time.
>
> if I remove the where clause or put where data_run < current_date, then extracts the data also in delphi.
>
> Some suggestion for this strange behavior?
>
0
quinn
7/24/2015 3:28:34 PM
You probably want to use the current_date() macro. See 
http://docwiki.embarcadero.com/RADStudio/XE8/en/Preprocessing_Command_Text_%28FireDAC%29 
for details.

Angelo Mangiaracina wrote:
> Delphi XE8 and oracle 11g windows 7 64
>
> this veri simple query:
>
> select * from VS_LOG_MAPPING
> where Data_run between  current_date -1 and current_date
>
> run good in toad  but does not extract any data in delphi both in design mode and run time.
>
> if I remove the where clause or put where data_run < current_date, then extracts the data also in delphi.
>
> Some suggestion for this strange behavior?
>
0
quinn
7/24/2015 3:33:59 PM
Not an outage per say, put posts where very, very slow.

Reported at : 7/24/2015 8:52 AM PDT
Resolved at:  7/24/2015 9:11 AM PDT
0
quinn
7/24/2015 4:32:53 PM
Posted to the wrong place. Sorry.

quinn wildman wrote:
> Not an outage per say, put posts where very, very slow.
>
> Reported at : 7/24/2015 8:52 AM PDT
> Resolved at:  7/24/2015 9:11 AM PDT
>
0
quinn
7/24/2015 4:54:32 PM
Dne 24.07.2015 ob 17:33 je quinn wildman zapisal(a):
> You probably want to use the current_date() macro ...

If you suggest macro functions then they must be TIMESTAMPADD() and 
CURDATE() or CURRENT_DATE().
.... where Data_run between {fn TIMESTAMPADD('DAY', -1,  {fn CURDATE()}} 
and {fn CURDATE()}

Branko
0
Franc
7/24/2015 6:59:46 PM
I did it, but the result is not changed.


> {quote:title=Robert Triest wrote:}{quote}
> It's better to use params for your query, especially for datetime fields.
> 
> select * from VS_LOG_MAPPING where Data_run between :date1 and :date2
> 
> qry.ParamByName('date1').AsDateTime:= Now-1;
> qry.ParamByName('date2').AsDateTime:=Now;
0
Angelo
7/28/2015 9:12:21 AM
Reply:

Web resources about - simple query in oracle does not works - embarcadero.delphi.firedac

Save You (Simple Plan song) - Wikipedia, the free encyclopedia
The song is in common time throughout and follows the basic ABABCB skeleton , with 'A' being the verse, 'B' being the prechorus and chorus, and ...

'Tongue-in-cheek' Australia Day poster with simple message
A Brisbane man has created a &quot;tongue-in-cheek&quot; Australia Day poster after the recent spate of unprovoked assaults across Queensland. ...

Sophos Home: super-simple free antivirus for Windows and Mac
... the best free protection, maybe for a single machine, probably not. Grab a copy of Avira Free instead. But if you need something very simple, ...

Simple sleuthing likely just revealed when Apple will unveil iOS 10
... feature additions for iOS 10 remain a mystery, it looks like the date on which iOS 10 will be unveiled was likely just uncovered by some simple ...

Simple Tips to Protect Your Wordpress Site for Beginners
... I realized this was a brute force attack to access my site through login username and password. So, what is a brute force attack? In its simplest ...

11 simple tips for sleeping better when you don't have a lot of time to sleep
... sleep. Online mattress and bedding company SleepyPeople.com tipped us on a list of sleep hacks it put together recently. Follow these simple ...

Build & fund a startup in 48 hours with this simple hack
... form that you have to prove to us you are a developer or a designer. Why do we put up a roadblock to folks coming to the Hackathon? Simple, ...

Angelina Jolie in Saint Laurent at the ‘Kung Fu Panda 3′ premiere: simple & chic?
... the Sea , but I guess I just put that sh-t out of my memory (the less said about it, the better). For this red carpet, Angelina wore this simple ...

No simple fix: Infrastructure, health issues loom large in Flint water crisis
CNN No simple fix: Infrastructure, health issues loom large in Flint water crisis CNN (CNN) What will it take to fix the water crisis in Flint, ...

Apple’s new Music Memos app makes songwriting chimp-simple
Apple’s new app, Music Memos, is hands-down the best free music-creation app I’ve ever used on my iPhone. The amount of tech packed into this ...

Resources last updated: 1/23/2016 7:40:03 AM