Where each of them used? - sql

When I am studying about SAP HANA I come across various SQL terms
Open SQL
Native SQL
SQL script
Can somebody explain which one we use in HANA studio while creating CDS view or scripted calculation view and which SQL we use in our normal ECC program
I am little confused.

We have to start from a bit further
ABAP
Most SAP applications are written in their own programming language, ABAP (some is in java)
Open SQL
When you want to talk to your database in your ABAP program, you have to write SQL. As R3 from SAP works with most relational databases, a common set of features had to be used, with some SAP specific extensions which are translated by the ABAP kernel to be understood by the actual DB. This portable language is called Open SQL.
HAVING and UNION were not allowed for example before 2017, but easy insturctions are added to define where the result is stored.
Native SQL
If you develop for only one database, you can use its native instructions. These can bring additional features or speed, at the cost of transportability.
HANA
For decades SAP did not sell databases, you had to buy one for your ERP system from a third party. A few yeards back SAP started to create its own DB, called HANA.
When you call it from ABAP, you can use Open SQL. If you create a CDS view in HANA Studio, you write Native SQL.
SQLscript
If you want to write stored procedures, you have to use SQLscript, also developed by SAP. With it you have features completely foreign to SQL like loops.
It is just like Transact-SQL for SQL Server, PL/SQL for Oracle, etc - as Eralper wrote

Related

Embedding code in SAP HANA

What programming languages does SAP HANA support in embedding code to run within the HANA cluster similar to how you would write your own SQL functions to run inside an RDBMS, or your own code to run on a Hadoop cluster.
You basically have two options here. The first thing would be Stored Procedures. These are actually pretty common in other databases like MySQL or DB2. You can create a new procedure with CREATE PROCEDURE. More information on this can be found in the HANA Documentation. The supported languages for this are SQLScript and R.
Another thing that should be mentioned is the XS Engine. Every HANA (I think) has the XS Engine built in. This is basically a JavaScript frontend for your HANA. You can use the XS Engine to write JavaScript APIs, interfaces and applications directly on your HANA using JavaScript. Get started here.
SAP HANA offer XS Engine to integrate and develop apps. Its a good way, considering the network traffic, authentication and security.
The XS Engine is 'server' which allows .html, .css, .js, .csv, images files and .xsjs.
The last one type is a kind of javascript which run as a back-end language, creating connection with database.

Is there an ABAP Workbench in SAP Business One 2007?

Here comes a simple question but hard to find its answer.
Is there an ABAP Workbench (also known by the transaction code SE80 in SAP R/3) in SAP Business One 2007?
The workbench should be open and not just for SAP use. I would like to know if it's possible to create custom ABAP programs in this SAP solution.
It's not hard to find the answer at all if you bother searching. There is no ABAP Workbench in B1 because B1 is not built on top of the NetWeaver/ABAP stack.
SAP Business One is not built on NetWeaver platform, so there will be no way you can have an ABAP application server. Also, for your information, SBO is not a R/3 Structure .About the technical part in SBO, it has a SQL database and you can only write SQL queries to retrieve data and generate reports. There is a query generator to help you write queries. To conclude, data processing in SBO is very limited comparing to ABAP.
You need to use either .NET/Java for customising or developing screens in SAP Business One.
It doesn't have any relation with ABAP and there are no transaction codes in SAP Business One.
About the technical part in SBO, it has a SQL database and you can only write SQL queries to retrieve data and generate reports. There is a query generator to help you write queries. To conclude, data processing in SBO is very limited comparing to ABAP.
But once you have the data you can do whatever you want with it, for e.g the now native Crystal Report rutime in SBO...Also it has a a pretty rich and mature COM-based SDK for putting data in as well, the DI API (as well as the DI Server which is XML-based). I create solutions for SBO with these all the time in my job...

Generate db diagram from any sql statement

I'm using DBArtisan 8.5.5 and it has the ability to generate Database Diagrams using Build Query, it has a nice feature that lets it autojoin, detecting potential relationships on newly added tables to the diagram. So the diagram results into a SQL statement since its a Query Builder after all.
Is it possible to provide an SQL statement in DBArtisan and generate the Database Diagram? In other words, the reverse (give it the SQL to generate the diagram, instead of using diagrams to generate SQL)?
If no such feature, is there a product out there for Sybase DB that will provide said feature?
DbVis is an actionable choice, being open source and powerful - it's got a good amount of extra features aside from the one you need.
If you're willing to pay, Aqua Data Studio is a very complete and intuitive database IDE.
As a middle ground solution, disposing of both a - constantly updated - open source edition, the DBeaver Open Source IDE, and an Enterprise Edition. Both of these also offer what you need, the main differences as of now being interface, SSH algorithm support and SQL debugging framework offered in Enterprise. You can take a deeper look yourself, comparing the Open Source features with the Enterprise ones.

how to make a db schema such that its use is supported by all db management systems

is there a windows xp utility to make a database such that its support by sql server, oracle, and other db management systems.
the database schema is very huge so i would like to know what to use to make it so its protable from sql server to oracle if future demands that change?
In short, what you seek is nearly impossible to do successfully. Every database product has enough quirks that building such database would not perform well and would be too limiting in terms of the features you were able to use. I.e, you have to play the game of lowest common denominator with respect to features that all products implement you want to support. A far better solution is to abstract the data layer into its own library accessed via interfaces so that you can swap out your data layer. ORMs, as Rafael E. Belliard suggested, makes this simpler but it can also be done manually.
I would recommend building your database using an ORM like Hibernate for Java (or NHibernate for .NET). This would allow you to seamlessly transition from one database type to the other with little to no issues. They would allow you to logically create the database schema without a specific database in mind, which you could then move from one database to the other.
I have created applications which change from SQL Server to MySQL to Oracle to MS Access to SQLite easily (clients love that flexibility).
However, you would need to know your way around programming...

Sybase Development IDE

Is there a Toad type application for Sybase? I can't seem to find a single one! I've tried using VS 2008 but can't see the sproc source.
Am assuming Sybase ASE.
Ships with Sybase Central and SQL Advantage as part of the client tools. Sybase Central lets you manage and create tables, views, sprocs etc. SQL Advantage lets you run SQL...
Sybase Workspace is a new tool for ASE, I've never tried it. http://www.sybase.com/products/modelingdevelopment/workspace
ASE ISQL is a free tool that is also useful for running sql, but is less useful for modifiying stored procedures etc. (More of a SQL Advantage replacement). http://code.google.com/p/aseisql/
If you have money to spend then there's also Embarcadero's DBArtisan. http://www.embarcadero.com/products/dbartisan. I've used this and it's pretty good, although their support for MSSQL and Oracle is better than the Sybase support.
RazorSQL has very good Sybase support. Edit / view stored procedures, etc.
SqlDbx at http://www.sqldbx.com/. Very light-weight software promising a lot of editor features. This requires Sybase Open Client to be installed on your workstation.
But I'll recommend using Oracle SQL Developer. I'm presently working through a JDBC connection to a Sybase ASE database using this tool. This seems to be Eclipse-based, but is quite responsive and allows you to view source code for functions and procs too.
Looks like Quest now offers a Sybase version of Toad.
DBeaver is open-source and appears to work fine.
Try Embarcadero Rapid SQL. I recommend you the 7.4 version over 7.6 because it is more stable. Embarcadero Rapid SQL XE is the recent version.
Embarcadero Rapid SQL XE enables
developers and DBAs to produce high
performing SQL code at lightening
speeds. With support for all major
database platforms from a single
interface, teams can standardize on
one powerful heterogeneous SQL IDE
tool.
Squirrel SQL is open source and works pretty well
I'm using CAST SQL-Builder from CAST Software, the debugger in this tool saved me a lot of time.