Query: Pro*C SELECT ... IN ... stmt

From: Arturo Perez x6739 <aperez_at_caribe.prime.com>
Date: 30 Jun 92 16:02:23 GMT
Message-ID: <3431_at_cvbnetPrime.COM>


Does anybody know how to get a statement like the following to work in Pro*C? Something similar works fine in SQLPLUS.

    EXEC SQL SELECT COUNT(*)

                   INTO :count
                   FROM USER_COMMANDS
                  WHERE USER_ID = :user_id
                    AND COMMAND_NAME IN :commands;


This is the query paraphrased so don't pick it apart too bad.

What I want is to find the number of commands from the list of commands given in :commands that is in the user's command table.

What exactly is the right format of the :commands? Or do I have to use dynamic stuff and build the query interactively to get this right?
If not what am I doing wrong.

Thanks for your help!
Newsgroups: comp.databases.oracle
Subject: Query: Pro*C SELECT ... IN ... stmt Summary:
Followup-To:
Distribution: na
Organization: Computervision
Keywords:

Does anybody know how to get a statement like the following to work in Pro*C? Something similar works fine in SQLPLUS.

    EXEC SQL SELECT COUNT(*)

                   INTO :count
                   FROM USER_COMMANDS
                  WHERE USER_ID = :user_id
                    AND COMMAND_NAME IN :commands;


This is the query paraphrased so don't pick it apart too bad.

What I want is to find the number of commands from the list of commands given in :commands that is in the user's command table.

What exactly is the right format of the :commands? Or do I have to use dynamic stuff and build the query interactively to get this right?
If not what am I doing wrong.

Thanks for your help!
Arturo Perez
ComputerVision, a division of Prime
aperez_at_cvbnet.prime.com
Too much information, like a bullet through my brain -- The Police Received on Tue Jun 30 1992 - 18:02:23 CEST

Original text of this message