Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

sqldatasource and parameterized query using oracle access client

Posted on 2013-01-17
4
Medium Priority
?
470 Views
Last Modified: 2013-12-13
I have a sqldatasource on my page that will run if I change the parameter to a fixed value but will not run as a parameterized query. It will run in the oracle connect screen, but I cannot get it to run from the page. I am trying to convert from VS 2005 to VS2010 and from the Microsoft  provider (which is going away) to the oracle provider.

I have already tried the following:
 - there is only 1 parameter so the bind by name/position issue should not factor in
 - I have added a type and dbtype of 'string'
 - I have added a size

when I try to execute, I receive the  ORA-01008 not all variables bound error.

Code:

<asp:SqlDataSource ID="SqlDS_SEM11" runat="server"
        ConnectionString="DATA SOURCE=PROD_DB.world;PASSWORD=xx;PERSIST SECURITY INFO=True;USER ID=xx"
        ProviderName="Oracle.DataAccess.Client"
       
        SelectCommand="SELECT DISTINCT SATURN.SMRACAA.SMRACAA_AREA, SATURN.SMRACAA.SMRACAA_TERM_CODE_EFF, SATURN.SMRACAA.SMRACAA_SET, SATURN.SMRACAA.SMRACAA_SUBSET, decode(saturn.SMRACAA.SMRACAA_SUBSET, '111', NULL, '222', 'Or', '333', 'Or', NULL) AS and_or, SATURN.SCBCRSE.SCBCRSE_SUBJ_CODE, SATURN.SCBCRSE.SCBCRSE_CRSE_NUMB, concat(SATURN.SCBCRSE.SCBCRSE_SUBJ_CODE, concat('-', SATURN.SCBCRSE.SCBCRSE_CRSE_NUMB)) AS course, SATURN.SCBCRSE.SCBCRSE_TITLE, SATURN.SMBPGEN.SMBPGEN_PROGRAM, SATURN.SMBPGEN.SMBPGEN_TERM_CODE_EFF, SATURN.SCBCRSE.SCBCRSE_CREDIT_HR_HIGH FROM SATURN.SCBCRSE INNER JOIN SATURN.SMRACAA ON SATURN.SCBCRSE.SCBCRSE_SUBJ_CODE = SATURN.SMRACAA.SMRACAA_SUBJ_CODE AND SATURN.SCBCRSE.SCBCRSE_CRSE_NUMB = SATURN.SMRACAA.SMRACAA_CRSE_NUMB_LOW INNER JOIN SATURN.SMBPGEN ON SATURN.SMRACAA.SMRACAA_TERM_CODE_EFF = SATURN.SMBPGEN.SMBPGEN_TERM_CODE_EFF AND substr(SATURN.SMRACAA.SMRACAA_AREA, 1, 6) = saturn.SMBPGEN.SMBPGEN_PROGRAM WHERE (saturn.SMBpgen.SMBPGEN_PROGRAM, saturn.SMBPGEN.SMBPGEN_TERM_CODE_EFF) IN (SELECT saturn.SMBPGEN.SMBPGEN_PROGRAM, MAX(saturn.SMBPGEN.SMBPGEN_TERM_CODE_EFF) FROM saturn.SMBPGEN WHERE saturn.SMBPGEN.SMBPGEN_ACTIVE_IND = 'Y' GROUP BY saturn.SMBPGEN.SMBPGEN_PROGRAM) AND (saturn.SMRACAA.SMRACAA_AREA, saturn.SMRACAA.SMRACAA_TERM_CODE_EFF) IN (SELECT saturn.SMBAGEN.SMBAGEN_AREA, MAX(saturn.SMBAGEN.SMBAGEN_TERM_CODE_EFF) FROM saturn.SMBAGEN WHERE saturn.SMBAGEN.SMBAGEN_ACTIVE_IND = 'Y' GROUP BY saturn.SMBAGEN.SMBAGEN_AREA) AND (saturn.SCBCRSE.scbcrse_subj_code, saturn.SCBCRSE.SCBCRSE_CRSE_NUMB, saturn.SCBCRSE.SCBCRSE_EFF_TERM) IN (SELECT saturn.SCBCRSE.SCBCRSE_SUBJ_CODE, saturn.SCBCRSE.SCBCRSE_CRSE_NUMB, MAX(saturn.SCBCRSE.SCBCRSE_EFF_TERM) FROM saturn.SCBCRSE GROUP BY saturn.SCBCRSE.SCBCRSE_SUBJ_CODE, saturn.SCBCRSE.SCBCRSE_CRSE_NUMB) AND (saturn.SMBPGEN.SMBPGEN_PROGRAM = :prog_ram) AND (substr(saturn.SMRACAA.SMRACAA_area, 7, 2) = '11') ORDER BY saturn.SMRACAA.SMRACAA_SET, saturn.SCBCRSE.SCBCRSE_SUBJ_CODE, saturn.SCBCRSE.SCBCRSE_CRSE_NUMB">
       
        <SelectParameters>
            <asp:QueryStringParameter DbType="String" DefaultValue="" Name="PROG_RAM"
                QueryStringField="program" Size="6" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>

Any ideas?

Thanks in advance
0
Comment
Question by:dfisher12
4 Comments
 
LVL 18

Expert Comment

by:dj_alik
ID: 38792574
Did you try to remove COLON symbol? (:)
0
 

Accepted Solution

by:
dfisher12 earned 0 total points
ID: 38794424
Thanks - I had tried that already.

I have been trying to test this in the query builder window, and receiving this error message. I decided to create a data grid pointing to this source and it is working. Apparently, this is a flaw in the query builder functionality.

A day I will never get back!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

916 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