Welcome to CompShack!

Contribute!

Contribute!Do you find yourself with few minutes to spare, and a desire to help other CompShackers?

Submit a tip, code or an SQL snippet. Start an article about topics you are familier with, or edit a Wiki page. Help the community grow larger by sharing a little bit of what you know!

Reasons why this is great:

  • You help your fellow CompShackers
  • Give back to the community and help it grow
  • Easy access to your code any time you need it
  • Become known and adored in the community!

Note: Registration required. Guests can edit Wiki pages.

Call Unix Script from SQR

Few posts back, I wrote about how to call a UNIX script from PeopleCode. In this post, I will provide a sample code to call a UNIX script from an SQR program.


!**********************************
! Procedure:    Run-Script                            *
! Description:  Calls a unix script from SQR *
!**********************************
begin-procedure Run-Script
#debug show 'Entering Run-Script'

! call script located in /ps_scripts folder

Find Navigation of Page from Component Name

Many times we came across situation where we have Page name but we dont know the navigation for this page in Portal.

Following SQL makes the job easy for us.
Execute the following SQL in Database.

SELECT REPLACE(navigation,'',' > ') "PIA Navigation"
, url
, MENU_NAME
, COMPONENT_NAME
, portal_objname
, portal_prntobjname
, portal_uri_seg3
,portal_label
FROM (SELECT SYS_CONNECT_BY_PATH (a.portal_label,'>>') navigation
, '/EMPLOYEE/ERP/c/' || a.portal_uri_seg1 || '.' || a.portal_uri_seg2 || '.' || a.portal_uri_seg3 url
,  a.portal_uri_seg1  MENU_NAME

Changing Date Format

Peoplesoft provides a function called as "DateTimeToLocalizedString" to change date from one format into another.

Following is syntax used to achiev this.

DateTimeToLocalizedString (Param1,Param2);

Param1 : Variable of Date Datatype
Param2 : Date format which you want for example "dd/MM/yyyy".

If you have Param1 of type string then use function "DateValue" to convert that string to Date.