I am trying to save a value to a variable from the hold file. Below is the code which i used.
SQL SQLMSS
SELECT
ScreenField AS Group_1 from Table_Name
WHERE
Table_Field ='Val';
TABLE FILE SQLOUT
PRINT
Group_1
ON TABLE HOLD AS GRP1 FORMAT ALPHA
END
-RUN
-READ GRP1 &Group_1.A28.
-TYPE &Group_1
The query returns just one value. When i type the &Group_1 value i get the below output.
O/P : 000006Values
When i remove the FORMAT ALPHA (
ON TABLE HOLD AS GRP1
) i get a square in front of the output. Please help to resolve this issue. Thanks, Ajai.This message has been edited. Last edited by: Kerry,
WebFOCUS 7.1.4,Linux, HTML,PDF,Excel,CSV
September 08, 2008, 10:44 AM
Tony A
An oft asked question.
Search the forum, using the link top right, for VARCHAR.
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
September 08, 2008, 10:48 AM
RSquared
Ajai,
You have to put the -Read in loop to get all the values you stored in the Hold file.
WF 7.6.11 Oracle WebSphere Windows NT-5.2 x86 32bit
September 08, 2008, 11:02 AM
<JG>
Tony is correct what you are seeing is the way WebFocus holds VARCHAR values.
Each column is prefixed whith it's actual length so if you look at the SQLOUT master you will see it is described as AxV where x is the maximum length from MSSQl
change your code to
TABLE FILE SQLOUT PRINT Group_1/A28 ON TABLE SET HOLDLIST PRINTONLY ON TABLE HOLD AS GRP1 FORMAT ALPHA END
That should work
September 08, 2008, 11:56 AM
GinnyJakes
or ON TABLE SAVE. You don't need the master if you are going to -READ it.
-READ NOCLOSE grp1 will allow you to continue to read successive records. without the NOCLOSE you keep reading the same record... like those who do not learn from history....
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
September 09, 2008, 12:36 AM
Ajai
I gave the 'SQL SQLMSS SET VARCHAR OFF' command and it worked. Thankyou all for your comments.
Thanks, Ajai
WebFOCUS 7.1.4,Linux, HTML,PDF,Excel,CSV
September 09, 2008, 03:21 AM
Tony A
quote:
'SQL SQLMSS SET VARCHAR OFF'
Which goes to show how valuable the Forum is as a rich source of knowledge if only you take the time to search it for your answers - well done Ajai.
Just goes to prove the saying that if you give a man a fish then he'll eat well for a day, but give him a boat and a rod ....... you know the rest
One more call to tech support averted eh Gerry?
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
September 09, 2008, 02:24 PM
susannah
so, i set my varchar off in my edasprof SQL SQLORA SET VARCHAR OFF. refreshed my masters... but my masters still show USAGE=A10V even tho the ACTUAL is now A10 and all my problems with V format still exist. b/c the USAGE didn't get the V knocked off... What am i doing wrong? -S
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
September 09, 2008, 02:33 PM
GinnyJakes
Try deleting one of the masters and recreate it. Although you are current and I haven't noticed a problem recently, in the past the refresh didn't work. Though you did say that the actual had changed..... Very strange.
Also check the format in Oracle to make sure that it is varchar.
No need to fiddle with the synonym or the VARCHAR setting.
Reformat the field from varchar to char in the TABLE request, to eliminate the field-length prefix from the output file, and your -READ should be fine.
SQL . . . ; TABLE FILE SQLOUT PRINT Group_1/A28 ON TABLE SET HOLDLIST PRINTONLY ON TABLE HOLD AS GRP1 FORMAT ALPHA END -RUN -READ GRP1 &Group_1.A28
(printonly is needed to suppress the A28V field; without it both the A28V and A28 versions of the field would be present in the output.)
- Jack Gross WF through 8.1.05
September 10, 2008, 04:14 PM
susannah
Ginny, you're so right, i delete the master and then recreate, and bingo all the V's are out. Pain, but bite the bullet. thanks.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID