In SQL, I can create a comment using "--" and then everything else for the rest of the line is ignored.
Is there something similar in OSQL?
I've tried using "--" and /* */. In Studio, they are colorized by the syntax highlighter but if I execute a query such as:
/* this is a comment */
SELECT FROM V
or
-- this is also a comment
SELECT FROM V
I'll get an error message...
This is with OrientDB Community 2.2.14
Any advice is appreciated :)
Related
I have this select statement that works in a FoxPro command window to return the 7 records where the objname is documents-mltry and the word "roster" appears in the descrip memo field:
SELECT objname, descrip FROM archives where UPPER(OBJNAME)==[DOCUMENTS-MLTRY] AND [ROSTER]$UPPER(DESCRIP)
However, when i then try to do a replace all statement to change the objname to "Roster" it fails telling me the "variable roster is not found". Note: the LIKE command is not available in this version of FoxPro.
Can anybody see what i am doing wrong in the replace command below?
REPLACE ALL objname WITH "Roster" FOR UPPER(OBJNAME)==[DOCUMENTS-MLTRY] AND [ROSTER]$UPPER(DESCRIP)
I have tried using ATC command in the replace statement that results in the same variable not found error message:
REPLACE ALL objname WITH "Roster" FOR UPPER(OBJNAME)==[DOCUMENTS-MLTRY] AND ATC("ROSTER", descrip)
Any suggestions would be appreciated!
This may be a WAG but I noticed that you are not using the (optional) alias or workarea in your REPLACE command. If the table you are REPLACEing is not SELECTed and the work area that is selected is another table, then you will receive a variable not found error. To test out this theory, add an "IN archives" to your REPLACE command. That might fix it.
REPLACE ALL objname WITH "Roster" FOR UPPER(OBJNAME)==[DOCUMENTS-MLTRY] AND ATC("ROSTER", descrip) in archives
I checked the documentation for code collapsing, many languages have a marker defined but SQL doesn't.
SQL Server Management Studio recognizes begin and end as a region, allowing for folding, but VS Code doesn't.
Any suggestions are very appreciated.
For anyone coming here for the answer.
Region markers for SQL have been added to VS CODE in 2019 and you can now use them as:
--#region [name region if you like]
part of code you want to fold/collapse
--#endregion
Then use Ctrl + Shift + P or View -> Command Palette... and choose Fold All Regions.
use tab for group common code.
For example:
BEGIN
YOU SQL CODE
END
the region between BEGIN will be collapsed
I want to run multi line queries/batch query, but it is not working both in studio and console in orientdb 2.2 community edition. is there something I need to do, I am sure something is missing at my end.
script sql
LET $a =
MATCH
{class:Member, as:m};
select expand($a.m);
end;
In v 2.2 the newline character is considered as a statement separator, so you have to write queries on a single line:
script sql
LET $a = MATCH {class:Member, as:m} RETURN m;
select expand($a.m);
end;
In v 3.0 it's not needed anymore, the only statement separator is the semicolon, so you can write multi-line queries in scripts.
To run a script in Studio, you have to select the BATCH mode in the menu at the bottom right corner of the query editor (near the "explain" button)
Is there a way to temporary comment out some of code in SQLiteStudio? I have to add -- or /* ... */ each time and remove them manually. It will be greate if we can trigger comment using a button or shortcut like Ctrl-/. How do you tackle this problem when using SQLiteStudio?
(SQLiteStudio 3.0.7 on Windows 7)
Now it is available via these notations:
-- for one line comments
/*
for several line comments
*/
Edit:
Ctrl + / : comments the line which cursor is on it, also this hot key adds several line comment notation to the start and end point of selected area.
Is this possible in QTP 11 to set keyboard shortcut that will run macro - generate comment based on current selection.
Example:
Function FnGetString(param1, param2)
'some body
End Function
If I select name of function, I want to generate commented header (using shortcut) function with filled some parameters
'Function Name: <<selected function>>
'Author: <<current logged in user>>
'Date: <<current date>>
'input:
' - <<parameter 1>>:
' - <<parameter 2>>:
'output:
' -
Some tips how to do it?
QTP 11 does not have any extensible functionality like this. Test Design Studio (full disclosure, that's my company) has built-in functionality for XML-formatted comments that serve a similar purpose to what you're trying to do with your comment header, but having them in an XML format makes the comments easier to consistently parse for metadata. We use the same formatting as Microsoft Visual Studio.
Starting with UFT 11.5x HP changed the editor control they use, and I believe it allows you to extend functionality. I tried to find those details, but could not locate a link quickly. That will not help you on QTP 11, but is something you can research further and potentially look forward to when you upgrade to UFT.