SQLRPGLE Prepare

10 pts.
Tags:
SQLRPGLE
When using the prepare statement I'm creating a string that contains my select statement... I want to compare a numeric field within my string. For example I have batch# which is numeric, how can I say where batch# = 21

Answer Wiki

Thanks. We'll let you know when a new response is added.

Ok your statement might look like this:

Stmt = ‘Select x,y,z from myfile where batch# = ‘ + %editc(reqBatch# : ‘Z’)

where batch# is a numeric field in myfile reqBatch# has the reqired numeric value by the time that this string is built.
Phil

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Note that technically the name "batch#" is invalid in SQL. The "#" (hash or pound symbol) is not in past SQL language character sets. You might need to enclose the column name in full-quotes (double quote marks, i.e., [ " ]) or maybe even create a view that renames the column.
    Stmt = 'Select x,y,z from myfile where "BATCH#" = ' + %editc(reqBatch# : 'Z')
    Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following