Multi-Line Comments in CosmosDB SQL - azure-cosmosdb

I am very experienced with T-SQL (SQL Server). Recently I've been doing some work in CosmosDB SQL. It is obviously different in SO many ways from good ol' T-SQL. So here's a question:
How do we do multi-line comments in CosmosDB SQL? The SQL Server way /* */ doesn't seem to work:
Gateway Failed to Retrieve Query Plan: Message: {"errors":[{"severity":"Error","location":{"start":231,"end":232},"code":"SC1001","message":"Syntax error, incorrect syntax near '*'."}]}
ActivityId: dcd0e077-34a1-4cc5-92dc-e97130fc4523, Microsoft.Azure.Documents.Common/2.11.0, Microsoft.Azure.Documents.Common/2.11.0
Anyone? Thank you!

There is no multi-line comments in Cosmos DB by now. You can only use -- to do single-line comment as Ruud Helderman said. You can give feedback here to progress this feature.

Related

PowerAMC and SQLite

I just wanted to know if there is any way to generate a SQLite database from Poweramc ?
At first sight, it seems not, and Google isn't helping me much on this...
Thank you for your hints ;)
Since there has been no answer, I guess you'll have to prepare your own DBMS definition. I would have suggested to start by making a copy of the ANSI .xdb, but I saw someone mentioning the use of mySQL .xdb.
Update: I have started a DBMS for SQLite 3.

How to search in pl/sql local collections?

How can i make query to PL/SQL local collections like TABLE OF and VARRAY?
I searched the web , but whatever I found is to iterate over them eg. FOR LOOP!
Is there any facility to make query to them?
Thanks.
The SQL engine can make queries, the PL/SQL engine cannot. So you need to cast your collections to table types that are known to the SQL engine.
SQL doesn't know about types declared in packages, so you have to declare them at the global level.
Judging by your comment it seems like you pretty much figured it out already.

Convert PL/SQL to Hive QL

I want a tool through which I can get the respective hive query by giving the PL/SQL query. There are lots of tools available which convert sql to hql. ie: taod for cloude database. But it does not show me the respective hive query.
Is there any such kind of tool whose convert given sql to hql. Please help me.
Thanks and Regards,
Ratan
Please take a look at open-source project PL/HQL at http://www.hplsql.org/ which is now a part of Hive 2.x or higher version. It allows you to run existing SQL Server, Oracle, Teradata, MySQL etc. stored procedures in Hive.
Ratan, I did not how to start responding. So, lets start like this. I think you checked toad and thinking like there is a tool to convert SQL to hive QL. I do not think there is such a tool.
Let me clarify like this, HIVE QL, is same as SQL. Check this links before you are trying to write some queries:
https://cwiki.apache.org/confluence/display/Hive/LanguageManual,
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF.
This is simple to understand if you know sql and simple to write (as you check the HIve ql).
Hive doesnot have many operators the sql supports. For example:
select * from sales where country like 'EU~%'; "HIVE SUPPORTS LIKE"
But try this negative queries as we write in SQL :
select * from sales where country not like 'EU~%'; "HIVE DOES NOT SUPPORT"
This is just one example, I remember. There are more like this. But to deal with these hive has many like "where not" etc.
If your question is does the Hive have any PL/SQL support. Straight answer is no. But, we can check the UDF in hive and also, the PIG on Hadoop.

Connection code to the database in asp.net

My database name is [chitomiho] and my table name is [trytable].
I want code for connecting to database and insert values into try table in asp.net
Here is a great tutorial on connecting to a database in ASP.Net. We're not here to write code for you, only to help you when you're stuck.
http://www.w3schools.com/aspnet/aspnet_dbconnection.asp
Dear Inspiron this is a forum question and not meant to be asked here. If you would have just googled it!!!!
You may find this helpful:
http://msdn.microsoft.com/en-us/library/ms178371.aspx

Oracle: What is "(+) ="?

I don't currently have any access to any Oracle books and my searches online are returning literally no results ( (+) in Google shows nothing). I'm looking through existing code to add some fields to a query and saw:
AND lookup.LookupID (+) = AuditID
However, I have no idea what this does. Any help would be appreciated.
Note: I'm not seeing a community wiki checkbox while posting this in Google Chrome, so if someone can change it to that for me, I'd be appreciative. Thanks.
What you're seeing is an "old" way for specifying an outer join. Oracle needed a syntax to represent outer joins and before the ANSI commitee settled on a standard syntax, Oracle came up with their own.
(+) should be seen only in legacy code and today it is recommended to simply avoid this syntax and stick with the standards.
In this Oracle FAQ you can read some historical info. Not too detailed, but it will give you an idea of how this operator came to be.
Relevant part:
In query2 we see the "Old Style"
Oracle syntax for OUTER-JOIN. It is
the PLUS SIGN in parenthesis. This
syntax was not actually invented by
Oracle but rather some smart guy whose
name escapes me at the moment. Oracle
saw its value and was an early adopter
of OUTER-JOIN but doing so required
them to use a syntax before ANSI SQL
COMMITTEE settled on one. The new and
improved ANSI SQL is fine and all,
some say even better, but being an old
bird I tend to stick with old and
proven ways till something makes me
change.
Apparently not even Oracle did invent this syntax. It's good to have standards...
It is Oracle way to specify a outer join (ANSI way would be RIGHT JOIN/LEFT JOIN)

Resources