<p>I think I might be missing something here. Here is the relevant part of the trigger:</p>
<pre><code>    CURSOR columnNames (inTableName IN VARCHAR2) IS 
       SELECT COLUMN_NAME FROM USER_TAB_COLUMNS WHERE TABLE_NAME = inTableName;
    /* Removed for brevity */
    OPEN columnNames('TEMP');
</code></pre>
<p>And here is the error message that I'm getting back,</p>
<pre>
27/20   PLS-00306: wrong number or types of arguments in call to 'COLUMNNAMES'
27/2    PL/SQL: Statement ignored
</pre>
<p>If I am understanding the documentation correctly, that should work, but since it is not I must be doing something wrong. Any ideas?</p>
<hr />
<p>@<a href="https://stackoverflow.com/questions/43832/pls-00306-error-on-call-to-cursor#43859">Matthew</a> - I appreciate the help, but the reason that I am confused is because this bit of code isn't working for me and is raising the errors referenced. We have other triggers in the database with code almost exactly the as that so I'm not sure if it is something that I did wrong, or something with how I am trying to store the trigger, etc.</p>
<hr />
<p>@<a href="https://stackoverflow.com/questions/43832/pls-00306-error-on-call-to-cursor#43859">Matthew</a> - Well, now I get to feel embarrassed. I did a copy/paste of the code that you provided into a new trigger and it worked fine. So I went back into the original trigger and tried it and received the error message again, except this time I started to delete stuff out of the trigger and after getting rid of this line,</p>
<pre><code>FOR columnName IN columnNames LOOP
</code></pre>
<p>Things saved fine. So it turns out that where I thought the error was, wasn't actually were the error was.</p>

[{'answer_id': 43859, 'author': 'Matthew Watson', 'author_id': 3839, 'author_profile': 'https://Stackoverflow.com/users/3839', 'pm_score': 1, 'selected': False, 'text': "<p>Works fine for me.</p>\n\n<pre><code>create or replace procedure so_test_procedure as \n CURSOR columnNames (inTableName IN VARCHAR2) IS \n   SELECT COLUMN_NAME FROM USER_TAB_COLUMNS WHERE TABLE_NAME = inTableName; \nBEGIN      \n OPEN columnNames('TEMP');\n CLOSE columnNames;\nEND;\n\nprocedure so_test_procedure Compiled.\nexecute so_test_procedure();\n\nanonymous block completed\n</code></pre>\n"}, {'answer_id': 77785, 'author': 'Frode Hauge', 'author_id': 6859, 'author_profile': 'https://Stackoverflow.com/users/6859', 'pm_score': 2, 'selected': False, 'text': "<p>To clarify the cause of the issue. As you state </p>\n\n<p><strong>OPEN columnNames('TEMP');</strong> </p>\n\n<p>worked while </p>\n\n<p><strong>FOR columnName IN columnNames LOOP</strong></p>\n\n<p>did not. The FOR statement would work fine if it also included the parameter like so:</p>\n\n<p><strong>FOR columnName IN columnNames('TEMP') LOOP</strong></p>\n\n<p>You don't show the code where you fetch the rows so I can't tell your purpose, but where I work OPEN is commonly used to fetch the first row (in this case, the first column name of the given table) while the FOR is used to iterate through all returned rows.</p>\n\n<p>@Rob's comment. I'm not allowed to comment so updating here instead. The missing parameter is what I describe above. You added a response stating you simply deleted the FOR loop. It did not look like you, at the time, understood why deleting it made a difference. Which is why I attempted to explain since, depending on your need, the FOR loop might be a better solution.</p>\n"}]
['https://Stackoverflow.com/questions/43832', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1185/']