mariadb multi-statement with select throws org.jdbi.v3.core.result.NoResultsException: Statement returned no results [statement:

16 views
Skip to first unread message

Michael Conrad

unread,
May 21, 2021, 10:01:13 AM5/21/21
to jd...@googlegroups.com
Is this even possible? Or what do I need to change?

@SqlQuery( //
                 "set @issue_week_date = :issueWeekDate;\n" //
                + "set @issue_week_from = @issue_week_date - INTERVAL 3 MONTH;\n" //
                + "set @pid = :pid;\n" //
                + "\n" //
                + "set @uspto_title = null;\n" //
                + "select uspto_title into @uspto_title" //
                + " from test_scrapers.xml_uspto_patents" //
                + " where pid = @pid limit 1;\n" //
                + "\n" //
                + "select pid into @first_pid from xml_uspto_patents xup2\n" //
                + "    where uspto_title = @uspto_title\n" //
                + "    AND issuedate <= @issue_week_date\n" //
                + "    AND issuedate > @issue_week_date - INTERVAL 3 MONTH\n" //
                + "    order by issuedate asc, file asc, pid asc\n" //
                + "    limit 1;\n" //
                + "\n" //
                + "select pid from xml_uspto_patents xup where uspto_title = @uspto_title\n" //
                + "    AND pid != @first_pid\n" //
                + "    AND issuedate <= @issue_week_date\n" //
                + "    AND issuedate > @issue_week_date - INTERVAL 3 MONTH\n" //
                + "    order by pid asc;\n"
                )
        List<Long> duplicatePidsByTitle(@Define("table")UsptoTable table,
                @Bind("pid")Long pid,
                @Bind("issueWeekDate")LocalDate issuedate);


Reply all
Reply to author
Forward
0 new messages