Get sql_profile of a sql_id - oracle database script

Get sql_profile of a sql_id - Oracle Database Script.

-- Script for getting sql_profile created for a sql_id  select distinct   p.name sql_profile_name,  s.sql_id  from   dba_sql_profiles p,  DBA_HIST_SQLSTAT s  where  p.name=s.sql_profile and s.sql_id='&sql_id';