Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Oracle / Oracle Server / September 2005

Tip: Looking for answers? Try searching our database.

long dynamic SQL statement (Pro*C)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marcel Hohenberger - 29 Sep 2005 16:25 GMT
Initial setup: Embedded SQL/C Client (Pro*C) accessing Oracle Server (8, 9,
or 10)

Problem: In my client program I have (from earlier processing) a very long
list of values for given WHERE criteria (10s of thousands or more). I would
like to run a dynamic SQL statement like "SELECT * FROM table WHERE
criterion IN (value0, value1, ..., valueN)". I realize this won't be
possible because the length of a dynamic SQL statement is limited. I
definitely don't want to run 10s of thousands of individual SQL statements
because of performance reasons.

Any ideas how this could be done efficiently and elegantly? In other
projects I have worked around this problem by keeping the list of values in
a temporary table to be joined with on the server side. However, this only
makes sense if the list of values has been determined on the server side in
the first place; I doubt that it would make sense to set up a temporary
table to be filled from the client side just for this one statement.

How is this commonly done? I mean it sounds like such an everyday problem
that someone must have come up with a simple solution. Awfully hard to
google for because the search terms are so generic. Any hints are greatly
appreciated

Marcel
Jim Kennedy - 30 Sep 2005 02:20 GMT
> Initial setup: Embedded SQL/C Client (Pro*C) accessing Oracle Server (8, 9,
> or 10)
[quoted text clipped - 20 lines]
>
> Marcel

You could put the values in a global temporary table and then join to that
table.
Jim
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.