Found 95 Articles for SQL

Using SQL statements in ABAP Programming and Database performance

Anvi Jain
Updated on 18-Dec-2019 07:57:43
The basic principle for performance is that there should be minimal data transferred between application server and database.For your first question, I would suggest to select only the fields that are required. So, don’t use SELECT * in case you don’t require all the fields. But in specific scenarios, if you have multiple SELECT statements at various parts of your program querying the same table but different columns, it is advisable to use SELECT * as the output is stored in a buffer till your program execute. In that case, when you come to subsequent select, the system uses the ... Read More

Delete duplicate alphanumeric entries from column data in SQL

Nitya Raut
Updated on 18-Dec-2019 10:05:14
You can opt for using regular expressions to remove the duplicate numbers from column c or any other intended column.ExampleSELECT REPLACE_REGEXPR ('([A-Za-z0-9])\1+' in 'BB11222343CC'    WITH '\1'    OCCURRENCE ALL) FROM OutputB12343C

Using a SQL View in SAP BusinessOne

SAP Developer
Updated on 13-Feb-2020 07:16:30
Yes, it is  possible to use a view in Business one client and you can use it too. Please find below a sample format that you should be using to query the view in business one environment −SELECT FROM [dbo].[]I have done the same and it is working for me.

IN statement in SQL doesn’t accept a wild character (SAP)

SAP Expert
Updated on 25-Jun-2020 20:47:09
Note that IN statement in SQL doesn’t accept a wild character. You have to use OR/AND to make it work as mentioned below:select * from Test1 t INNER JOIN Test2 s ON t.ID = s.RID where t.sdate >= ?1 AND t.edate

No error while inserting record in child table with no match in master table in SAP

SAP Expert
Updated on 12-Jun-2020 08:22:34
Note that when you perform an insertion using an ABAP program, there is no check on foreign key constraint.  Even when you define checks in data dictionary SE11 still there is no check at database level.When you execute using an ABAP code, this checks consistency at application level and not at database level. Errors you see in SE16 shows record rejected at application level.You need to perform validation by checking record from master table with foreign key of child table and incase sy-subrc is not initial then record shouldn’t be inserted to the child table and shows an error message.Read More
Previous 1 ... 6 7 8 9 10