Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

VB.NET, Oracle View and you

Posted on 2004-11-24
6
Medium Priority
?
277 Views
Last Modified: 2012-05-05
Ok..  I'm here..  at work on the Wednesday before Thanksgiving..  so the brain isn't working too well and I don't have access to an Oracle database..  so if someone can help me, I promise to save some turkey tomorrow for them.

I've written a VB.NET program to open a Crystal Report.  I manipulate the RecordSelectionFormula to select the record that I want based on a simple query on a single table.

Next, I wrote a view which selects from 6 or so tables to populate the "real" report..  for example

CREATE OR REPLACE VIEW VIEW_A AS
SELECT
    A.VALUE_A,
    B.VALUE_B,
    B.VALUE_C,
    A.VALUE_D
FROM
   TABLE_A A,
   TABLE_B B
WHERE
   A.KEY = B.KEY

Now I want to use the RecordSelectionFormula to limit the result to a single record (A.KEY = 'value')

1.  Will this filter be done on the Server or the Client?  If on the client, is there a more efficient way to do this selection?
2.  How do I specify the A.KEY value?  Is it view.tablespace.fieldname?  VIEW_A.TABLE_A.KEY??  

Thanks in advance for any help offered!
0
Comment
Question by:adb_13
  • 2
4 Comments
 
LVL 2

Expert Comment

by:mcdown75
ID: 12666946
If you are bringing this back to a Data Adapter why don't you just set DA.filter = Key  I think you can do that.
0
 

Author Comment

by:adb_13
ID: 12667438
Unfortunately, I'm not using a Data Adapter..  maybe I should try that route instead.

I'm using an already existing report in their production environment.  My initial thoughts were I could just pass the key value for the column to filter out the one record..  right now, they get a dialog box up prompting the user to enter the key.  I found that by overriding the RecordSelectionFormula in the Crystal Report RunTime engine and eliminating the parameters within the report, I could select the row I want.  My thought being, at the time, that this select would be done on the server.

Does that make sense?

Are you saying my best alternative is to just use a Data Adapter?  

Thanks.
0
 
LVL 2

Expert Comment

by:mcdown75
ID: 12667622
Nope.  Not telling you that.  It's just one option.  I am not that up on Crystal Reports.  I am wondering if you need to adjust the stored procedure within Oracle to do what you want by passing a second parameter.  That's another option.  Maybe you can do something in crystal reports like that.
0
 
LVL 7

Accepted Solution

by:
jacobhoover earned 1000 total points
ID: 12669623
First, in order to filter against the view, you will need to keep all the fields you wish to filter on in the view.

CREATE OR REPLACE VIEW VIEW_A AS
SELECT
    A.KEY, -- <-- HERE
    A.VALUE_A,
    B.VALUE_B,
    B.VALUE_C,
    A.VALUE_D
FROM
   TABLE_A A,
   TABLE_B B
WHERE
   A.KEY = B.KEY

Then if your query in Crystal Reports is "SELECT * FROM VIEW_A WHERE KEY = 'The One I Want'" then the filtering will be done on the server side.

If you have field names that are identical on bot table a and b, then you will have to alias them.

Jake
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
No other job is as rewarding and demanding as building an iPhone app is. It is not really in the hands of the developer for the success of an iPhone app. Many factors operate jointly for every iOS application's success in the market.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Simple Linear Regression

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question