Skip to main content



      Home
Home » Archived » EGL Development Tools » SQL parameters(How to specify parameters)
SQL parameters [message #774099] Tue, 03 January 2012 04:06 Go to next message
Eclipse UserFriend
I am developing for Power7 (iSeries) and have used EGL CE width success. For EDT I expected this to work:

function getG8(G8search string inOut, UserLogon string in, counter int in) returns(G8A[])
LIBFIL = "NOR.SECNREL0";
get G8Array from ds
with #sql{SELECT G8JWNB as G8JWNB FROM :LIBFIL where G8AUNA like :G8search};
return(G8Array);
end

but it seems like the ":" is not used to specify parameters anymore. I cannot find out how to do it. Probably I have to use "?" somehow, but how?
/Trond E. Nilsen

[Updated on: Tue, 03 January 2012 04:06] by Moderator

Re: SQL parameters [message #774767 is a reply to message #774099] Wed, 04 January 2012 09:59 Go to previous messageGo to next message
Eclipse UserFriend
As you have discovered, the :hostVariable syntax is not supported in EDT. You can use "?" in your SQL to identify parameters, but this does not work for the table name (as you may have discovered). This is a SQL limitation.

The following code demonstrates how you might accomplish what you are trying to do:
    ds SQLDataSource?{@resource {}};
    tableName String = "snippet";
    
    stmt SQLStatement?;
    prepare stmt from ds with "select * from " + tableName + " where id > ?";
    
    snippets Snippet[];
    get snippets from ds with stmt using id;

See the EGL Data Access spec for more details on Prepare and the other data access statements: https://bugs.eclipse.org/bugs/show_bug.cgi?id=355573
Re: SQL parameters [message #775130 is a reply to message #774767] Thu, 05 January 2012 06:48 Go to previous message
Eclipse UserFriend
Thanks Will, got it working now
Previous Topic:Extension Point Modeling Framework
Next Topic:EDT 0.8.0 Planning
Goto Forum:
  


Current Time: Wed Jul 23 16:41:30 EDT 2025

Powered by FUDForum. Page generated in 0.04023 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top