# US 10,310,960 B2 · Debugging for SQL statement

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,310,960 B2
- Document ID: US10310960B2
- Status: Granted
- Kind: B2
- Application number: 15/171,072
- Filed: 2016-06-02
- Published: 2017-12-07
- Granted: 2019-06-04
- Earliest claimed: 2016-06-02
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Shuo Li; Xin Peng Liu; Xiaobo Wang; Xiong Wei Zhao
- Web page: https://patentgrep.com/patent/US10310960B2

## CPC

- G06F 11/362: Debugging of software
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

This disclosure provides a computer-implemented method for debugging a program including a SQL statement. The method comprises indicating one or more first positions of source code of the program. Each of the one or more first positions corresponds to a fragment of the SQL statement at which a breakpoint can be set. The method further comprises receiving an input of setting breakpoint at one of the one or more first positions. The method further comprises presenting an execution context generated in response to execution of the program reaching a breakpoint set based on the input.

## Claims

### Claim 1

A computer-implemented method for debugging a program including a Structured Query Language (SQL) statement, the method comprising:
indicating one or more first positions of a source code of a program, wherein each of the one or more first positions corresponds to a fragment of a SQL statement at which a breakpoint can be set, and a sub-query is considered a fragment, wherein when a user moves a cursor over a fragment at which the breakpoint can be set, the movement of the cursor over the fragment will cause a bubble or a window to open to prompt the user that a break point can be set, wherein the fragment of the SQL statement refers to a part of the SQL statement, such as including a clause, an equation or a variable in the SQL statement;
receiving an input of the setting breakpoint at one of the one or more first positions; and
presenting an execution context generated in response to execution of the program reaching the breakpoint set based on the input.

### Claim 2 (depends on 1)

The computer-implemented method according to claim 1, wherein each of the one or more first positions of the source code of the program has a correspondence with a part in an access path generated by a database management system of a database based on the SQL statement, and each of the one or more positions of the source code corresponds to one or more fragments of a sub-query at which a breakpoint can be set.

### Claim 3 (depends on 2)

The method according to claim 2, further comprising:
displaying the correspondence of each of the one or more first positions of source code of the program.

### Claim 4 (depends on 2)

The computer-implemented method according to claim 2, further comprising:
setting the breakpoint at the one of the one or more first positions based on the input; and
equipping a probe to acquire the execution context for the breakpoint at an exit of the part in the access path that corresponds to the one of the one or more first positions.

### Claim 5 (depends on 2)

The computer-implemented method according to claim 2, wherein the execution context includes at least one of retrieved data records, referenced table information and real time statistics.

### Claim 6 (depends on 5)

The computer-implemented method according to claim 5, wherein the execution context acquired for the breakpoint in an execution of the program is saved for generating data records for the breakpoint in a later execution of the program.

### Claim 7 (depends on 6)

The computer-implemented method according to claim 6, wherein in saving the execution context, data records retrieved from the database for the breakpoint are partly saved by data sampling as a part of the execution context.

### Claim 8 (depends on 6)

The computer-implemented method according to claim 6, wherein only a part of the data records in an execution context saved for a breakpoint are used to generate data records for the breakpoint in a later execution of the program.

### Claim 9 (depends on 1)

The computer-implemented method according to claim 1, further comprises:
indicating one or more second positions of source code of the program, wherein each of the one or more second positions corresponds to at least one of a SQL statement, a declaration statement, or a logic control statement at which a breakpoint can be set.

### Claim 10

A system for debugging a program including a Structured Query Language (SQL) statement, comprising:
one or more processors;
a memory coupled to at least one of the one or more processors;
a set of computer program instructions stored in the memory and executed by at least one of the one or more processors in order to perform actions of:
indicating one or more first positions of source code of a program, wherein each of the one or more first positions corresponds to a fragment of the SQL statement at which a breakpoint can be set, and a sub-query is considered a fragment, wherein when a user moves a cursor over a fragment at which the breakpoint can be set, the movement of the cursor over the fragment will cause a bubble or a window to open to prompt the user that a break point can be set, wherein the fragment of the SQL statement refers to a part of the SQL statement, including a clause, an equation or a variable in the SQL statement;
receiving an input of setting breakpoint at one of the one or more first positions; and
presenting an execution context generated in response to execution of the program reaching a breakpoint set based on the input.

### Claim 11 (depends on 10)

The system according to claim 10, wherein each of the one or more first positions of source code of the program has a correspondence with a part in an access path generated by a database management system of a database based on the SQL statement, and each of the one or more positions of the source code corresponds to one or more fragments of a sub-query at which a breakpoint can be set.

### Claim 12 (depends on 11)

The system according to claim 11, further comprising a set of computer program instructions stored in the memory and executed by at least one of the one or more processors in order to perform actions of:
setting the breakpoint at the one of the one or more first positions based on the input; and
equipping a probe capable of acquiring the execution context for the breakpoint at an exit of the part in the access path that corresponds to the one of the one or more first positions.

### Claim 13 (depends on 11)

The system according to claim 11, wherein the execution context includes at least one of retrieved data records, referenced table information and real time statistics.

### Claim 14 (depends on 13)

The system according to claim 13, wherein the execution context acquired for a breakpoint in an execution of the program is saved for generating data records for the breakpoint in a later execution of the program.

### Claim 15 (depends on 14)

The system according to claim 14, wherein in saving the execution context, data records retrieved from the database for the breakpoint are partly saved by data sampling as a part of the execution context.

### Claim 16 (depends on 14)

The system according to claim 14, wherein only a part of the data records in an execution context saved for the breakpoint are used to generate data records for the breakpoint in a later execution of the program.

### Claim 17

A computer program product for debugging a program including a SQL statement, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, wherein the program instructions being executable by a device to perform a method comprising:
indicating one or more first positions of source code of the program, wherein each of the one or more first positions corresponds to a fragment of the SQL statement at which a breakpoint can be set, and a sub-query is considered a fragment, wherein when a user moves a cursor over a fragment at which the breakpoint can be set, the movement of the cursor over the fragment will cause a bubble or a window to open to prompt the user that a break point can be set, wherein the fragment of the SQL statement refers to a part of the SQL statement, including a clause, an equation or a variable in the SQL statement;
receiving an input of setting breakpoint at one of the one or more first positions; and
presenting an execution context generated in response to execution of the program reaching a breakpoint set based on the input.

### Claim 18 (depends on 17)

The computer program product according to claim 17, wherein each of the one or more first positions of source code of the program has a correspondence with a part in an access path generated by a database management system of a database based on the SQL statement, and each of the one or more positions of the source code corresponds to one or more fragments of a sub-query at which a breakpoint can be set.

### Claim 19 (depends on 18)

The computer program product according to claim 18, wherein the method further comprising:
setting the breakpoint at the one of the one or more first positions based on the input; and
equipping a probe capable of acquiring the execution context for the breakpoint at an exit of the part in the access path that corresponds to the one of the one or more first positions.

### Claim 20 (depends on 18)

The computer program product according to claim 18, wherein the execution context includes at least one of retrieved data records, referenced table information and real time statistics.
