2015.10.30 12:52 PM
2015.10.30 01:07 PM
2015.10.30 09:17 PM
2015.11.01 07:28 AM
It doesn’t sound like you’ll need it but another option is to write to a temp file:
q){hsym[`$f:"c:\\temp\\blah.q"] 0: enlist x; system"l ",f}"x:1\nx+1"
2
q)x
1
This approach will work if there are multi-line function definitions.
The main disadvantage is you can’t grab the final output, only see it on screen (but you see intermediate outputs too) unlike value.
From: personal-kdbplus@googlegroups.com [mailto:personal-kdbplus@googlegroups.com] On Behalf Of Jack Andrews
Sent: Friday, October 30, 2015 9:18 PM
To: Kdb+ Personal Developers
Subject: Re: [personal kdb+] run q-sql as string
parse and value do not work well with "\n". do your 'big ones' have "\n"?
eg.
q)value "x:1\nx+1"
'type
in this example:
q)last value each "\n"vs"x:1\nx+1"
2
On 31 October 2015 at 07:07, David Demner <david.demner@aquaq.co.uk> wrote:
value
value"1+1"
(works for a lot more than strings like value(+;1;1) works)
Original Message
From: analyst
Sent: Friday, October 30, 2015 12:52
To: Kdb+ Personal Developers
Reply To: personal-kdbplus@googlegroups.com
Subject: [personal kdb+] run q-sql as string
I want to run q-sql which is inputted as string to the program. ALL of them run fine in the console. I can use eval ( parse queryString) however the big ones dont parse fine and hence dont run. Is there a way to just run them without using eval/parse ?
--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbplus+unsubscribe@googlegroups.com.
To post to this group, send email to personal-kdbplus@googlegroups.com.
Visit this group at http://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbplus+unsubscribe@googlegroups.com.
To post to this group, send email to personal-kdbplus@googlegroups.com.
Visit this group at http://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbplus+unsubscribe@googlegroups.com.
To post to this group, send email to personal-kdbplus@googlegroups.com.
Visit this group at http://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/d/optout.
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.