Database Articles

Page 255 of 546

How can we find out the current transaction mode in MySQL?

Monica Mona
Monica Mona
Updated on 14-Feb-2020 674 Views

We can run “SELECT @@AUTOCOMMIT” command to check the current transaction mode.mysql> Select @@AUTOCOMMIT; +--------------------+ | @@AUTOCOMMIT       | +--------------------+ |       1            | +--------------------+ 1 row in set (0.05 sec) mysql> SET AUTOCOMMIT = 0; Query OK, 0 rows affected (0.00 sec) mysql> Select @@AUTOCOMMIT; +--------------------+ | @@AUTOCOMMIT       | +--------------------+ |         0          | +--------------------+ 1 row in set (0.00 sec)

Read More

Using ABAP Function module RSAQ_REMOTE_QUERY_CALL, NO_DATA_SELECTED exception using selection parameters

Manikanth Mani
Manikanth Mani
Updated on 14-Feb-2020 613 Views

As SAP provides flexible options that allow selection parameters easy to use. As you are using multiple parameters please note the following:Set KIND to “s” only for using select option. If you are using parameters, it should be “P”Instead of using EN, try using internal language “E”RSAQ_REMOTE_QUERY_FIELDLIST- this function module can be used to find the types as below −Use T-code SE37 and enter the FM name → Display

Read More

Extracting data from SAP HANA database and load to ORACLE database

Paul Richard
Paul Richard
Updated on 14-Feb-2020 985 Views

There is a number of ways you can achieve this. Here are few of the methods to do the same.a) There are many standard tools in SAP by use of which you can extract the data and also automate the whole process. With the use of an ETL tool, this can be achieved like SAP Data Services, OWB, etc.b) The other option is to write a code in ABAP to fetch the data from the database and the write into a format as per your requirement.c) You can also write a RFC or remote-enable function module which can be called ...

Read More

Concatenate 2 strings in ABAP without using CONCATENATE function

Moumita
Moumita
Updated on 14-Feb-2020 3K+ Views

In ABAP you can use && sign to concatenate variables as belowDatahello TYPE string, world TYPE string, helloworld TYPE string. hello = 'hello'. world = 'world'. helloworld = hello && world.If you want to concatenate strings directly, you can usehelloworld = 'hello' && 'world'.If you want to keep space in between, you would require ` symbol as belowhelloworld = hello && ` and ` && world

Read More

What happens if MySQL query returns no rows?

varun
varun
Updated on 13-Feb-2020 2K+ Views

From the output returned by MySQL, it is very much clear that how many rows are there in the result set along with the execution time.ExampleFor example, in the following MySQL output we can see there are 3 rows in the result set.mysql> Select * from ratelist ORDER BY Price LIMIT 3; +----+------+-------+ | Sr | Item | Price | +----+------+-------+ |  5 | T    |   250 | |  1 | A    |   502 | |  2 | B    |   630 | +----+------+-------+ 3 rows in set (0.00 sec)But suppose if MySQL query has ...

Read More

While connecting to one MySQL database, how can I see the list of tables of other MySQL database?

seetha
seetha
Updated on 13-Feb-2020 219 Views

With the help of SHOW TABLES From Database_name query, we can see the tables of another database. Here Database_name is the name of the database which we are not using currently. Consider the following example in which we run the query for getting the list of tables in database name ‘tutorial’.mysql> show tables from tutorial; +--------------------+ | Tables_in_tutorial | +--------------------+ | employee           | | showzerofill       | | student            | +--------------------+ 3 rows in set (0.00 sec)

Read More

How do we count the total duplicate records in a column of MySQL table?

Abhinaya
Abhinaya
Updated on 13-Feb-2020 2K+ Views

Suppose we have the following table named stock_item in which the column quantity is having duplicate values i.e. for item name ‘Notebooks’ and ‘Pencil’, the column ‘Quantity’ is having duplicate values ‘40’ and for items ‘Shirts’, ‘Shoes’ and ‘Trousers’ triplicate value 29 is hold by column ‘quantity’ as shown in the table.mysql> Select * from stock_item; +------------+----------+ | item_name  |quantity  | +------------+----------+ | Calculator |       89 | | Notebooks  |       40 | | Pencil     |       40 | | Pens       |       32 | | ...

Read More

How MySQL stored function evaluates if it got NULL value while using the dynamic values from a table?

Ramu Prasad
Ramu Prasad
Updated on 13-Feb-2020 281 Views

In such kind of cases when a stored function got NULL values then it will return NULL as the result. It can be understood from the example below in which we have a NULL value in the records of student ‘Mohit’. Now, when we will apply the stored function ‘avg_marks’ on this data, it will return NULL as result.mysql> Select * from Student_marks; +-------+------+---------+---------+---------+ | Name  | Math | English | Science | History | +-------+------+---------+---------+---------+ | Raman |   95 |      89 |      85 |      81 | | Rahul |   90 | ...

Read More

How can we create a MySQL stored function that uses the dynamic data from a table?

Sravani S
Sravani S
Updated on 13-Feb-2020 529 Views

MySQL Stored functions can reference tables but they cannot make use of statements that return a result set. Hence we can say that there is no SELECT query that returns result set. But we can have SELECT INTO to get rid of that. For example, we are creating a function ‘Avg_marks’ that uses the dynamic data from table named ‘Student_marks’, having following records, to calculate the average of marks.mysql> Select * from Student_marks; +-------+------+---------+---------+---------+ | Name  | Math | English | Science | History | +-------+------+---------+---------+---------+ | Raman |   95 |      89 |      85 | ...

Read More

How to write a MySQL stored function that inserts values in a table?

Giri Raju
Giri Raju
Updated on 13-Feb-2020 2K+ Views

As we know that function is best used when we want to return a result. Hence, when we will create stored functions for manipulating tables like to Insert or Update values then it would be more or less like stored procedures.ExampleIn the following example we are creating a stored function named ‘tbl_insert’ which will insert the values in a table named ‘student_marks’.mysql> Create Function tbl_insert(S_name Varchar(50), M1 INT, M2 INT, M3 INT, M4 INT)     -> RETURNS INT     -> DETERMINISTIC     -> BEGIN     -> INSERT INTO student_marks values(S_name, M1, M2, M3, M4);     ...

Read More
Showing 2541–2550 of 5,456 articles
« Prev 1 253 254 255 256 257 546 Next »
Advertisements