Database Articles

Page 303 of 547

Update MySQL table column by matching date using date() function?

AmitDiwan
AmitDiwan
Updated on 25-Feb-2020 551 Views

Following is the syntax to match date with date() function and updating a column −update yourTableName set yourColumnName=yourValue where date(yourColumnName)=curdate();Let us first create a table −mysql> create table DemoTable1816      (      Name varchar(20),      JoiningDate datetime      ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1816 values('Chris', '2019-11-29 12:34:50'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1816 values('David', '2019-11-30 11:00:00'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1816 values('Mike', '2018-11-30 10:20:30'); Query OK, 1 row affected (0.00 sec)Display ...

Read More

Fetch how many people are registering on the current date with MySQL

AmitDiwan
AmitDiwan
Updated on 25-Feb-2020 251 Views

For this, you can use COUNT() along with GROUP BY MONTH(). To match with the current date, use CURRENT_DATE(). The current date is as follows −mysql> select curdate() ; +------------+ | curdate()  | +------------+ | 2019-11-30 | +------------+ 1 row in set (0.00 sec)Let us first create a table −mysql> create table DemoTable1819      (      Name varchar(20),      RegisteringDate datetime      ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1819 values('Chris', '2019-11-29 12:30:34'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1819 ...

Read More

Check for NULL or empty variable in a MySQL stored procedure

AmitDiwan
AmitDiwan
Updated on 25-Feb-2020 6K+ Views

To check for NULL or empty variable, use the IF condition. Let us create a stored procedure −mysql> delimiter // mysql> create procedure checkingForNullDemo(Name varchar(20))      begin      if Name is NULL OR Name='' then      select 'Adam Smith';      else      select Name;      end if ;      end      // Query OK, 0 rows affected (0.00 sec) mysql> delimiter ;Case 1When NULL is passed. Call the stored procedure using call commandmysql> call checkingForNullDemo(NULL);This will produce the following output −+------------+ | Adam Smith | +------------+ | Adam Smith | +------------+ 1 ...

Read More

How to use comparison operator for numeric string in MySQL?

AmitDiwan
AmitDiwan
Updated on 25-Feb-2020 163 Views

To use comparison operator for numeric string, use the substring() method. Let us first create a table −mysql> create table DemoTable1881    (    UserId int,    UserEducationGap varchar(20)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1881 values(101, '5-9'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1881 values(102, '2-4'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1881 values(103, '4-8'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1881 values(104, '7-12'); Query OK, 1 row affected (0.00 sec)Display all records ...

Read More

Present date as default value in a table

Rahul Sharma
Rahul Sharma
Updated on 25-Feb-2020 289 Views

Please try the below code. Note that you need to set the value before START-OF_SELECTIONselect-OPTIONS: so_date FOR sy-datlo. INITIALIZATION. so_date-sign = 'I'. so_date-option = 'EQ'. so_date-low = sy-datum. CLEAR so_date-high. APPEND so_date.You can also try this easy option −select-OPTIONS: so_date FOR sy-datlo default SY-DATUM.

Read More

Information required adding a new remote data source in SAP HANA SDA

John SAP
John SAP
Updated on 24-Feb-2020 472 Views

Select the system that you want to access as Remote Data Source and enter the authentication details. You have to enter the Connection Properties and Credentials for remote system.On right hand side, you have option to Test the Connection or you can also run to create the data source.

Read More

Creating a new remote source in SAP HANA using SQL

John SAP
John SAP
Updated on 24-Feb-2020 2K+ Views

You can also create a remote source using SQL statement as below −CREATE REMOTE SOURCE Source_Name ADAPTER “odbc” CONFIGURATION FILE ‘property_orcl.ini’ CONFIGURATION ‘DSN=oral_DSN_Name’ WITH CREDENTIAL TYPE ‘PASSWORD’ USING ‘user=username;password=password′;In this SQL statement- can be as per remote data source and take these values- TDODBC, HIVEODBC, ASEODBC, IQODBC and ODBC.In above statement, is used to specify the connection information for data source where you need to mention the DSN name for your ODBC remote source system. You have to create a System DSN/User DSN to access the data source using ODBC connection.To open SQL console, right click on Remote ...

Read More

Using configuration file orcl.ini to add Oracle data source in SAP HANA

John SAP
John SAP
Updated on 24-Feb-2020 545 Views

CONFIGURATION FILE ‘property_orcl.ini’ It is only required for Adapter ODBC for Oracle data sources. Below shows SQL query to create an Oracle Remote Source using SQL

Read More

System Authorization to use SAP HANA Smart Data Access

John SAP
John SAP
Updated on 24-Feb-2020 1K+ Views

You need to add SAP HANA system authorization CREATE REMOTE SOURCE to create a remote source. If the remote source is not created with the SAP user but with a different database user instead, then this database user must assign the corresponding object authorizations to the SAP user (CREATE VIRTUAL TABLE and DROP).Navigate to user profile in Security tab and go to System privilege.

Read More

Updated features in SAP HANA SPS07 for Smart Data Access

John SAP
John SAP
Updated on 24-Feb-2020 335 Views

Following are major changes are done in SAP HANA SPS07 for Smart Data Access −In later version SPS07, it supports SAP Oracle Database 12c, SAP Sybase Event Stream Processor (ESP) 5.1 SP04 and MSSQL server 2012 version 11 as data sources.In SPS07, it is possible to perform insert/update/deletion for remote databases with some limitations.In SPS06, it was not possible to use BLOB and CLOB data types with virtual tables. In SPS07, SDA now supports BLOBs and CLOBs as column data type of virtual table.SDA has a new feature which will help to check whether SDA installation is done successfully or ...

Read More
Showing 3021–3030 of 5,468 articles
« Prev 1 301 302 303 304 305 547 Next »
Advertisements