Question: I have a PL/SQL script which generates a text file currently, but I need to generate excel file from the script. I have currently have pl/sql code like below, 

```
BEGIN  
  --column headers  
  DBMS_OUTPUT.PUT_LINE(‘column name header 1 | column name header 2 | 
  column name header 3 |………..| column name header n’);  
END; /  
  --extract 
  (SELECT UNIQUE temptable.columnname1 || '|' ||  
  temptable.columnname2 || '|' ||                
  ‘columnname3’ || '|' ||               
  ………………                
  temptable.columnnamen '|' 
  FROM   temptable 
  WHERE  temptable.OUTPUT_INDICATOR = 'extract ready'); 

```

I have tried renaming the destination file name with .csv extension but all the data is getting copied to a single cell in an excel. Could anyone tell me how we modify the above code to extract data to excel file? Thanks.

Answer: 
You have to use `document.getElementById()`, as you have not locally defined a function called `getElementById()`. You can take a look at more `document.getElementById()` syntax at the **[MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementById)**.
Prefix `getElementById` with `document`, e.g. `document.getElementById`