dbTalk Databases Forums  

PSQL 2000i SP3 syntax error - .asp variable in a

comp.databases.btrieve comp.databases.btrieve


Discuss PSQL 2000i SP3 syntax error - .asp variable in a in the comp.databases.btrieve forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
bryant@4dnssupport.com
 
Posts: n/a

Default PSQL 2000i SP3 syntax error - .asp variable in a - 05-05-2007 , 10:18 PM






Hi all.

The following query
displays the information I need in the gridview for a single record.


SELECT OE_HDR.ORD_NO, OE_HDR.CUST_NAM, OE_HDR.SLS_MAN_NO,
OE_HDR.SLS_MAN_INITIALS, OE_HDR.ORD_DAT, OE_HDR.SHIP_DAT
FROM OE_HDR WHERE (OE_HDR.ORD_NO='174310')


I also have DropDownList2 working properly. For the WHERE portion of
the query I would like to pass a variable that references the value
of
DropDownList2


SELECT OE_HDR.ORD_NO, OE_HDR.CUST_NAM, OE_HDR.SLS_MAN_NO,
OE_HDR.SLS_MAN_INITIALS, OE_HDR.ORD_DAT, OE_HDR.SHIP_DAT
FROM OE_HDR WHERE (OE_HDR.ORD_NO= @ORD_NO)

Here is the code that is erroring out:

<asp:SqlDataSource runat="server" ID="SqlDataSource2"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
SelectCommand="SELECT OE_HDR.ORD_NO, OE_HDR.CUST_NAM,
OE_HDR.SLS_MAN_NO, OE_HDR.SLS_MAN_INITIALS, OE_HDR.ORD_DAT,
OE_HDR.SHIP_DAT FROM OE_HDR WHERE OE_HDR.ORD_NO= @ORD_NO">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="ORD_NO"
PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>

Here is the error I get on the webpage:

ERROR [42000] [Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC
Engine Interface]Syntax Error: SELECT OE_HDR.ORD_NO, OE_HDR.CUST_NAM,
OE_HDR.SLS_MAN_NO, OE_HDR.SLS_MAN_INITIALS, OE_HDR.ORD_DAT,
OE_HDR.SHIP_DAT FROM OE_HDR WHERE OE_HDR.ORD_NO= @<< ??? >>ORD_NO


Seems like the syntax for the variable in the WHERE portion of my
query is wrong. Any suggestions/help would be much appreciated.

Thank you!


Reply With Quote
  #2  
Old   
bryant@4dnssupport.com
 
Posts: n/a

Default Re: PSQL 2000i SP3 syntax error - .asp variable in a - 05-06-2007 , 11:16 AM






On May 5, 11:18 pm, bry... (AT) 4dnssupport (DOT) com wrote:
Quote:
Hi all.

The following query
displays the information I need in the gridview for a single record.

SELECT OE_HDR.ORD_NO, OE_HDR.CUST_NAM, OE_HDR.SLS_MAN_NO,
OE_HDR.SLS_MAN_INITIALS, OE_HDR.ORD_DAT, OE_HDR.SHIP_DAT
FROM OE_HDR WHERE (OE_HDR.ORD_NO='174310')

I also have DropDownList2 working properly. For the WHERE portion of
the query I would like to pass avariablethat references the value
of
DropDownList2

SELECT OE_HDR.ORD_NO, OE_HDR.CUST_NAM, OE_HDR.SLS_MAN_NO,
OE_HDR.SLS_MAN_INITIALS, OE_HDR.ORD_DAT, OE_HDR.SHIP_DAT
FROM OE_HDR WHERE (OE_HDR.ORD_NO= @ORD_NO)

Here is the code that is erroring out:

asp:SqlDataSource runat="server" ID="SqlDataSource2"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
SelectCommand="SELECT OE_HDR.ORD_NO, OE_HDR.CUST_NAM,
OE_HDR.SLS_MAN_NO, OE_HDR.SLS_MAN_INITIALS, OE_HDR.ORD_DAT,
OE_HDR.SHIP_DAT FROM OE_HDR WHERE OE_HDR.ORD_NO= @ORD_NO"
SelectParameters
asp:ControlParameter ControlID="DropDownList2" Name="ORD_NO"
PropertyName="SelectedValue"
Type="Int32" /
/SelectParameters
/asp:SqlDataSource

Here is the error I get on the webpage:

ERROR [42000] [Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC
Engine Interface]SyntaxError: SELECT OE_HDR.ORD_NO, OE_HDR.CUST_NAM,
OE_HDR.SLS_MAN_NO, OE_HDR.SLS_MAN_INITIALS, OE_HDR.ORD_DAT,
OE_HDR.SHIP_DAT FROM OE_HDR WHERE OE_HDR.ORD_NO= @<< ??? >>ORD_NO

Seems like thesyntaxfor thevariablein the WHERE portion of my
query is wrong. Any suggestions/help would be much appreciated.

Thank you!

I cant take credit for figuring this our, the answer can be found in
an original post of mine on the asp boards
http://groups.google.com/group/micro...b936cf3bbe8f9a



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.