POSIX Character Classes in Greek Java Regex

Maruthi Krishna
Updated on 21-Feb-2020 11:08:43

393 Views

This class \p{InGreek} matches Greek characters.Example Live Demoimport java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Example1 {    public static void main(String args[]) {       //Reading String from user       System.out.println("Enter a string");       Scanner sc = new Scanner(System.in);       String input = sc.nextLine();       //Regular expression       String regex = "\p{InGreek}";       //Compiling the regular expression       Pattern pattern = Pattern.compile(regex);       //Retrieving the matcher object       Matcher matcher = pattern.matcher(input);       int count = 0;     ... Read More

POSIX Character Classes: p and Alnum in Java Regex

Maruthi Krishna
Updated on 21-Feb-2020 10:59:03

747 Views

This class matches alpha numeric characters.Example  Live Demoimport java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class AlphanumericExample {    public static void main(String args[]) {       //Reading String from user       System.out.println("Enter a string");       Scanner sc = new Scanner(System.in);       String input = sc.nextLine();       //Regular expression       String regex = "[\p{Alnum}]";       //Compiling the regular expression       Pattern pattern = Pattern.compile(regex);       //Retrieving the matcher object       Matcher matcher = pattern.matcher(input);       int count = 0;     ... Read More

Check If a ResultSet is Empty in JDBC

Vikyath Ram
Updated on 21-Feb-2020 10:51:41

8K+ Views

Whenever we execute SQL statements using the executeQuery() method, it returns a ResultSet object which holds the tabular data returned by the SELECT queries(in general).The ResultSet object contains a cursor/pointer which points to the current row. Initially this cursor is positioned before first row (default position).The next() methodThe next() method of the ResultSet interface moves the pointer of the current (ResultSet) object to the next row, from the current position.This method returns a boolean value specifying whether the ResultSet object contains more rows. If there are no rows next to its current position this method returns false, else it returns true.Therefore, ... Read More

Open SQL Editor Using SAP HANA Studio

John SAP
Updated on 21-Feb-2020 10:45:11

4K+ Views

When you add a new system under HANA Studio, below screen comes where different folders are available to manage HANA system. To open SQL editor, you have to select HANA system and click on SQL button at the top.Once you click on SQL button to open SQL console for selected items, right side you can see a SQL editor where you can run SQL queries in HANA database.You can also open SQL console by right click on HANA system HDB → Open SQL Console. When console is opened, at the top you can see host name and instance number and ... Read More

Changing Default Schema in SQL Console in SAP HANA

John SAP
Updated on 21-Feb-2020 10:44:34

2K+ Views

To change the default schema, you have to select schema name from Catalog folder and click on SQL tab at the top.You can also right click on Schema in which you want to create Relational objects and select Open SQL Console. In below pic, you can see the Schema AA_HANA11 and right click → Open SQL Console.At the top of SQL console, you can see Schema name where the objects will be created using this console.

Grant SYS_REPO SELECT Privileges to User Schema in SAP HANA

John SAP
Updated on 21-Feb-2020 10:43:21

6K+ Views

In SAP HANA system _SYS_REPO user is required to create run time objects that are saved in HANA database under _SYS_BIC schema. When you activate modeling views in HANA, SYS REPO provides the read access to users on these modeling views. That is why it is required to grant _SYS_REPO with SELECT with GRANT privilege to user schemas.GRANT SELECT ON SCHEMA "SCHEMA_NAME" TO _SYS_REPO WITH GRANT OPTIONThis is required when you use objects of a table/view of a schema to build HANA Modeling Views. You need to grant _SYS_REPO the SELECT WITH GRANT privilege on this schema.Read More

Accept Date Strings in MM-DD-YYYY Format Using Java Regex

Maruthi Krishna
Updated on 21-Feb-2020 10:39:39

4K+ Views

The following is the regular expression to match the date in the dd-MM-yyyy format.^(1[0-2]|0[1-9])/(3[01]|[12][0-9]|0[1-9])/[0-9]{4}$To match a date in a string in that format.Compile the above expression of the compile() method of the Pattern class.Get the Matcher object bypassing the required input string as a parameter to the matcher() method of the Pattern class.The matches() method of the Matcher class returns true if a match occurs else it returns false. Therefore, invoke this method to validate the data.Example 1import java.util.regex.Matcher; import java.util.regex.Pattern; public class MatchingDate {    public static void main(String[] args) {       String date = "01/12/2019";   ... Read More

Refreshing a Schema After Creating a Table in SAP HANA Database

John SAP
Updated on 21-Feb-2020 10:38:19

555 Views

Let us say you have executed the below create table SQL statement in HANA database −Create Table Demo_HANA ( ID INTEGER, NAME VARCHAR(10), PRIMARY KEY (ID) );To check the table in HANA database, navigate to AA_HANA11 schema and right click and refresh (F5). Navigate to “Table” folder and you can see new table with name Demo_HANA is created.

Inserting Data in a Table in SAP HANA

John SAP
Updated on 21-Feb-2020 10:37:26

2K+ Views

To insert the data, you need to run the Insert statement in SQL editor. “Demo_HANA” is table name.Insert into Demo_HANA Values (1,'John'); Insert into Demo_HANA Values (2,'Anna'); Insert into Demo_HANA Values (3,'Jason'); Insert into Demo_HANA Values (4,'Nick');In SQL editor, add INSERT statements and execute (F8) as below −

Change Storage Type of Table in SAP HANA Database

John SAP
Updated on 21-Feb-2020 10:35:28

568 Views

You can also convert a Column store table to a Row store table or a Row store table to Column store table using ALTER table command.Alter table "AA_HANA11"."DEMO_HANA" column;

Advertisements