upsert in c or jdbc for a partiioned table

100 views
Skip to first unread message

Dodong Juan

unread,
May 16, 2012, 12:37:09 PM5/16/12
to personal...@googlegroups.com
How do you do an upset (append new rows in partitioned table) ?

In the q command line I can do :

`:/db/2009.01.02/t/ upsert (09:33:00;`:/db/sym?`ibm; 103.)

How do I do this in c or jdbc ..?

Thanks

Fermin Reig

unread,
May 16, 2012, 4:15:13 PM5/16/12
to personal...@googlegroups.com
K r=k(handle,"functionname",params,(K)0);

See http://code.kx.com/wiki/Cookbook/InterfacingWithC

Dodong Juan

unread,
May 16, 2012, 4:26:07 PM5/16/12
to personal...@googlegroups.com
Sorry if I was not clear .. I was talking about the c class in java API. There are two drivers in Java JDBC and C .

More interested in c .. 

c c = new c ("host",5043);
Object[] x = (new Time.VaueOf("09:33:00"),"howcaniaddthissymbol", new Float(103.4));
c.ks(".u.upd","trade",x);



Paweł Tryfon

unread,
May 16, 2012, 4:41:13 PM5/16/12
to personal...@googlegroups.com
upsert is a dyadic function:

q)upsert
.[;();,;]

So just do
c.ks("upsert","trade",x);


2012/5/16 Dodong Juan <dodon...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "Kdb+ Personal Developers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/personal-kdbplus/-/uDQtEGAHxLAJ.
>
> To post to this group, send email to personal...@googlegroups.com.
> To unsubscribe from this group, send email to
> personal-kdbpl...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/personal-kdbplus?hl=en.

Dodong Juan

unread,
May 16, 2012, 6:35:53 PM5/16/12
to personal...@googlegroups.com
Thanks .. Will try this ..For inserts , does it really make a difference whether I am using the c or jdbc driver ..?



On Wednesday, May 16, 2012 12:37:09 PM UTC-4, Dodong Juan wrote:
Reply all
Reply to author
Forward
0 new messages