Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     How can I pass a data more than 5000 character acrross FEX?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
How can I pass a data more than 5000 character acrross FEX?
 Login/Join
 
Gold member
posted
Hi All,

I have a data is of LONG/CLOB type in my database and I need to pass this to a database table by a button click. I am attaching my code for better understanding.

Code in my testareapass.fex(Calling form)
----------------------------
Note :- I have changed the < to } inorder to avoid the creation of the objects in this editor


TABLE FILE WFTST_LONG
PRINT
TST_CLOB
WHERE ID=1
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
-HTMLFORM BEGIN
-{html}
-{head}
-{title}Insert FTM file in Select{/title}
-{/head}
-{body}
-{form name=form action=WFServlet target=_blank}
-{input type=hidden name=IBIF_ex value=postdata.fex}
-{span style="position:absolute; top:180; left:10;"}Textarea{/span}
-{textarea name=sqlqryta style="position:absolute; top:180; left:200;" rows="10" cols="72" value=" "}
-INCLUDE HOLD1.ftm
-{/textarea}
-{INPUT onclick="do_escape[);" style="POSITION: absolute; TOP: 470px; LEFT: 160px; WIDTH:
80px; HEIGHT: 30px;" type="button" value=Submit}
-{/form}
-{script language=javascript}
-function do_escape() {
- TXobj = document.getElementById("sqlqryta");
- TXobj.value = escape(TXobj.value);
- document.form.submit();
- TXobj.value = unescape(TXobj.value);
-}
-{/script}
-{/body}
-{/html}
-HTMLFORM END

Please note that , I am directly assigning the HOLD.ftm as the value for the textarea.

code in by postdata.fex
-------------------------
-TYPE sqlqryta &sqlqryta
-EXIT
ENGINE SQLORA SET DEFAULT_CONNECTION myconn
SQL SQLORA
EX wfpackage1.p_tst_long_clob '&sqlqryta';
END

(I have commented the package call to see whether values are coming to the FEX)

Here I am able to pass upto 4700 characters (including the escaped ones lke %20). If I exceed this i will get an error as
Unknown error occurred.
ERROR:

I need to pass atleast 10000 characters to the postdata.fex and save to the database table

Or

Can I call the oracle package from the the
testareapass.fex button on click (From Javascript)?

Any suggestions ?

Thanks and regards,
Johney.


Version 7.6.11
Webfocus installed in AIX 5.3,
desktop PC: Windows-XP based
Output: Excel, HTML, PDF
 
Posts: 83 | Registered: October 19, 2007Report This Post
Virtuoso
posted Hide Post
Johney,
You can put your code into the tags [ code ] and [/code ]. It is the red right most icon of the entry box. It will then look like this:
-HTMLFORM BEGIN
<html>
<head>
<title>Insert FTM file in Select</title>
</head>
<body>
<form name=form action=WFServlet target=_blank method=post>
<input type=hidden name=IBIAPP_app value=gerard>
<input type=hidden name=IBIF_ex value=postdata.fex>
<span style="position:absolute; top:180; left:10;">Textarea</span>
<textarea name=sqlqryta style="position:absolute; top:180; left:200;" rows="10" cols="72" value=" ">
-INCLUDE HOLD1.ftm
</textarea>
<INPUT onclick="do_escape();" style="POSITION: absolute; TOP: 470px; LEFT: 160px; WIDTH:
80px; HEIGHT: 30px;" type="button" value=Submit>
</form>
<script language=javascript>
function do_escape() {
 TXobj = document.getElementById("sqlqryta");
 TXobj.value = escape(TXobj.value);
 document.form.submit();
 TXobj.value = unescape(TXobj.value);
}
</script>
</body>
</html>
-HTMLFORM END

This code by the way will work for the maximum length of an &variable, which is 32KB. The trick is in the METHOD=POST within the form declaration.
You did not put anything there, which then will default to METHOD=GET. This will create a URL with all text in it, and is limited in length. METHOD=POST does not have this limitation.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Gold member
posted Hide Post
Thanks GamP for converting my code with actual syntax,

So there are no tricks to pass more than 32KB? How can I understand that 4700 character is crossing 32KB. My requirement is to pass atleast 10000 characters including escape characters.

Is there any way that we can call the oracle precedure from the button click event? If that is possible we need not pass this to a second fex to call a oracle package. Any idea ?

Thanks and regards,
Johney.


Version 7.6.11
Webfocus installed in AIX 5.3,
desktop PC: Windows-XP based
Output: Excel, HTML, PDF
 
Posts: 83 | Registered: October 19, 2007Report This Post
Expert
posted Hide Post
Did you try adding method=post to your form tag as GamP suggested? That ought do it.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
Yes Francis,

I have selected "post" method only.I am clueless about what is happening .

Thanks and regards,
Johney.

This message has been edited. Last edited by: johney,


Version 7.6.11
Webfocus installed in AIX 5.3,
desktop PC: Windows-XP based
Output: Excel, HTML, PDF
 
Posts: 83 | Registered: October 19, 2007Report This Post
Virtuoso
posted Hide Post
Passing a textarea is always tricky. Can you post the code of your postdata.fex? I've used the IBIF_adhocfex in the past for posting large textarea values, but you will need to include your code in the textarea. Something like:

<textarea name="IBIF_adhocfex">
MODIFY FILE X
FREEFORM Y/TX80
COMPUTE SOMEKEY=SOMEVALUE;
MATCH SOMEKEY
ON NOMATCH INCLUDE
DATA
Some really frikin huge amount of data .... <== this is where your file would go.
%,$
END
</textarea>  


Or something like that ... I'm going off memory for this one.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Gold member
posted Hide Post
Hi dhagen ,

I have just a TYPE command in the postdata.fex as,

-TYPE sqlqryta &sqlqryta

This is giving me error if the no.of characters passes from the calling FEX is greater than 4700 even in "method=post"

Are you suggesting me to change the name of textarea as IBIF_adhocfex and include the MODIFY FILE etc inside the textare ? Do you have code snippet which will work ?

Thanks and regards,
Johney.


Version 7.6.11
Webfocus installed in AIX 5.3,
desktop PC: Windows-XP based
Output: Excel, HTML, PDF
 
Posts: 83 | Registered: October 19, 2007Report This Post
Virtuoso
posted Hide Post
I did the following test with 16K+ characters without an error.

Master
FILENAME=sometable, SUFFIX=XFOCUS  ,
 DATASET=baseapp/sometable.foc, $
  SEGMENT=SOMETABLE, SEGTYPE=S1, $
    FIELDNAME=KN, ALIAS=KN, USAGE=A3, ACTUAL=A3, $
    FIELDNAME=TA, ALIAS=TA, USAGE=TX80, ACTUAL=TX80, $  


Html:
  
<html>
     <head>
          <script type="text/javascript">

          function sendThis(obj) {
               var tempTextarea = obj.IBIF_adhocfex.value;
               obj.IBIF_adhocfex.value = "-SET &ECHO=ALL;\n" + 
                                          "MODIFY FILE SOMETABLE\n" + 
                                          "FREEFORM KN TA\n" + 
                                          "MATCH KN\n" +
                                          "ON NOMATCH INCLUDE\n" +
                                          "DATA\n" +
                                          tempTextarea + "\n%$\n" +
                                          "END\n" + 
                                          "-RUN\n" +
                                          "TABLE FILE SOMETABLE\n" +  
                                          "PRINT TA BY KN\n" + 
                                          "END\n" +
                                          "-RUN"
              obj.submit();
          }

          </script>
     </head>
     <body>
          <h2>Test Textarea</h2>
          <form id="f1" action="/ibi_apps/WFServlet" method="post">
               <textarea id="ta1" name="IBIF_adhocfex" cols="100" rows="40"></textarea>
               <input id="hd1" type="hidden" value="baseapp" name="IBIAPP_app" />
               <input id="pb1" type="button" value="Try Me!" onClick="sendThis(this.form);" />
          </form>
     </body>
</html>


Note: to test, enter a key value followed by a comma in the textarea before entering the large amount of data ... this is just to test afterall!
Hope this helps.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     How can I pass a data more than 5000 character acrross FEX?

Copyright © 1996-2020 Information Builders