You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unexpected behaviour.
Seems like the "Execute SQL" and "Execute current line" buttons are crossed.
I want to run this code
SELECT * FROM Transactions
WHERE [Date] Between '2017-05-23 00:00:00:001'
AND '2017-05-23 23:59:59'
If I select the first line "SELECT * FROM Transactions " and click the Execute SQL arrow > This is the output: 4 rows returned in 0ms from: SELECT * FROM Transactions
but if I click the Execute Current Line the output is:
2 rows returned in 0ms from: SELECT * FROM Transactions
WHERE [Date] Between '2017-05-23 00:00:00:001'
AND '2017-05-23 23:59:59'
Just to check, which version is this happening on? Asking because we've changed the code for the Execute SQL pane a lot since the 3.9.1 release. I'm pretty sure the behaviour will have changed since then.
If the above is happening with our recent nightly releases though (found here), we should definitely look into it. 😄
Version 3.9.99
Qt 5.7.1
Sqlite 3.18.0
Same problem.
Ok so using only the tool I created a new db with "Table1" with fields
(Integer) Id, (Text) Name, (Integer) Age
I inserted 3 rows:
Insert into Table1 (Id, Name, Age)
Values (1, "Ray", 1),
(2, "Bob", 2),
(3, "Pierce", 3)
Now I query the table:
Select * from Table1
Where Age <= 2
but highlight just the first row *Select * from Table1*
Execute SQL F5
3 rows returned in 0ms from: Select * from Table1
Execute Current Line Shift+F5
2 rows returned in 0ms from: Select * from Table1
Where Age <= 2
It's a good tool. Keep at it.
I'll add more comments as I play about with it some more.
In Visual Studio 2010 all "bit" rows are returned as "False" even when the
values in them are mixed "False" / "0" etc. That's why I went looking for
another tool. It was with the help of your tool that I could see what's
happening. VS was hiding the problem.
Just a thought (haven't fully tested it, but wanted to confirm...) you mention "but highlight just the first row". Theoretically, no highlighting is necessary, and it might be that thats giving the 'false information'...
I know this was working semi-recently, as it was me that highlighted the previous quirks with it.
OK, so 'Execute SQL' (or F5) will execute the sql statements in the window, while 'Execute current line' is technically more 'Execute current statement'. A subtle, but obvious difference.
The highlighting is important in that if some SQL is highlighted (ie, part of a statement) and 'Execute SQL' (or F5) is pressed, then only that SQL is executed. Highlighting has no effect on the 'Execute current line' button.
The SQL window can hold multiple statements, eg:
select * from invoices
where invoiceNumber=100;
select * from invoices;
So the 'Execute Current Line' (if the cursor was on the 'where invoiceNumber=100' line) would only execute the top SQL statement, not the bottom one.
I guess the button labels are slightly misleading...
Personally, I've found it more beneficial to use -- comments, so if I didn't want the 'where' statement, its easier (and clearer) to set the SQL as
select * from invoices
--where invoiceNumber=100;
...but that doesn't negate the fact that the buttons aren't accurately describing what they do....
Just tried it there. Highlighting is required.
Anyway I woke up this morning thinking that there should be only 1
button. If nothing is highlighted then it runs the whole script, but if a
selection is highlighted then only the selection gets run. This, I would
consider to be expected / normal behaviour. This is how it works in
SSMS or Rapid for Sybase.
As I was saying, I think it's a very good little app and I think as I'm
just moving to SQLite (for mobile) that I'm going to rely on it for working
against the db since as I mentioned before Visual Studio is doing a botched
job with the bits so not great for a learner. Also marks against VS it
gives me the usual suspects for field data types; money, double, float,
etc... when SQLite has only 4.
On Wed, May 24, 2017 at 10:49 AM, Chris Locke ***@***.***> wrote:
Just a thought (haven't fully tested it, but wanted to confirm...) you
mention "but highlight just the first row". Theoretically, no highlighting
is necessary, and it might be that thats giving the 'false information'...
I know this was working semi-recently, as it was me that highlighted the
previous quirks with it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1017 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFP7_8CragFk1k_7JaoRfPKELqDAJ7Nqks5r8_0_gaJpZM4Njs0I>
.
1) If I put this code in it will fail no matter where I put the cursor. I
think that it should, this would be expected behaviour
select * from Tags where Id <= 2
select * from Tags where Id >= 3
If I highlight a single line it will run with F5. Shift+F5 will result in
error.
2)
If I split the lines
select * from Tags
where Id <= 2
select * from Tags
where Id >= 3
Only F5 will work as expected. So if I select just "select * from Tags" I
get the full result set. If I include the 'where' in the string it works
as expected.
Shift + F5 does not work.
My vote is to get rid of the Shift+F5 button.
On Wed, May 24, 2017 at 11:08 AM, Ray Brennan ***@***.***> wrote:
Just tried it there. Highlighting is required.
Anyway I woke up this morning thinking that there should be only 1
button. If nothing is highlighted then it runs the whole script, but if a
selection is highlighted then only the selection gets run. This, I would
consider to be expected / normal behaviour. This is how it works in
SSMS or Rapid for Sybase.
As I was saying, I think it's a very good little app and I think as I'm
just moving to SQLite (for mobile) that I'm going to rely on it for working
against the db since as I mentioned before Visual Studio is doing a botched
job with the bits so not great for a learner. Also marks against VS it
gives me the usual suspects for field data types; money, double, float,
etc... when SQLite has only 4.
On Wed, May 24, 2017 at 10:49 AM, Chris Locke ***@***.***>
wrote:
> Just a thought (haven't fully tested it, but wanted to confirm...) you
> mention "but highlight just the first row". Theoretically, no highlighting
> is necessary, and it might be that thats giving the 'false information'...
> I know this was working semi-recently, as it was me that highlighted the
> previous quirks with it.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#1017 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AFP7_8CragFk1k_7JaoRfPKELqDAJ7Nqks5r8_0_gaJpZM4Njs0I>
> .
>
Technically, its not valid SQL. DB4S will 'merge' all lines (as an SQL statement can be split over multiple lines, eg:
select *
from Tags
where
Id <= 2
So DB4S is squishing your statements together and forming this:
select * from Tags where Id <= 2 select * from Tags where Id >= 3
Slap a semi colon on the end of each statement, and DB4S will know where one statement ends, and another begins. Other database programs might be more 'forgiving', but Db4S is quite strict! ;)
Again, if you add the semi colon, Shift+F5 will work. Honest.
I pressed Shift+F5 on the middle statement, as it showed 12 rows. If I'd have pressed F5, it would have shown 1 row.
I think we might be over complicating the problem now at this point. Might
need to remind ourselves to keep it simple?
Yes I understand that it concatenates the lines.
Is adding the ; is bogus? Is that how it's done in the other 'big player'
apps? I know I don't consciously use it when I'm scripting outside of C#.
select * from Transactions (*C1)
where Id <= 3; (*C1)
select * from Transactions (*C2)
where Id >= 4; (*C2)
Placing the cursor at (*C1) or (*C2) Press F5 = results from only second
query every time = OK it just ran through.
Shift+F5 = result from whichever query the cursor resides inside of.
When I highlight some text F5 will just run the highlighted text.
I see it now but I think the app is running as You expect it to. Is that
good to the end user coming from the big players SSMS etc? I'd be looking
to nullify the learning curve as much as possible.
Personally I'm happy to select / highlight the code I want to run. That's
what I know.
In the case of Embarcadero Rapid if I run multiple queries like above then
I get multiple result sets (in the same grid). No semi colon required.
On Wed, May 24, 2017 at 11:51 AM, Chris Locke ***@***.***> wrote:
If I put this code in, it will fail
Technically, its not valid SQL. DB4S will 'merge' all lines (as an SQL
statement can be split over multiple lines, eg:
select *
from Tags
where
Id <= 2
So DB4S is squishing your statements together and forming this:
select * from Tags where Id <= 2 select * from Tags where Id >= 3
Slap a semi colon on the end of each statement, and DB4S will know where
one statement ends, and another begins.
1. Again, if you add the semi colon, Shift+F5 will work. Honest.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1017 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFP7_z1vkxIjGGqmrcdRID2KXntaeDmRks5r9AvKgaJpZM4Njs0I>
.
Some programs 'detect' where the semi colon should go, others don't. I use SQL Studio and that gets confused if I don't add semi colons. You can't 'assume' that lines beginning with 'select' is a new statement, as you can have multiple 'select' statements in a select statement. The semi colon just explicitly defines where you want the ending to be.
when I'm scripting outside of C#
Welcome fellow .Net-er. I program mainly in VB, but use both SQLite and SQL Server. 👋
"*You can't 'assume' that lines beginning with 'select' is a new statement,
as you can have multiple 'select' statements in a select statement.*" Yes
- very good. I don't know how the boffins do it. I've never put my mind
to it.
Hello fellow .Net-er back!
I grew up in VB6 land which ultimately led me to .Net. I strongly urge
anyone to cross over to C#. It's not that hard but it does have extra
features and it becomes much slicker to use. Right now I want to use C# +
Xamarin to create a mobile app across the 3 platforms. (That can't be done
with VB.NET) The mobile dev led me to SQLite as a universal data
solution. I hope I got that right, will it work on win phone, android and
ios? VS2017 won't develop for Windows Phone 8, only Win10. So I'm also
developing in VS2015. I prototype and develop the backend in my free
time at work on an antique VM using XP and VS2010 using WPF + MVVM that I
can take home for porting out to the other apps. Fekin nuts! But when
it's done I'll put it up on git then I'll have another little thing to put
on my CV in case Brexit kills off my job - since it's already giving me all
of this free time right now by causing the markets to panic and hold off
spending.
On Wed, May 24, 2017 at 12:34 PM, Chris Locke ***@***.***> wrote:
Some programs 'detect' where the semi colon should go, others don't. I use
SQL Studio and that gets confused if I don't add semi colons. You can't
'assume' that lines beginning with 'select' is a new statement, as you can
have multiple 'select' statements in a select statement. The semi colon
just explicitly defines where you want the ending to be.
when I'm scripting outside of C#
Welcome fellow .Net-er. I program mainly in VB, but use both SQLite and
SQL Server. 👋
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1017 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFP7_xW0mWy270s0zvoCgreIYe5jxxr8ks5r9BXFgaJpZM4Njs0I>
.
Right now I want to use C# + Xamarin to create a mobile app across the 3 platforms
Ditto. Well, I'd love to create some Android apps. I work in a manufacturing business, so to create a small app where someone could interact with a database 'somewhere' would be useful.
99.99% of my coding is for Windows applications (WinForms, rather than WPF). I use SQLite for most of the databases (seems to work OK in a multi-user environment on a server, even though they say 'don't do that!'...) and SQL Server for bigger projects.
I code in SharpDevelop, as thats a 40 MB download, compared to Visual Studio, which is just nuts - someone said 50 GB offline download, but I guess thats with 'everything'.
Think we've gone off topic now! ;) hehe! Anyway - welcome to the DB4S group! 😸
Yeah, we do have an outstanding item for adding some kind of key binding change. But, it's not a small piece of work and it's probably not something we'll get done in the near future. 😇
Activity
justinclift commentedon May 23, 2017
Just to check, which version is this happening on? Asking because we've changed the code for the Execute SQL pane a lot since the 3.9.1 release. I'm pretty sure the behaviour will have changed since then.
If the above is happening with our recent nightly releases though (found here), we should definitely look into it. 😄
fatscally commentedon May 23, 2017
fatscally commentedon May 23, 2017
justinclift commentedon May 23, 2017
Thanks, that's useful. Would you be ok to try the latest nightly build and see if it's happening there as well?
https://nightlies.sqlitebrowser.org/latest/
In theory (!), it shouldn't be a problem any more. 😁
fatscally commentedon May 23, 2017
fatscally commentedon May 23, 2017
fatscally commentedon May 23, 2017
justinclift commentedon May 23, 2017
Damn, I could have sworn we fixed this a while back. We'll need to look into it again before the next release.
Thanks for pointing it out @fatscally. 😄
fatscally commentedon May 23, 2017
justinclift commentedon May 23, 2017
Thanks. 😄
Yeah, everything has bugs, but at least we're somewhat more approachable. 😉
chrisjlocke commentedon May 24, 2017
Just a thought (haven't fully tested it, but wanted to confirm...) you mention "but highlight just the first row". Theoretically, no highlighting is necessary, and it might be that thats giving the 'false information'...
I know this was working semi-recently, as it was me that highlighted the previous quirks with it.
chrisjlocke commentedon May 24, 2017
OK, so 'Execute SQL' (or F5) will execute the sql statements in the window, while 'Execute current line' is technically more 'Execute current statement'. A subtle, but obvious difference.
The highlighting is important in that if some SQL is highlighted (ie, part of a statement) and 'Execute SQL' (or F5) is pressed, then only that SQL is executed. Highlighting has no effect on the 'Execute current line' button.
The SQL window can hold multiple statements, eg:
So the 'Execute Current Line' (if the cursor was on the 'where invoiceNumber=100' line) would only execute the top SQL statement, not the bottom one.
I guess the button labels are slightly misleading...
Personally, I've found it more beneficial to use -- comments, so if I didn't want the 'where' statement, its easier (and clearer) to set the SQL as
...but that doesn't negate the fact that the buttons aren't accurately describing what they do....
fatscally commentedon May 24, 2017
fatscally commentedon May 24, 2017
chrisjlocke commentedon May 24, 2017
Technically, its not valid SQL. DB4S will 'merge' all lines (as an SQL statement can be split over multiple lines, eg:
So DB4S is squishing your statements together and forming this:
Slap a semi colon on the end of each statement, and DB4S will know where one statement ends, and another begins. Other database programs might be more 'forgiving', but Db4S is quite strict! ;)
I pressed Shift+F5 on the middle statement, as it showed 12 rows. If I'd have pressed F5, it would have shown 1 row.
fatscally commentedon May 24, 2017
chrisjlocke commentedon May 24, 2017
Some programs 'detect' where the semi colon should go, others don't. I use SQL Studio and that gets confused if I don't add semi colons. You can't 'assume' that lines beginning with 'select' is a new statement, as you can have multiple 'select' statements in a select statement. The semi colon just explicitly defines where you want the ending to be.
Welcome fellow .Net-er. I program mainly in VB, but use both SQLite and SQL Server. 👋
fatscally commentedon May 24, 2017
chrisjlocke commentedon May 24, 2017
Ditto. Well, I'd love to create some Android apps. I work in a manufacturing business, so to create a small app where someone could interact with a database 'somewhere' would be useful.
99.99% of my coding is for Windows applications (WinForms, rather than WPF). I use SQLite for most of the databases (seems to work OK in a multi-user environment on a server, even though they say 'don't do that!'...) and SQL Server for bigger projects.
I code in SharpDevelop, as thats a 40 MB download, compared to Visual Studio, which is just nuts - someone said 50 GB offline download, but I guess thats with 'everything'.
Think we've gone off topic now! ;) hehe! Anyway - welcome to the DB4S group! 😸
fatscally commentedon May 24, 2017
chrisjlocke commentedon May 25, 2017
Custom keys can't be set yet, and changing the keys may not be possible, as Ctrl+E currently shows/hides the 'Edit Database Cell' tab.
justinclift commentedon May 25, 2017
Yeah, we do have an outstanding item for adding some kind of key binding change. But, it's not a small piece of work and it's probably not something we'll get done in the near future. 😇