PeopleTools and Lifecycle Management - PSFT (MOSC)

MOSC Banner

[PeopleTools] Using SQLExec or Fetch with Common Table Expression Fails

edited Dec 16, 2018 4:07AM in PeopleTools and Lifecycle Management - PSFT (MOSC) 3 commentsAnswered

PeopleTools: 8.53

Database: Microsoft SQL Server 2008

If I execute the following sql

Local string &EMPLID;

SQLExec("WITH CTE(EMPLID) AS ( SELECT EMPLID FROM PSOPRDEFN WHERE EMPLID <> ' ' ) SELECT TOP 1 * FROM CTE", &EMPLID);

MessageBox(0, "", 0, 0, "Emplid is: " | &Emplid);

I get the error message

  SQLExec: 1 select list items in parameter list, but SQL has 0 select columns. (2,124)

If I use CreateSQL and Fetch, it connects but returns no rows (it says connection not open when I try to close)

Is there any way to convince PeopleSoft that this is a valid expression?

Actual Issue:

I have a much more complicated CTE that I'd like to use that takes paramters and returns multiple values, but runs into the same issue.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

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

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center