If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > Pervasive SQL 9.5 dynamic parameters in SELECT problem.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-03-08, 13:58
genius2003 genius2003 is offline
Registered User
 
Join Date: Mar 2008
Posts: 2
Pervasive SQL 9.5 dynamic parameters in SELECT problem.

Hello.

I have to use dynamic parameters in my SELECT statement as follows

Code:
SELECT person0_.Id as Id0_0_, person0_.First_Name as First2_0_0_
  FROM Person person0_
  WHERE person0_.Id=?p0; p0 = '104101361'
Unfortunately, this leads to

Code:
[LNA][Pervasive][ODBC Engine Interface]Syntax Error:
SELECT person0_.Id as Id0_0_, person0_.First_Name as First2_0_0_
  FROM Person person0_
  WHERE person0_.Id=?p<< ??? >>0
If anyone has an idea of how it could be overcome, please let me know.

P.S. Select statement looks cryptic, because it is generated by one tool (NHibernate, in particular).

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 03-03-08, 16:31
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
Pervasive does support parameters in queries but the syntax is different. For example:
SELECT * FROM CLASS WHERE ID = ?
It seems that NHibernate is generating a query that isn't supported by PSQL. You'll probably need to create your own dialect for NHibernate. A quick search shows that PSQL isn't supported natively.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #3 (permalink)  
Old 03-03-08, 18:44
genius2003 genius2003 is offline
Registered User
 
Join Date: Mar 2008
Posts: 2
Thank you.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On