Ah, I see that I am confusing terminology... Embeded sql:
http://docs.intersystems.com/cache20101/csp/docbook/DocBook.UI.Page.cls?KEY=GSQL_esql
Sorry for my confusion.
See my inline replies below.
On Wed, Mar 30, 2011 at 1:43 PM, Roberto <rcah...@gmail.com> wrote:
> Dynamic SQL is sql that you generate during run time, it is created in
> your code through some resultset. Both your examples are dynamic sql.
Thanks for that clarification. I had a feeling I was getting it wrong. :D
What does the "%DynamicQuery:SQL" argument do? Is there any difference
when that is specified?
> You generally have a Prepare and Execute statement to get your dynamic
> results like the following:
> Set rs=##class(%ResultSet).%New() ; I'm using the %ResultSet class,
> Intersystems recommend using the %SQL.Statement which is faster
Ah, good info! I tried using ##class(%SQL.Statement).%New() via a CSP
method, but I got this error:
Error: <CLASS DOES NOT EXIST>zrundate+1^csp.web.demos.dates.1 *%SQL.Statement
I am guessing that my syntax is bad or %SQL.Statement is not available
to use in 2009.1.5 of Caché.
I will keep experimenting. Thanks for pointing me in the right direction! :)
> ...<snip>...
> Embedded SQL is SQL that you define using &sql. The sql is already
> compiled so it is optimized. I have used it to get single values using
> the INTO clause. For example:
> ...<snip>...
> Embedded SQL is usually used for simple sql statements.
Ahhh, interesting! I think I understand the difference now. Thanks so much!
> Read up the docs for both. There's plenty of material in the docs.
Will do! Thanks for the examples and info, I greatly appreciate it. :)
Have an awesome day!
Cheers,
Micky
Whoa!!! You Rock!!!
Thanks for all the examples and explanations Roberto!!!! That is
great! Very helpful!
Bookmarking this thread for future reference.
I owe you one. :)
--
InterSystems: Advanced software technologies for breakthrough applications
Global Summit: March 20 - 23, 2011, Hilton Orlando Bonnet Creek
Caché 2010.2.3 released on March 1, 2010
WOW! Thank you!!!
Very helpful... Hopefully one of these days I can pay you back. :)
Have a great day.
Cheers,
Micky