Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Component Sharing
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gagandeep Singh Bhatia
Component Sharing
Commits
f1864c2c
Commit
f1864c2c
authored
Jun 05, 2026
by
Ajit Deshmukh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated the logic to append the placeholder ( {SCHEMA} ) before the trigger name.
parent
5d7b3f8d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
14 deletions
+24
-14
Ajit/Manage SQL Changes APR-26/Java Components/ManageSqlConf.java
...age SQL Changes APR-26/Java Components/ManageSqlConf.java
+24
-14
No files found.
Ajit/Manage SQL Changes APR-26/Java Components/ManageSqlConf.java
View file @
f1864c2c
...
@@ -272,7 +272,7 @@ public class ManageSqlConf extends ActionHandlerEJB {
...
@@ -272,7 +272,7 @@ public class ManageSqlConf extends ActionHandlerEJB {
String
confirmedFlag
=
checkNull
(
rs
.
getString
(
"CONFIRMED"
));
String
confirmedFlag
=
checkNull
(
rs
.
getString
(
"CONFIRMED"
));
String
depTranId
=
checkNull
(
rs
.
getString
(
"TRAN_ID"
));
String
depTranId
=
checkNull
(
rs
.
getString
(
"TRAN_ID"
));
// If any dependent (D or Q) is not confirmed
→
block confirmation
// If any dependent (D or Q) is not confirmed
�
block confirmation
if
(!
"Y"
.
equalsIgnoreCase
(
confirmedFlag
))
{
if
(!
"Y"
.
equalsIgnoreCase
(
confirmedFlag
))
{
unconfirmedFound
=
true
;
unconfirmedFound
=
true
;
pendingTranId
=
depTranId
;
pendingTranId
=
depTranId
;
...
@@ -318,7 +318,7 @@ public class ManageSqlConf extends ActionHandlerEJB {
...
@@ -318,7 +318,7 @@ public class ManageSqlConf extends ActionHandlerEJB {
// Added the code to fetch the Executive Approval value for Main transaction on
// Added the code to fetch the Executive Approval value for Main transaction on
// 21-APR[END]
// 21-APR[END]
// No dependent D/Q records found
→
workflow not yet approved
// No dependent D/Q records found
�
workflow not yet approved
// Added the condition if executive approval value is "Y" then only check the
// Added the condition if executive approval value is "Y" then only check the
// workflow weather approved or not 21-APRIL
// workflow weather approved or not 21-APRIL
...
@@ -331,7 +331,7 @@ public class ManageSqlConf extends ActionHandlerEJB {
...
@@ -331,7 +331,7 @@ public class ManageSqlConf extends ActionHandlerEJB {
}
}
// Dependent D or Q exists but NOT confirmed
→
return error
// Dependent D or Q exists but NOT confirmed
�
return error
if
(
unconfirmedFound
)
{
if
(
unconfirmedFound
)
{
System
.
out
.
println
(
System
.
out
.
println
(
"Cannot confirm. Dependent transaction ["
+
pendingTranId
+
"] is not yet confirmed."
);
"Cannot confirm. Dependent transaction ["
+
pendingTranId
+
"] is not yet confirmed."
);
...
@@ -688,7 +688,7 @@ public class ManageSqlConf extends ActionHandlerEJB {
...
@@ -688,7 +688,7 @@ public class ManageSqlConf extends ActionHandlerEJB {
* enterpriseArr = enterpriseArrayList.get(0).split(",");
* enterpriseArr = enterpriseArrayList.get(0).split(",");
* }else if(applDB.equalsIgnoreCase("E")){
* }else if(applDB.equalsIgnoreCase("E")){
*
*
* // Values are NOT comma-separated
→
copy list directly
* // Values are NOT comma-separated
�
copy list directly
* enterpriseArr = enterpriseArrayList.toArray(new String[0]);
* enterpriseArr = enterpriseArrayList.toArray(new String[0]);
* }
* }
*/
*/
...
@@ -704,7 +704,7 @@ public class ManageSqlConf extends ActionHandlerEJB {
...
@@ -704,7 +704,7 @@ public class ManageSqlConf extends ActionHandlerEJB {
Savepoint
entSavepoint
=
null
;
Savepoint
entSavepoint
=
null
;
try
{
try
{
//
✅
ENTERPRISE-LEVEL SAVEPOINT
//
ENTERPRISE-LEVEL SAVEPOINT
entSavepoint
=
con
.
setSavepoint
(
"SP_"
+
ent
);
entSavepoint
=
con
.
setSavepoint
(
"SP_"
+
ent
);
processSqlForEnterprise
(
processSqlForEnterprise
(
...
@@ -717,12 +717,12 @@ public class ManageSqlConf extends ActionHandlerEJB {
...
@@ -717,12 +717,12 @@ public class ManageSqlConf extends ActionHandlerEJB {
userId
,
userId
,
chgTerm
);
chgTerm
);
//
✅
commit enterprise success
//
commit enterprise success
con
.
commit
();
con
.
commit
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
//
❌
rollback ONLY this enterprise
//
L
rollback ONLY this enterprise
if
(
entSavepoint
!=
null
)
{
if
(
entSavepoint
!=
null
)
{
con
.
rollback
(
entSavepoint
);
con
.
rollback
(
entSavepoint
);
}
}
...
@@ -2306,12 +2306,12 @@ public class ManageSqlConf extends ActionHandlerEJB {
...
@@ -2306,12 +2306,12 @@ public class ManageSqlConf extends ActionHandlerEJB {
"(?i)CREATE\\s+OR\\s+REPLACE\\s+VIEW\\s+(?!\\{SCHEMA\\}|[A-Z0-9_]+\\.)"
,
"(?i)CREATE\\s+OR\\s+REPLACE\\s+VIEW\\s+(?!\\{SCHEMA\\}|[A-Z0-9_]+\\.)"
,
"CREATE OR REPLACE VIEW {SCHEMA}."
);
"CREATE OR REPLACE VIEW {SCHEMA}."
);
// 1
️⃣
PACKAGE BODY (FIRST)
// 1
�
PACKAGE BODY (FIRST)
s
=
s
.
replaceAll
(
s
=
s
.
replaceAll
(
"(?i)CREATE\\s+OR\\s+REPLACE\\s+PACKAGE\\s+BODY\\s+(?![A-Z0-9_]+\\.)"
,
"(?i)CREATE\\s+OR\\s+REPLACE\\s+PACKAGE\\s+BODY\\s+(?![A-Z0-9_]+\\.)"
,
"CREATE OR REPLACE PACKAGE BODY {SCHEMA}."
);
"CREATE OR REPLACE PACKAGE BODY {SCHEMA}."
);
// 2
️⃣
PACKAGE (EXCLUDE BODY)
// 2
�
PACKAGE (EXCLUDE BODY)
s
=
s
.
replaceAll
(
s
=
s
.
replaceAll
(
"(?i)CREATE\\s+OR\\s+REPLACE\\s+PACKAGE\\s+(?!BODY\\s+)(?![A-Z0-9_]+\\.)"
,
"(?i)CREATE\\s+OR\\s+REPLACE\\s+PACKAGE\\s+(?!BODY\\s+)(?![A-Z0-9_]+\\.)"
,
"CREATE OR REPLACE PACKAGE {SCHEMA}."
);
"CREATE OR REPLACE PACKAGE {SCHEMA}."
);
...
@@ -2319,9 +2319,19 @@ public class ManageSqlConf extends ActionHandlerEJB {
...
@@ -2319,9 +2319,19 @@ public class ManageSqlConf extends ActionHandlerEJB {
// TRIGGER: ON table
// TRIGGER: ON table
// FIX IS HERE: Added \\b before ON
// FIX IS HERE: Added \\b before ON
// This prevents matching "actiON", "positiON", "unicON", etc.
// This prevents matching "actiON", "positiON", "unicON", etc.
s
=
s
.
replaceAll
(
//Updated the logic to appent the placeholder ( {SCHEMA} ) before the trigger name.
"(?i)\\bON\\s+(?!\\{SCHEMA\\}|[A-Z0-9_]+\\.)"
,
String
upper
=
s
.
toUpperCase
();
"ON {SCHEMA}."
);
if
(
upper
.
startsWith
(
"TRIGGER "
)
||
upper
.
startsWith
(
"CREATE TRIGGER "
)
||
upper
.
startsWith
(
"CREATE OR REPLACE TRIGGER "
))
{
s
=
s
.
replaceFirst
(
"(?i)^(CREATE\\s+OR\\s+REPLACE\\s+TRIGGER|CREATE\\s+TRIGGER|TRIGGER)\\s+"
,
"$1 {SCHEMA}."
);
return
s
;
}
// INSERT INTO table
// INSERT INTO table
// Added \\b before INSERT
// Added \\b before INSERT
...
@@ -2398,7 +2408,7 @@ public class ManageSqlConf extends ActionHandlerEJB {
...
@@ -2398,7 +2408,7 @@ public class ManageSqlConf extends ActionHandlerEJB {
String
s
=
sql
.
trim
().
toUpperCase
();
String
s
=
sql
.
trim
().
toUpperCase
();
//
🔴
Normalize CREATE OR REPLACE
//
=4
Normalize CREATE OR REPLACE
if
(
s
.
startsWith
(
"CREATE OR REPLACE"
))
{
if
(
s
.
startsWith
(
"CREATE OR REPLACE"
))
{
s
=
s
.
replaceFirst
(
"CREATE\\s+OR\\s+REPLACE\\s+"
,
"CREATE "
);
s
=
s
.
replaceFirst
(
"CREATE\\s+OR\\s+REPLACE\\s+"
,
"CREATE "
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment