Module org.jooq
Package org.jooq

Interface SelectOptionStep<R extends Record>

    • Method Detail

      • option

        @Support
        SelectUnionStep<R> option​(String string)
        Add a SQL Server-style query hint to the select clause.

        Example:

         DSLContext create = DSL.using(configuration);
        
         create.select(field1, field2)
               .from(table1)
               .option("OPTION (OPTIMIZE FOR UNKNOWN)")
               .execute();
         

        You can also use this clause for any other database, that accepts hints or options at the same syntactic location, e.g. for DB2's isolation clause:

         create.select(field1, field2)
               .from(table1)
               .option("WITH RR USE AND KEEP EXCLUSIVE LOCKS")
               .execute();
         

        The outcome of such a query is this:

         SELECT field1, field2 FROM table1 [option]
         

        For SQL Server style table hints, see Table.with(String)

        See Also:
        Table.with(String), SelectQuery.addOption(String)