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



Roger,

Does using the SQLDA allow the search to happen without closing and
reopening the cursor?

I build my select statement in a variable, and use it as host variable on
the prepare statement:

PREPARE @SELECT FROM :SELECT

DECLARE @CURSOR DYNAMIC SCROLL CURSOR FOR @SELECT

OPEN @CURSOR

When the select statement changes I close and reopen the cursor, when I add
a record or delete a record I close and reopen the cursor, if someone
presses F5=Refresh I close and reopen the cursor.

Does using the SQLDA take away the need of closing and opening the cursor?

Phil

> -----Original Message-----
> From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On
> Behalf Of Mackie, Roger L. (Precision Press)
> Sent: Wednesday, August 22, 2001 11:12 AM
> To: 'RPG400-L@midrange.com'
> Subject: SQLLEN of packed field in SQLDA
>
>
> Hi everyone,
>
> I'm creating a subfile selection screen that uses dynamic SQL to fill the
> subfile. The users will be able search by six different fields. Since the
> WHERE clause in a SQL string that will be the host variable of a PREPARE
> statement cannot contain a host variable, the program specifies
> an SQLDA on
> the USING DESCRIPTOR clause of the cursor OPEN statement to describe a
> parameter marker in the prepared statement. Most of it is working but one
> problem remains.
>
> Two of the search fields look in file fields that are packed
> decimal(SQLTYPE
> = 484). Chapter 14.8 of the DB2 for AS/400 SQL Programming manual tells me
> the first byte of the SQLLEN 2-byte binary field describing the
> length of a
> packed field needs to be (%LEN(srchfld) + 1)/2 and the second
> byte needs to
> be the field's number of decimal positions. But how do I put
> those values in
> specific bytes of a binary field? I've tried to MOVE hex values and to
> substring SQLVAR, but I can't get the right values where they need to be.
> Have I missed something in the manuals? What's the best technique
> for doing
> this?
>
> Thanks in advance for your help.
>
> Roger Mackie
>
>
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
> or email: RPG400-L-request@midrange.com
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.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.