Source language: Translate to:

dbpQuery limitation

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

dbpQuery limitation

Postby stu » Wed Jul 16, 2014 4:05 pm

Im trying to execute the following query to the db but its not working, I figure my SQL sintax its not possible since it includes AND twice... Is there any way of doing this through another method?

Syntax: [ Download ] [ Hide ]
Using Neobook Syntax Highlighting
dbpQuery "DBID" "orderdetail" "ORDERRENTEDBY LIKE [#34][DBID.USERS.USERNAME][#34] AND FEE = 1 AND ORDERDATERETURNED IS NULL"
Parsed in 0.005 seconds, using GeSHi 1.0.8.10


Thanks.

----

Sorry about this, I found my answer on a similar question over Stackoverflow...

Syntax: [ Download ] [ Hide ]
Using SQL Syntax Highlighting
SELECT *
FROM  `orderdetail`
WHERE  `ORDERRENTEDBY` LIKE  "[#34][DBID.USERS.USERNAME][#34]"
AND  `ORDERDATERETURNED` IS NULL
AND  `FEE` =1
Parsed in 0.005 seconds, using GeSHi 1.0.8.10
Last edited by stu on Wed Jul 16, 2014 4:33 pm, edited 1 time in total.
User avatar
stu
 
Posts: 320
Joined: Wed Aug 07, 2013 11:37 am

Re: dbpQuery limitation

Postby Gaev » Wed Jul 16, 2014 4:32 pm

stu:

Try and place the conditions within brackets like this ...
Code: Select all
dbpQuery "DBID" "orderdetail" "(ORDERRENTEDBY LIKE [#34][DBID.USERS.USERNAME][#34]) AND (FEE = 1) AND (ORDERDATERETURNED IS NULL)"


It is not clear what you mean when you say "but its not working" ... you might want to provide details of what the value of [DBID.USERS.USERNAME] is ... and what the expected/actual results are.
User avatar
Gaev
 
Posts: 3738
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: dbpQuery limitation

Postby stu » Wed Jul 16, 2014 4:35 pm

Thanks for your reply, yeah I just used dbpexecsql instead, I wil try your suggestion it was probably a missing char or something. Thanks again.
User avatar
stu
 
Posts: 320
Joined: Wed Aug 07, 2013 11:37 am


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 2 guests