-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dumbfounded by a simple query, perhaps due to a simple subquery #74
Comments
Have you tried requests with both standard and json params, and was there any difference? |
I tried with JSON Params only, but once with the positional params: {YADA_1: -1, YADA_2: 144468} So, it parses well enough to replace the 2 ?n params into two ? ... but then ... forgets one. |
I tried an update on inner join - but Oracle seems too slow when I tried, so I just forgot the PERSON_ID parameter, because I'm working back-end where person_id is always -1. I'll pass along the update inner join |
Oracle has this: UPDATE (select a.is_active, p.emp521 More standard SQL could probably do: UPDATE country_site_person This is a poor-man's join -- just to prevent a subquery for Yada to make it work. |
REMINDER: I believe resolution for Issue #69 would probably solve this kind of issues. |
about to add a new comment to #69 -- hopefully you'll chime in ... |
Hello,
the relatively simply query below fails. I have no idea why.
This works in SQL:
update COUNTRY_SITE_PERSON
SET mod_time = systimestamp, is_active=0, mod_emp521 = (select emp521 from person where person_id=-1)
WHERE country_site_person_id = 144468 and is_active=1
but during a batch:
{ Status: 500,
Help: 'https://github.com/Novartis/YADA#other',
Message: 'Index: 1, Size: 1',
Query: 'update COUNTRY_SITE_PERSON\nSET mod_time = systimestamp, is_active=0, mod_emp521 = (select emp521 from person where person_id=?n)\nWHERE country_site_person_id = ?n and is_active=1',
StackTrace:
[ 'java.lang.IndexOutOfBoundsException: Index: 1, Size: 1',
'at java.util.ArrayList.rangeCheck(ArrayList.java:653)',
'at java.util.ArrayList.get(ArrayList.java:429)',
'at com.novartis.opensource.yada.adaptor.JDBCAdaptor.execute(JDBCAdaptor.java:457)',
'at com.novartis.opensource.yada.Service._execute(Service.java:730)',
'at com.novartis.opensource.yada.Service.execute(Service.java:596)',
'at org.apache.jsp.yada_jsp._jspService(yada_jsp.java:222)',
'at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)',
...
...
StatusText: 'Internal Server Error',
Params:
[ { PERSON_ID: '[-1]', COUNTRY_SITE_PERSON_ID: '[144468]' },
{ PERSON_ID: '[-1]', COUNTRY_SITE_PERSON_ID: '[144469]' },
{ PERSON_ID: '[-1]', COUNTRY_SITE_PERSON_ID: '[144458]' },
{ PERSON_ID: '[-1]', COUNTRY_SITE_PERSON_ID: '[144459]' },
{ PERSON_ID: '[-1]', COUNTRY_SITE_PERSON_ID: '[144460]' },
{ PERSON_ID: '[-1]', COUNTRY_SITE_PERSON_ID: '[144461]' },
{ PERSON_ID: '[-1]', COUNTRY_SITE_PERSON_ID: '[144720]' },
{ PERSON_ID: '[-1]', COUNTRY_SITE_PERSON_ID: '[144467]' },
{ PERSON_ID: '[-1]', COUNTRY_SITE_PERSON_ID: '[144464]' },
{ PERSON_ID: '[-1]', COUNTRY_SITE_PERSON_ID: '[144465]' },
{ PERSON_ID: '[-1]', COUNTRY_SITE_PERSON_ID: '[144466]' } ],
Source: 'https://github.com/Novartis/YADA',
Exception: 'java.lang.IndexOutOfBoundsException',
Type: 'POST',
Qname: 'DSMT remove person site assignment',
It seems Yada doesn't see the 2nd parameter (person_id) in the sub-query
INSERT/UPDATE/DELETE statement to execute:
update COUNTRY_SITE_PERSON
SET mod_time = systimestamp, is_active=0, mod_emp521 = (select emp521 from person where person_id=?)
WHERE country_site_person_id = ? and is_active=1
2018-04-14 08:40:23,182 ajp-nio-8010-exec-1 DEBUG (QueryUtils.setPositionalParameterValues:1010) Column [1: country_site_person_id] has value [144468]
2018-04-14 08:40:23,182 ajp-nio-8010-exec-1 DEBUG (QueryManager.prepQueryForExecution: 762)
INSERT/UPDATE/DELETE statement to execute:
update COUNTRY_SITE_PERSON
SET mod_time = systimestamp, is_active=0, mod_emp521 = (select emp521 from person where person_id=?)
WHERE country_site_person_id = ? and is_active=1
The text was updated successfully, but these errors were encountered: