Dynamic Where Clause in PeopleSoft PS Query

Its been more than a month since I had new post. Here goes. 🙂

I had a peculiar situation wherein for a particular PS Query, there were 3 bind variables. One of these three was mandatory and the rest had to run taking into consideration all values of that field. There might be multiple ways to do it, but this is what I came up with.

 A.FIELDNAME = NVL(LTRIM(:1,''),A.FIELDNAME) 

Here,

:1 is the bind variable. In the event of a value not being provided for :1, the query would run taking all values of A.FIELDNAME. Otherwise, it would run with just the prompt value.

Have fun 🙂

Advertisements

About Manikandan Surendren

A PeopleSoft Techno-functional Consultant. An engineering graduate in Computer Science. Technology Enthusiast. Movie freak. Gadget geek.
This entry was posted in Code, PeopleSoft, SQL. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s