IP Library Granted Patent US 7,831,614
Granted Patent B2
US 7,831,614 · App. 10/888,146 · Granted Nov 9, 2010

System and method for generating SQL using templates

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,831,614
App. No.
10/888,146
Granted
Nov 9, 2010
Kind
B2
Abstract

A method for generating a structured query language (SQL) script based on a template includes selecting one object from a plurality of objects in a data model. At least one instruction is selected based, at least in part, on a type of the selected object and, then, an associated template string is selected based on each selected instruction. At least a portion of a SQL script is automatically generated based on the one or more selected template strings.

Claims (83)

1. A method for generating a structured query language (SQL) script based on a template, the method comprises:

selecting one object from a plurality of objects in a data model;

automatically selecting, without user input, at least one first instruction based, at least in part, on a type of the selected object;

selecting a first template string based on the selected at least one first instruction; selecting a second object from the plurality of objects in the data model;

selecting at least one second instruction based, at least in part, on a type of the second object;

selecting a second template string based on the selected at least one second instruction;

using a script generator to automatically, and without user input, sort and concatenate the first and second template strings from the selected objects, the script generator automatically sorting and concatenating the first and second template strings in an order identified by the first and second instructions and based on the types of the first and second objects; and

using one or more processors to automatically generate at least a portion of the SQL script based on the sorted and concatenated first and second template strings of the order identified by the first and second instructions.

2. The method of claim 1 , one or more of the plurality of objects comprising a user-defined object.

3. The method of claim 1 further comprising selecting the data model from a plurality of data models.

4. The method of claim 1 further comprising:

determining the existence of one or more macros in a selected template string of the selected template strings; and

in response, at least in part, to locating one or more macros in the selected template string, processing the located one or more macros.

5. The method of claim 4 further comprising expanding the template string associated with the one or more macros based on a result from each macro processing and wherein generating the SQL script is further based on the expanded template string.

6. The method of claim 4 , each macro selected from the group comprising:

determining a value of an environment variable;

determining a value of a property associated with the data model;

determining a value of a property associated with the selected object;

evaluating a conditional expression; and

iterating over a subset of the plurality of objects, the subset associated with the selected object.

7. The method of claim 1 , wherein each instruction comprising a template string identifier and a bucket identifier and the method further comprises sorting the concatenated template strings based on the bucket identifier of each associated instruction.

8. The method of claim 1 further comprising dynamically adding user comments to the SQL script based on at least one of the selected template strings.

9. The method of claim 1 , wherein selecting the associated template string comprises selecting the associated template string based on the type of the selected object associated with each selected instruction.

10. The method of claim 1 , wherein selecting the at least one instruction based, at least in part, on the type of the selected object comprises:

accessing a type instruction table; and

selecting the at least one instruction from the type instruction table, based at least in part, on the type of the selected object.

11. Software for generating a structured query language (SQL) script based on a template, the software embodied in a memory for storing software and operable when executed by a computer to:

select one object from a plurality of objects in a data model;

automatically select, without user input, at least one first instruction based, at least in part, on a type of the selected object;

select a first template string based on the selected at least one first instruction;

select a second object from the plurality of objects in the data model;

select at least one second instruction based, at least in part, on a type of the second object;

select a second template string based on the selected at least one second instruction;

automatically, and without user input, sorting and concatenating the template strings from the selected objects in an order identified by the first and second instructions and based on the types of the first and second objects;

automatically generate at least a portion of the SQL script based on the sorted and concatenated first and second template strings in the order identified by the first and second instructions.

12. The software of claim 11 , one or more of the plurality of objects comprising a user-defined object.

13. The software of claim 11 further operable to select the data model from a plurality of data models.

14. The software of claim 11 further operable to:

determine the existence of one or more macros in a selected template string of the selected template strings; and

in response, at least in part, to locating one or more macros in the selected template string, process the located one or more macros.

15. The software of claim 14 further operable to expand the template string associated with the one or more macros based on a result from each macro processing and wherein generating the SQL script is further based on the expanded template string.

16. The software of claim 14 , each macro selected from the group comprising:

determining a value of an environment variable;

determining a value of a property associated with the data model;

determining a value of a property associated with the selected object;

evaluating a conditional expression; and

iterating over a subset of the plurality of objects, the subset associated with the selected object.

17. The software of claim 11 , each instruction comprising a template string identifier and a bucket identifier and the software further operable to sort the concatenated template strings based on the bucket identifier of each associated instruction.

18. The software of claim 11 further operable to dynamically add user comments to the SQL script based on at least one of the selected template strings.

19. A system for generating a structured query language (SQL) script based on a template, the system comprises:

memory operable to store a data model, a plurality of instructions, and a plurality of template strings and the data model comprising a plurality of objects; and

one or more processors operable to:

select one object from the plurality of objects in the data model;

automatically select, without user input, at least one first instruction based, at least in part, on a type of the selected object;

select a first template string based on the selected at least one first instruction;

select a second object from the plurality of objects in the data model;

select at least one second instruction based, at least in part, on a type of the second object;

select a second template string based on the selected at least one second instruction;

automatically, and without user input, sort and concatenate the template strings from the selected objects in an order identified by the first and second instructions and based on the types of the first and second objects; and

automatically generate at least a portion of the SQL script based on the sorted and concatenated first and second template strings in the order identified by the first and second instructions.

20. The system of claim 19 , one or more of the plurality of objects comprising a user-defined object.

21. The system of claim 19 , the one or more processors further operable to select the data model from a plurality of data models.

22. The system of claim 19 , the one or more processors further operable to:

determine the existence of one or more macros in a selected template string of the selected template strings;

and in response, at least in part, to locating one or more macros in the selected template string, process the located one or more macros.

23. The system of claim 22 , the one or more processors further operable to expand the template string associated with the one or more macros based on a result from each macro processing and wherein generating the SQL script is further based on the expanded template strings.

24. The system of claim 22 , each macro selected from the group comprising:

determining a value of an environment variable;

determining a value of a property associated with the data model;

determining a value of a property associated with the selected object;

evaluating a conditional expression; and

iterating over a subset of the plurality of objects, the subset associated with the selected object.

25. The system of claim 19 , each instruction comprising a template string identifier and a bucket identifier and the one more processors further operable to sort the concatenated template strings based on the bucket identifier of each associated instruction.

26. The system of claim 19 , the one or more processors further operable to dynamically add user comments to the SQL script based on at least one of the selected template strings.

27. A system for generating a structured query language (SQL) script based on a template, the system comprises:

means for selecting one object from a plurality of objects in a data model;

means for automatically selecting, without user input, at least one first instruction based, at least in part, on a type of the selected object;

means for selecting a first template string based on the selected at least one first instruction;

means for selecting a second object from the plurality of objects in the data model;

means for selecting at least one second instruction based, at least in part, on a type of the second object;

means for selecting a second template string based on the selected at least one second instruction;

means for automatically, and without user input, sorting and concatenating the template strings from the selected objects in an order identified by the first and second instructions and based on the types of the first and second objects; and

means for using one or more processors to automatically generate at least a portion of the SQL script based on the sorted and concatenated first and second template strings in the order identified by the first and second instructions.

Assignments (7)
RELEASE OF SECURITY INTEREST Recorded Dec 31, 2020
From: WELLS FARGO BANK, NATIONAL ASSOCIATION, AS AGENT
To: ERWIN HOLDINGS, LLC, FORMERLY KNOWN AS PCF 4, LLC; ERWIN, INC., FORMERLY KNOWN AS PCF NUMBER 4, INC.; ANALYTIX DATA SERVICES INC.
Reel/Frame 054787/0168 →
RELEASE OF SECURITY INTEREST Recorded Dec 31, 2020
From: SARATOGA INVESTMENT CORP. SBIC LP, AS AGENT
To: ERWIN HOLDINGS, LLC, FORMERLY KNOWN AS PCF 4, LLC; ERWIN, INC., FORMERLY KNOWN AS PCF NUMBER 4, INC.; ANALYTIX DATA SERVICES INC.
Reel/Frame 054787/0119 →
PATENT SECURITY AGREEMENT Recorded Mar 28, 2016
From: PCF 4, LLC; PCF NUMBER 4, INC.
To: WELLS FARGO BANK, NATIONAL ASSOCIATION
Reel/Frame 038275/0220 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 4, 2016
From: CA, INC.
To: PCF NUMBER 4, INC.
Reel/Frame 037899/0189 →
PATENT SECURITY AGREEMENT Recorded Mar 1, 2016
From: PCF 4, LLC; PCF NUMBER 4, INC.
To: SARATOGA INVESTMENT CORP. SBIC LP
Reel/Frame 037969/0105 →
MERGER Recorded Jan 2, 2014
From: COMPUTER ASSOCIATES THINK, INC.
To: CA, INC.
Reel/Frame 031880/0123 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 7, 2005
From: DEFFLER, TAD A.
To: COMPUTER ASSOCIATES THINK, INC.
Reel/Frame 016243/0977 →