Save pandas (string/object) column as VARCHAR in Oracle DB instead of CLOB (default behaviour)
<p>i am trying to transfer a dataframe to oracle database, but the transfer is taking too long, because the datatype of the variable is showing as <strong>clob</strong> in oracle. However i believe if i convert the datatype from <strong>clob</strong> to string of <strong>9 digits</strong> with <strong>padded 0's</strong> , it will not take that much time. data is </p>

<pre><code>product
000012320
000234234
</code></pre>

<p>is there a way to change the datatype of this variable to string of 9 digits. so that oracle does not think of it as CLOB object. i have tried the following.</p>

<pre><code>df['product']=df['product'].astype(str)
</code></pre>

<p>or is there something else that might slow the transfer from python to oracle ?</p>

<p>use <code>str.zfill</code></p>

<pre><code>df['product'].astype(str).str.zfill(9)

0    000012320
1    000234234
Name: product, dtype: object
</code></pre>

python python-3.x pandas dataframe