E-PC: %KeyEqual Meta SQL Returns Error: KEYEQUAL: Invalid Bind Number (2,-1) (Doc ID 2287378.1)

Last updated on AUGUST 18, 2017

Applies to:

PeopleSoft Enterprise PT PeopleTools - Version 8.55 and later
Information in this document applies to any platform.

Symptoms

When using meta-sql %KeyEqual, specifying an alias/correlation_id, in peoplecode, it errors out with 'KEYEQUAL: Invalid bind number'

To replicate the issue:

Create code that uses the meta-sql %KeyEqual, specifying the alias for the record. E.g.:

Local Record &recPerson1, &recPerson2;

Local SQL &sqlSQL;

 

&recPerson1 = CreateRecord(Record.PERSONAL_DATA);
&recPerson2 = CreateRecord(Record.PERSONAL_DATA);

&recPerson2.EMPLID.Value = "KU0006";

If &recPerson2.SelectByKey() Then

       &sqlSQL = CreateSQL("%selectall(:1) R1 WHERE %KeyEqual(:2, R1)", &recPerson1, &recPerson2);

       While &sqlSQL.Fetch(&recPerson)
              /* do something */
       End-While;
       &sqlSQL.Close();

End-if;

 

When executing the code, the following error is returned:

KEYEQUAL: Invalid bind number

 

 

 

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms