title: how to print record type attributes of a variable using FND_FILE.PUT_LINE - Oracle
body: <p>A PLSQL program uses a variable named x_api_errors, which is a record type defined as:
  <a href="https://i.stack.imgur.com/ENSuh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ENSuh.png" alt="enter image description here"></a></p>
  
  <p>I want to print x_api_errors.message_name and x_api_errors.message_text to Oracle EBS job log using FND_FILE.PUT_LINE.</p>
  
  <p>I expected this could easliy be done using (according to documentation this should work):</p>
  
  <pre><code>FND_FILE.PUT_LINE(FND_FILE.LOG,v_api_errors.message_name);
  </code></pre>
  
  <p>..but it is giving:</p>
  
  <pre><code>[Error] PLS-00306 (343: 21): 
  PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
  </code></pre>
  
  <p>How can I make this work?  It seems to be a problem related to type conversion because when I try to do:</p>
  
  <pre><code>v_errorMessage:=v_api_errors.message_name;
  </code></pre>
  
  <p>It gives error:</p>
  
  <pre><code>[Error] PLS-00382 (344: 50): 
  PLS-00382: expression is of wrong type
  </code></pre>
  
  <p>..but I am not able to <code>TO_CHAR</code> or <code>CAST</code> v_api_errors.message_name to VARCHAR2.</p>