Skip to Content
author's profile photo Former Member
Former Member

Sending Query to query template


is it possible to send query from Html page to query template. for example, i create query template as IDBC server and in fixed query mode without giving any query. just blank. in page generator i mapped with iCommand. Now i want to send query from javascript by using getQueryObject. how to send it?


Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 29, 2007 at 03:32 PM

    You will be able to dynamically pass the entire SQL to the query template from the HTML page. Just have the [Param.1] in the FixedQuery and use setParam(1,'Your SQL Query') with the QueryObject.

    var qObj=document.<<appletname>>.getQueryObject();

    qObj.setParam(1,'select * from table');

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 29, 2007 at 03:20 PM

    If you can't GET it then SET it.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 29, 2007 at 07:27 PM


    As John indicated, using the built-in query parameter [Param.x] allows you to be very dynamic in your approach, but document.APPLET.getQueryObject().setQuery('SELECT....'); would be the same thing if you just wanted to pass in the whole fixed query statement.

    I may be getting ahead of things, but I can't help but think you are heading down a bad development path by burying all of your queries in the client side script. You can use iCommand applets as recordset objects, but they will always be client sided, not server sided like ado recordsets in asp. I've seen far too many system integrator botched applications where the the body onload was used to trigger javascript that attempts to force queries into applets when they have not been initialized by the JRE. By nature Query Templates themselves can be filled with [Param.x]'s but trying to develop large amounts of application content where the select statements are assembled in client side javascript can lead to all sorts of supportability issues for the customer. Imagine a customer going to training, and understanding the basics of query templates, and then trying to reverse engineer your page with one query template called "SQLGeneric" and all of the logic buried in javascript. He/she opens the template and all they find is a FixedQuery with [Param.1] - can you envision their confusion? Then they look at the 1000 - 2000 lines of javascript that I've seen at times?

    Can you provide the business case as to why you would not create a simpler query template minded approach, or would want to construct the queries this way?



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi senthil,

      1.if there are no conditions in your query then you can pass the table name as parameter. in that case the query will be:

      select * from [Param.1] .

      then from javascript u can pass ur table name which is selected from the dropdown as param to this query.



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.