Quantcast
Channel: SCN: Message List - PowerBuilder Developer Center
Viewing all articles
Browse latest Browse all 7329

Re: how to call SP automatically when issue a select clause?

$
0
0

What is the backend DBMS here?

 

You're using the phrase "proxy table", but it doesn't sound like that's what you might mean.  A Proxy Table is like a "remote query" against a table in a different database.  It allows you to do table joins when the two tables are stored in physically separate databases. 

 

What you're describing sounds more like a "global temporary table", where some process (your stored procedure, for example) runs a bunch of complex queries, then inserts its result set into this temp table.  The temp table looks and feels exactly like a real table, but the data is only available to the current connection, and the table and all its data is deleted when the connection is dropped.

 

Is that it?  Because you can define the table as a GLOBAL TEMPORARY, and it's definition is available in the system catalog.  You can write queries against them without having to define the table as a physical table...

 

Now - to your original question - how to call the stored procedure to populate the temp table before you execute the query against it?  I'd use the RetrieveStart event of the datawindow that queries the temp table.

::retrieveStart

if (select count(*) from temp_table) > 0  then RETURN

 

EXECUTE stored_procedure arg1, arg2, arg3 using SQLCA;


Viewing all articles
Browse latest Browse all 7329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>