SQL console with Eclipse ADT is one of the most powerful tools which is not present in classical GUI ABAP workbench. With SQL console, now a Developer can directly query on SAP Business Database schema and can check the result/output on the fly.
SQL Console is a new tool which every ABAPer must Know!
Earlier, to do similar job, a small ABAP program had to be written which was time consuming work. Some quick pointers:
- SQL console is a very handy tool in Eclipse which facilitates user to query on DDIC including CDS views
- This is different than SQL console present in HANA modeler where query should identify right schema
- Developer can quickly query on table(s) & analyze result to utilize same in code
How to access ADT SQL Console:
Right Click on Project > SQL Console
- In SQL console, developers can freely query on DDIC and check result on the fly
- Query can be checked and Run from within console
- Filter pattern can be used to filter out result
- Max rows for output can be defined and number of entries can be checked
- Result can be exported in following formats:
- Delimited text file
- HTML file
- XML file
Commenting in SQL console: A double quote( “ ) just as ABAP can be used for writing comment in SQL console.
More features in SQL Console:
1.Check(Diagram 3): Press this button or not, the SQL written in SQL console is automatically checked. Pressing this button explicitly checks the syntax of SQL again on user’s demand. If any error is found in the syntax, this is notified upfront to the user as below:
2. Data Aging(Diagram 3): SAP with HANA distinguishes the data with respect to their “Temperatures”. They are:
- HOT data: More relevant data
- COLD data: Less relevant data or Data identified for archival
Turning this Flag ON or OFF, hints the database about the temperature of data to be retrieved on selection of data/execution of query.
3. Max Rows(Diagram 3): Max Rows suggests the number of records to be retrieved from Database on execution of query. Default value may sometimes restrict the actual number of records to be fetched. Maximum 100,000 records can be set in this fields for now. If you try to enter more than 5000 in this field, Eclipse also informs that it may cause performance issues. Similar feature is available in SAP GUI Transaction SE16 and SE16N also.
4. Execution time(Diagram 3): This time is sometimes ignored however this is a very important which gives first hand information on execution performance. When programmer has to select one of the option from two or more variant of similar queries, checking execution time of each variant is a good practice before using query in the code.
5. Number of Entries(Diagram 3): This button provides number of rows to be fetched for the query in SQL Console. Similar feature is available in SAP GUI Transaction SE16 and SE16N also.
6. History and Favorites(Diagram 4): Refer diagram. Queries can be saved in Favorites for later use. Eclipse by default saves past used queries also.