Focal Point
[CLOSED]How to call a query present in a fex from html/javascript...

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3527076376

November 24, 2014, 06:15 AM
info4pal
[CLOSED]How to call a query present in a fex from html/javascript...
Hi,

I have a textbox wherein multiple Id's of 4 digits can be entered separated by commas and I can enter emp id and emp id or mgr id and mgr id at any point in time and should throw an error if I enter an emp id and a mgr id at the same time.
Iam using this query below and if the count is greater than 1, then I need to show an alert message saying that it is an invalid entry.

ENGINE oracle SET DEFAULT_CONNECTION instance1
SQL SQLORA PREPARE SQLOUT FOR
select COUNT(distinct(title)) from (select distinct title,type from table1
where id in ('ABCD','BCD1','CDE1')and title is not null );
END

Could anyone please let me know how can I connect the html/javascript to hit this query and throw an alert message as soon as they enter the emp id and the mgr id's.

This is really urgent and please help me on this.

Regards!

This message has been edited. Last edited by: info4pal,
November 24, 2014, 08:16 AM
MattC
I would recommend coming up with a different design. I would advise against implementing a SQL request inside of javascript as that is not secure and anyone could read that and get connection information.


WebFOCUS 8.1.05
November 24, 2014, 08:44 AM
info4pal
Hi,


Thanks for the quick response MattC.
Actually Iam not trying to implement the sql query inside the javascript but am having the sql query inside the fex file and if the count is greater than 1,then I need to throw an alert message saying that it is invalid.

I need some help on how do i connect the textbox in javascript to hit this query and once if the count is greater than 1 ,then it should again go back to the html page and pop up an alert message window.

Please help me on this.

Thanks!
November 24, 2014, 08:53 AM
njsden
You may need to look into JavaScript's AJAX to implement an asynchronous call to the .fex that performs the validation, and once the request is done you'll use JavaScript to parse the XML result of your query. Just make sure your .fex returns results in XML (check documentation for ON TABLE PCHOLD FORMAT XML).

On a different note, I've noticed that many of your recent requests are of a "Very urgent" nature. Focal Pointers are very helpful, open to share their experience and regularly go to great extents to illustrate approaches and techniques (I've learnt lots from them) but as with many other forums' supporters, are not in the business of solving someone else's "Very urgent" needs as they have their own to deal with. I would advise you to get in touch with IBI Tech Support in order to get the kind of priority help you need in situations like these.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
November 24, 2014, 08:58 AM
njsden
Take a look at the technique Rifaz recently shared here: [SHARING] Those who interested AJAX and WebFOCUS.

It may give you some very good hints at solving your need.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
November 25, 2014, 06:28 AM
info4pal
Hi,

Thanks a lot njsden for the inputs.
Sure I will try reaching to IBI tech support for any urgent issues moving forward.

Regards!