× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



It worked like a charm by ACS Run Sql script, i did not know the STRSQL has been outdated



@Peter,

Attempting to use the cast function with the STRSQL, i receive the following error message

select cast (freqs as varchar(100)) from log_table

CAST from XML to CHARACTER not supported



One more thing to ask you for is,



dcl-ds dstLog_table extname('LOG_TABLE') qualified template end-ds;



dcl-pi log_table_insert ind;

pedsLog_table likeds(dstLog_table) const;

peReqs varchar(1200) const;

peHataMesaji varchar(100);

end-pi;



FREQS is Xml data type and i firstly decided to pass external ds named pedsLog_table with FREQS, but received SQL0312 (the variable (pedsIdx000.freqs) does not have an equivalent SQL data type) while inserting, so it seems to be not implicitly converted, then how can i explicitly convert Xml data type to an equivalent SQL data type?



exec SQL

insert into fgidx000

values (

:pedsIdx000.fwsad,

:pedsIdx000.freqs,

:pedsIdx000.facklm,

:pedsIdx000.fhtkod)

with nc;



--

Cheers,

Nihat





-----Özgün İleti-----
Kimden: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> Yerine Birgitta Hauser
Tarih: Wednesday, August 19, 2020 9:04 AM
Kime: 'RPG programming on IBM i' <rpg400-l@xxxxxxxxxxxxxxxxxx>
Konu: RE: SQL0311 error



DİKKAT: Bu e-posta kurum dışından gönderilmiştir. Zararlı dosya veya bağlantılar (link) içerebilir. Kaynağından emin olmadığınız dosyaları/bağlantıları (link) açarken veya e-postayı cevaplarken dikkatli olunuz.

________________________________



Where did you get the *POINTER? With STRSQL?

You cannot test it with STRSQL it is outdated and not enhanced since release V4R5.

Use ACS Run SQL Script instead.



Mit freundlichen Grüßen / Best regards



Birgitta Hauser





"Shoot for the moon, even if you miss, you'll land among the stars." (Les Brown) "If you think education is expensive, try ignorance." (Derek Bok) "What is worse than training your staff and losing them? Not training them and keeping them!"

„Train people well enough so they can leave, treat them well enough so they don't want to.“ (Richard Branson)





-----Original Message-----

From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx<mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx>> On Behalf Of Nihat Ezer via RPG400-L

Sent: Dienstag, 18. August 2020 20:24

To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx<mailto:rpg400-l@xxxxxxxxxxxxxxxxxx>>

Cc: Nihat Ezer <nihatezer@xxxxxxxxxxxxxxxxxxxxx<mailto:nihatezer@xxxxxxxxxxxxxxxxxxxxx>>

Subject: YNT: SQL0311 error



Hi Birgitta,







The freqs field (second column) of the log_table now includes *POINTER, it makes sense to you?







[cid:image001.png@01D675A5.DB648560]







--



Thank you,



Nihat











-----Özgün İleti-----

Kimden: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx<mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx>> Yerine Birgitta Hauser

Tarih: Tuesday, August 18, 2020 9:02 PM

Kime: 'RPG programming on IBM i' <rpg400-l@xxxxxxxxxxxxxxxxxx<mailto:rpg400-l@xxxxxxxxxxxxxxxxxx>>

Konu: RE: SQL0311 error







DİKKAT: Bu e-posta kurum dışından gönderilmiştir. Zararlı dosya veya bağlantılar (link) içerebilir. Kaynağından emin olmadığınız dosyaları/bağlantıları (link) açarken veya e-postayı cevaplarken dikkatli olunuz.



________________________________







You also have to set the length!







l_data = peReqs;



I_Len = %Len(%Trim(I_Data);







Mit freundlichen Grüßen / Best regards







Birgitta Hauser











"Shoot for the moon, even if you miss, you'll land among the stars." (Les



Brown)



"If you think education is expensive, try ignorance." (Derek Bok) "What is worse than training your staff and losing them? Not training them and keeping them!"



„Train people well enough so they can leave, treat them well enough so they don't want to.“ (Richard Branson)











-----Original Message-----



From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx<mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx<mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx%3cmailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx>>> On Behalf Of Nihat Ezer via RPG400-L



Sent: Dienstag, 18. August 2020 18:15



To: RPG400-L@xxxxxxxxxxxxxxxxxx<mailto:RPG400-L@xxxxxxxxxxxxxxxxxx<mailto:RPG400-L@xxxxxxxxxxxxxxxxxx%3cmailto:RPG400-L@xxxxxxxxxxxxxxxxxx>>



Cc: Nihat Ezer <nihatezer@xxxxxxxxxxxxxxxxxxxxx<mailto:nihatezer@xxxxxxxxxxxxxxxxxxxxx<mailto:nihatezer@xxxxxxxxxxxxxxxxxxxxx%3cmailto:nihatezer@xxxxxxxxxxxxxxxxxxxxx>>>



Subject: SQL0311 error







Greetings,







create table log_table (



fwsad varchar(50),



freqs xml,



facklm varchar(120),



fhtkod varchar(20),



);







I have a scenario, which sends xml request and receives response then invokes the following procedure within service program that writes the log_table above







peReqs is the xml request itself in character, after assigning it to the pre-compiler expanded field (l_data) successfully, i receive the sql0311 (Length in varying-length, LOB, or XML host variable not valid) while inserting







dcl-pi log_table_insert ind;



pedsLog_table likeds(dstLog_table) const;



peReqs varchar(1200) const;



peHataMesaji varchar(100);



end-pi;







dcl-s l sqltype(clob:9999)







// here we go



l_data = peReqs;







exec SQL



insert into fgLog_table



values (



:pedsLog_table.fwsad,



:l,



:pedsLog_table.facklm,



:pedsLog_table.fhtkod)



with nc;







Seen the following link as well, which did not help much as i did not understand https://archive.midrange.com/rpg400-l/201407/msg00159.html







--



Thank you,



Nihat







--



This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx<mailto:RPG400-L@xxxxxxxxxxxxxxxxxx<mailto:RPG400-L@xxxxxxxxxxxxxxxxxx%3cmailto:RPG400-L@xxxxxxxxxxxxxxxxxx>> To subscribe, unsubscribe, or change list options,



visit: https://lists.midrange.com/mailman/listinfo/rpg400-l



or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx<mailto:RPG400-L-request@xxxxxxxxxxxxxxxxxx<mailto:RPG400-L-request@xxxxxxxxxxxxxxxxxx%3cmailto:RPG400-L-request@xxxxxxxxxxxxxxxxxx>>



Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.







Please contact support@xxxxxxxxxxxxxxxxxxxx<mailto:support@xxxxxxxxxxxxxxxxxxxx<mailto:support@xxxxxxxxxxxxxxxxxxxx%3cmailto:support@xxxxxxxxxxxxxxxxxxxx>> for any subscription related questions.







Help support midrange.com by shopping at amazon.com with our affiliate link:



https://amazon.midrange.com







--



This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx<mailto:RPG400-L@xxxxxxxxxxxxxxxxxx<mailto:RPG400-L@xxxxxxxxxxxxxxxxxx%3cmailto:RPG400-L@xxxxxxxxxxxxxxxxxx>> To subscribe, unsubscribe, or change list options,



visit: https://lists.midrange.com/mailman/listinfo/rpg400-l



or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx<mailto:RPG400-L-request@xxxxxxxxxxxxxxxxxx<mailto:RPG400-L-request@xxxxxxxxxxxxxxxxxx%3cmailto:RPG400-L-request@xxxxxxxxxxxxxxxxxx>>



Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.







Please contact support@xxxxxxxxxxxxxxxxxxxx<mailto:support@xxxxxxxxxxxxxxxxxxxx<mailto:support@xxxxxxxxxxxxxxxxxxxx%3cmailto:support@xxxxxxxxxxxxxxxxxxxx>> for any subscription related questions.







Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com

--

This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx<mailto:RPG400-L@xxxxxxxxxxxxxxxxxx> To subscribe, unsubscribe, or change list options,

visit: https://lists.midrange.com/mailman/listinfo/rpg400-l

or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx<mailto:RPG400-L-request@xxxxxxxxxxxxxxxxxx>

Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.



Please contact support@xxxxxxxxxxxxxxxxxxxx<mailto:support@xxxxxxxxxxxxxxxxxxxx> for any subscription related questions.



Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com



--

This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx<mailto:RPG400-L@xxxxxxxxxxxxxxxxxx> To subscribe, unsubscribe, or change list options,

visit: https://lists.midrange.com/mailman/listinfo/rpg400-l

or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx<mailto:RPG400-L-request@xxxxxxxxxxxxxxxxxx>

Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.



Please contact support@xxxxxxxxxxxxxxxxxxxx<mailto:support@xxxxxxxxxxxxxxxxxxxx> for any subscription related questions.



Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.