Re: Cursor parameters - problems with 'FROM [inTablename]' statement

From: Jim Kennedy <kennedy-down_with_spammers_at_no_spam.comcast.net>
Date: Fri, 29 Aug 2003 10:59:43 GMT
Message-ID: <zmG3b.293550$YN5.204469_at_sccrnsc01>


"Sugus" <krug_at_europ.de> wrote in message news:76f56553.0308290221.4b4a65f3_at_posting.google.com...
> I'd like to declare a cursor, which accepts parameters also for the
> "FROM" tablename-clause, like:
>
> CURSOR cFielddef(pfromTable IN ?????, pTableName IN VARCHAR2) IS
> SELECT column_name, data_type, data_length, nullable FROM pfromTable
> WHERE table_name = UPPER(pTableName);
>
> Is it possible at all, and what type do I have to decalre in place of
> the questionsmarks? Any other solution?
>
> Thanks für your help,
>
> Sugus
What do you want the query to do? You can't do it that way because Oracle is trying to compile it and make sure the columns exist etc. If it does not know the tablename then how could it? You would have to use dynamic sql which may cause scalability problems.
Jim Received on Fri Aug 29 2003 - 12:59:43 CEST

Original text of this message