× 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.



Two points James.

One - this might be better on the web400 list where there are PHPers lurking.

Two - what is the problem they are experiencing? Just off the top of my head it should not be an issue but obviously you wrote for a reason.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Sep 27, 2016, at 1:10 PM, James H. H. Lampert <jamesl@xxxxxxxxxxxxxxxxx> wrote:

Ladies and Gentlemen:

We have a customer that's trying to do a prepared statement to create a DB2 record on their Midrange box, and one of the fields they're attempting to populate is a rather long VARLEN character field (EBCDIC, max length a little under 16k), with embedded line breaks.

I have very little experience with Prepared Statements, and none whatsoever with PHP. Here's a simplified fragment of what they have (and assume all variables have already been populated):

$nrecid = $accaid; // Record ID ( Passed from earlier in the function )
$temp = "Name: " . $name . "
Email Address: " . $emailAddress . "
Phone Number: " . $phoneNumber . "
Message: " . $message . "
HTTP_REFERRER: " . $_SERVER[ 'HTTP_REFERER' ]; // Notes
$nnotes = str_replace( " ", "", $temp );

$args = array(
$nrecid ,
$nnotes );

$query = "INSERT INTO " . $library . ".NOTEFILE
( NRECID, NNOTES )
VALUES ( ?, ? )";
$stmt = db2_prepare( $conn, $query );

if ( !db2_execute( $stmt, $args ) ) {
$error = array (
'Statement Error' =>db2_stmt_error( ),
'Error Message' => db2_stmt_errormsg( ),
'Query' => aiInterpolateQuery( $query, $args )
);

++$errorCount;
}

It looks like he's trying to use line breaks in the code to produce line breaks in the value of $nnotes. Is that even possible?

What we actually WANT to show up in the EBCDIC value of the NNOTES field is a Hex'0A' for each line break.

--
JHHL
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.