BigQuery is deleting lines in my script when I only run part of it - sql

I have a moderately complex script (create about 20 different tables, approx 1500 lines). When making changes, I only need to run the part of the code that comes after the change. I normally dont have any issues with this, but today, I selected lines 800-1500, hit ctrl + enter, and when it completed the run 6 minutes later, I found that all of the code above the line I started the run from (ie lines 1-799) had been deleted.
When I hit ctrl+z nothing happens, so somehow the change has been locked in. I have some earlier versions of the script, but there are changes in here that got deleted that I dont have saved anywhere else.
Two questions:
why is this happening? any way to prevent it from happening again? (other than stricter version control, or running the subset of the query in another query editing window)
Any way to recover the deleted code if ctrl+z doesnt work, and it's not in the query history as I didnt run that piece of it today?
notes: using BigQuery web interface for this

Something caused your browser tab to reload itself. The URL in the browser immediately updates itself with a new job_id parameter every time you execute a query, and going to that URL (via reloading the tab or otherwise) will display the exact SQL executed by that job and the resultset if the job has finished. If you've only highlighted a portion of the query -- welp, that's the query that got run so that's the query that will be displayed when you revisit that url. :(
The new "editor tabs" feature has been causing this for me: I have to click the "disable editor tabs" button at the top of the bigquery UI to prevent the page from reloading when running queries with multiple stages. But there are an endless number of possible reasons that your particular tabs might be reloading on your particular system, so here's a second fix:
Use /* */ SQL comments to block off the parts of the query that you don't want to run. The comments are part of your query and will therefore still be visible even if the browser tab reloads.

Related

How to hide the separate error log window in DBeaver?

A few weeks ago I detached the error log within the editor as a separate window; I was just seeing what was going to happen.
Now I can't put it back and I get two separate error log windows. One that is the original detached window and another that's still within the editor. I can't find any option to reattach it to the single Dbeaver window/editor in attempt to revert it to what it was before.
The yellow bar in the picture is the window I'm referring to. It's just a little annoying for a new window to be produced every time I get an error. I've tried to look for toggles in the preferences menu but haven't seen anything that stands out to be the problem. Nor can I just drag and drop back it into the editor.
Looks like after an update you can't merge it to any of the bottom windows , but can keep it as a tabbed window like this.

Why won't oracle SQL developer launch debugger?

I have come here after searching in many different websites for a problem like the one I am facing.
I have this huge procedure in an Oracle Database which I need to debug to find an error.
After opening the procedure in Oracle SQL developer, I click on the gear icon, and "compile for debug" right after. Then I just click in the bug icon to start debugging.
On the bottom right of SQl developer screen appears a launching bar, but nothing else happens. In the connections section, where you can see the list of procedures, tables, etc... a green arrow appears before the name of the procedure I am trying to debug. It seems like it is preparing to start debugging, but it actually never starts. Below you can see a screenshot I took showing the issue.
Screenshot showing the procedure I am trying to debug
Here a screenshot of the "statement section" after clicking on "compile for debug"
statement section
What I have tried:
I have restarted the oracle server.
I have tried to debug many others procedures, all of them have the same behavior.
If I click on the "run" button, set the parameters and run the procedure, it will run, and give me the output variable.
The procedure compiles without errors.
Everything seems to be working just normal, except for debugging.
I think I have just solved it. After posting this question I started changing some parameters in the Listener. I ended up shutting down the listener, and it took me almost 3 hours to reconfigure it. The listener is working now (and it was working before), I decided to test the debugger again. Now it is debugging!!! Finally, now let me debug that HUGE procedure! Thank you very much guys!

Form designer only shows the form in vb.net

I was working at the forms designer and yesterday the designer literally only showed the form. Tried copying the .designer.vb to another new form and the same thing happened. Also when built it just shows what the designer shows. Compare the two versions:
(Had to use pastebin as the code is too long for a post, and it rejects my post if more than two links are used.)
Current code: pastebin.com/SsgR7YWD
Current form view:
Previous code: pastebin.com/bXCL3jhH
Previous screenshot:
Why it is not showing the controls? I know it is a long piece of designer code but I can't find where the error comes from.
I've just run your code through this site that compares to blocks of text and shows the differences - there's a lot - you might want to do the same and have a look at the differences. It may be easier to delete the form and start again to be honest. Having said that, you might be able to spot what went wrong
You should just delete the form and start again. A few tips to having a better UI ---
Use layout grids for the button-checkboxes and let the buttons occupy the whole horizontal space.
And remember to backup your code often so that things like this won't happen again - use something like GitHub and commit your files whenever your day is finished.
Happy coding!

Each Key Stroke causes Editor to Reset

This issue doesn't seem to present itself unless the project has been open for a while. It is usually open for a while due to development occurring on a remote desktop.
While editing calculations in the cube, every time I hit a key, the editor jumps to the first calculation in the script. Often this happens and creates a situation where there is an incomplete calculation or new calculation, and it throws the error that I have to edit the MDX in the Script View instead of the Form View.
Any ideas on other than Save/Re-open?

Forms open and load very slow. Sometimes they won't open

I have a relatively small VB winforms project.
It is currently used to launch numbers hyperlinks and some apps on a server.
There are a couple functions that do all the work, but the it really boils down to:
System.Diagnostics.Process.Start("iexplore.exe", urlVar)
or if it is an app sitting on the server, the variable passed into the function appLinkVar will contain the need file path to launch the application.
System.Diagnostics.Process.Start(appLinkVar)
The "items" are stored on a SQL Local Database (.mdf)
Id, appName, appLink, appClickCount, appFavList,anddecision, which tells the function if it is calling a website or opening an executable.
Currently, there are forty rows in the database and I project 150+ in the end that need to be updated centrally and often (weekly). But that's a different question for later. The reason I added in it in this question was for insight as to why I am using a database instead of a Setting or XML file for some links. (better suggestions welcome)
My admin main form loads Visible = False and loads the icon in the system try. So you can't actually see the first form that opens. It is a hidden admin window and it's main purpose is to put the icon in the system tray. The green RJ icon - http://snag.gy/VBa6c.jpg
Then all of the app interaction is around the notify icon. Example: the app loads on hover. right-click for settings and options etc.
Once the primary form loads, on mouse over the "Primary Label" for example and the white form to the left appears and so on. Not much to it. http://snag.gy/excKr.jpg
The Frequently Accessed items is currently stored on the database called appClickCount, this will be coming off of the database and to another recommended way of storing the data. But when I initially added the database, I noticed some lag in the main form loading. It would take it 5-7 seconds to populate the Frequently Accessed Items List and so on. So I changed the code from mainWindow.show() to mainWindow.visible(). Worked great for me. opened and closed very quickly. But after some use today by a tester, the application became almost unresponsive. He clicked on the notification icon numerous times and the app failed to load. Then threw a SQL time out error. It was the end of the day and I couldn't grab a screenshot.
I need to make this more reliable.
After some discussion the other day on SO, I was talking to someone that recommended I re-write the app in C# WPF, and that is definitely the plan. But I need this thing to past testing as is in VB this week. Where can I start troubleshooting the delay in opening? What other suggestions do you have to improve the application? Do I need to have an invisible form load first so I have access to a system tray icon or is there a better way?
I have talked to quite a few people on here lately and got some really good advice, I figured I would lay it all out here and see what input you guys can give a new guy... I'm also gonna go hang in the C# room for a little bit if you have any further questions.