sorry for confusion Lukas,
Whole purpose of my POC is , convert all stored procedures ( which are
generated by a tool as flat files on the disk) to equalent java classes.
So that it would be easy to unit test and find out any discripencies while
compile time. i.e. respective objects are there or not , any syntax errors
there etc.
Lukas,
Me trying to achieve the temporary table impact using ResultSet records
as you suggested earlier.
But I have a small problem in one area.
Below are the details
The original proc is some thing like this
--------------------------------------------------------
CREATE TABLE #LEAF_TEMP
(
LEAF1_ID numeric(15, 0) NULL,
LEAF2_ID numeric(15, 0) NULL,
LEAF3_ID numeric(15, 0) NULL,
BOOK_ID numeric(7, 0) NOT NULL,
already_exists numeric(1,0) default 0 not null
)
insert into #LEAF_TEMP
(
LEAF1_ID,
LEAF2_ID,
LEAF3_ID,
BOOK_ID)
select
ld.leaf1_id,
ld.leaf2_id,,
ld.leaf3_id,
ld.book_id
from leaf_detail ld
where ld.is_first = 1
--------------------------
Now trying to write the equalent JOOQ code
something like the below
LeafDetail ld = LEAF_DETAIL.as("ld");
Result<Record4<Integer, Integer, Integer, Short>> RS_LEAF_TEMP =
ctx.select(ld.LEAF1_ID,ld.LEAF2_ID,ld.LEAF3_ID,ld.BOOK_ID)
.from(ld).where(ld.is_first.equal((byte) 1)).fetch();
---
But the problem is how to incorporate the missing field (already_exists
numeric(1,0) default 0 not null ) in the Result<R>
i,e. adding one more field to Record4 of Result.
any clue/suggestion how to go about it ?
Thank you.
~Shyam
On Monday, January 27, 2014 3:28:32 PM UTC+5:30, Lukas Eder wrote:
>
> Hi Shyam,
>
> I still don't understand the purpose of your POC to 100%. As I've
> mentioned on another thread, SQL Server local temporary tables (and scala
> variables) are very useful in a pure T-SQL context. I don't see how they
> could be that useful in a JDBC context, and as I've mentioned before, I
> don't even think it is possible to keep T-SQL temporary tables alive
> between subsequent JDBC calls...
>
> jOOQ supports all plain SQL (but not typesafe) DDL statements that are
> supported by the underlying JDBC driver. Ask yourself: How would you
> resolve this with JDBC?
>
> Cheers
> Lukas
>
>
> 2014-01-27 Sha <[email protected] <javascript:>>
>
>> Hi Lukas,
>> As part of my POC . For some of my stored procedures , I need to
>> create and store some valid rows in temporary tables to fasten the
>> execution.
>>
>> So me trying to do a sample of create a temporary table using JOOQ.
>>
>> But unfortunately it does not create a temp table.
>>
>> Below is the what I have done.
>>
>> DSLContext ctx = DSL.using(connection, SQLDialect.SQLSERVER2008);
>> // Use your favourite tool to construct SQL strings:
>> String sql = "CREATE TABLE #LocalTempTable( " +
>> " UserID int, " +
>> " UserName varchar(50), " +
>> " UserAddress varchar(150)) ";
>> int status = ctx.execute(sql);
>> System.out.println(" status : " + status);
>>
>> But unfortunately it does not work.
>> I read one of your previous replies in this group , stating that DDL
>> statement support is not there in JOOQ.
>>
>> Do we have any alternative approaches you think of handling these
>> scenarios? if so can you specify some.
>>
>> whole ideas is to make my stored procedure unit testable as part of my
>> java code.
>> Any suggestions and recommendations please.
>>
>> Thank you.
>> ~Shyam
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "jOOQ User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.