MySQL InnerJoin query syntax error?
I can't seem to locate the syntax error in this MySQL query. Coldfusion says there an error in my sql syntax. Here is the query. Anyone have any clues on this?
<cfquery name="queryItem" datasource="bonus">
select
p.productid,
p.modelnumber,
p.modeldescription,
sp.sp_bonusamount as Amount
from
products i join bonusproducts sp on i productid = sp.sp_productid
inner join program p on sp.sp_programid = p.programid
where
p.CompanyOrgLevelID in (#getParentCompanyOrgLevelIDList(session.CompanyOrgLevelID)#)
and p.ProgramID = #programID#
<cfif categoryID gt 0>
and CategoryID in (#getSubcategoryIDList(categoryID)#)
</cfif>
order by
#sortColumn# #sortDirection#
</cfquery>
To troubleshoot, run this:
select
p.productid,
p.modelnumber,
p.modeldescription,
sp.sp_bonusamount as Amount
from
products i join bonusproducts sp on i productid = sp.sp_productid
inner join program p on sp.sp_programid = p.programid
where 1 = 2
If it runs successfully, keep adding bits and pieces until it crashes. Then you'll know what made it crash.
Also enable debugging so you can see the sql that gets generated from your code. That's often useful.
Similar Messages
-
MySQL Stored Procedure Syntax Errors
I have an online application I would like to use transactions to either commit all db updates or none at all. The code I have created is as follows, not only am I getting a syntax error on lines 5 and 16, but quite frankly I am unsure the code will actually do what I want. Please let me know if you see the syntax errors and could explain them to me.
CREATE PROCEDURE increase_maint_priority
(maint_item INT, new_priority INT, cur_priority INT, center_id INT)
BEGIN
START TRANSACTION; -- line 5 syntax error
-- start updates
UPDATE maintitem SET priority = (priority+1)
WHERE priority > cur_priority
AND priority <= new_priority
AND centerID = center_id;
UPDATE maintitem SET priority = new_priority
WHERE id = maint_item;
COMMIT;
END; -- line 16 syntax error
Thank you in advance for helping a newb to stored procedures.
If you would like to help me figure out if this code will actually work for what I want the following describes the situation.
Main idea: business location managers submit requests for maintenance at their center. Requests can be added anywhere in the priority list (1=highest priority). They can also change the priority of a request at any time.
Previously I have been using php to control a loop of mysql update queries (yikes, I know now, 2 sql statements could do the trick) and lately we have been experiencing duplicate priorities, and other problems that seem to be most likely linked to the updating of priorities of multiple items.
Ex: moving priority item 6 to priority 1 requires 1 update query for the current 6th priority item, but a second query (or loop of several more since I was very new to sql statements at time of development 2 years ago) to update the other priorities.
Thus the desire for the transaction method.
Again, thanks in advance for any help on this issue.
P.S. - I am using MySQL workbench to write this and that's where I get the errors.Yes, of course.
DELIMITER //
CREATE PROCEDURE increase_maint_priority
(maint_item INT, new_priority INT, cur_priority INT, center_id INT)
BEGIN
START TRANSACTION;
-- start updates
UPDATE maintitem SET priority = (priority+1)
WHERE priority > cur_priority
AND priority <= new_priority
AND centerID = center_id;
UPDATE maintitem SET priority = new_priority
WHERE id = maint_item;
COMMIT;
END //
DELIMITER ;
Just so you're aware, the table name is actually in a slightly dfferent format: `db_name`.`table_name` I have just renamed it for privacy purposes. -
Select-options in SELECT query - syntax error
Hi all,
I get the error below when I try to use the select options in a SELECT query . Please help me.
"The IN operator with "SO_AWART" is followed neither by an internal
table nor by a value list."
The code i have used(Logical database PNP is used):
TABLES: pernr,
catsdb.
INCLUDE ztime_cwtr_top. " global Data
INCLUDE ztime_cwtr_f01.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
SELECT-OPTIONS SO_AWART FOR CATSDB-AWART.
PARAMETERS P_THRES TYPE I.
SELECTION-SCREEN END OF BLOCK B1.
Get data from CATSDB table. Workdates within the date interval are considered.
SELECT pernr workdate awart catsquantity beguz enduz status
FROM catsdb
INTO TABLE it_catsdb
WHERE pernr = pernr-pernr AND
workdate GE pn-begda AND
workdate LE pn-endda AND
status IN ('20', '30') AND
awart IN so_awart .
awart IN ('1100', '1137', '1138', '1139', '1140',
'1147', '1148', '1149', '1157', '2003' ).
when I give the values directly i do not get any syntax error, but when I use select options in the where condition I get the syntax error.
I have tried different options like using only the select-options in the where condition.
Thanks in advance.....
MadhuSolved.
Code with syntax error:
include z...top .
include z...fo1.
select-options: xxxxxxx
Code with no syntax error:
select-options: xxxxxxx
include z...top .
include z...fo1.
Thanks for all your help,
Madhu -
InfoSet Query: Syntax Error while generating the program.
Dear All,
I have a Query in CRM system which contains an Infoset based on LDB.
The InfoSet Query throws up a Syntax error while generating the program.
So, we are not able to change the Infoset using the Infoset Query through SQ01.
The error is as follows:-
Syntax error in program "AQZZ==/SAPQUERY/CRM_ACTMON1 ".
Error in the ABAP Application Program
The current ABAP program "CL_QUERY_OUTPUT_DEFINITION====CP" had to be
terminated because it has
come across a statement that unfortunately cannot be executed.
The following syntax error occurred in program "AQZZ==/SAPQUERY/CRM_ACTMON1 "
in include "AQZZ==/SAPQUERY/CRM_ACTMON1 " in
line 28:
""CRMT_REPORT_LOCATORLIST" must be a flat structure. You cannot use int"
"ernal tables, strings, references, or structures as components. -"
Please help me arrive at an solution, so that we are able to change the Infoset through the InfoSet Query.
Awaiting your reply as soon as possible.
Thanks and Regards,
Pankaj.There is an error in your query, specifically in the definition of CRMT_REPORT_LOCATORLIST. In the short dump (transaction ST22) you will see more details and the exact location of an error if you just scroll down.
I can't tell more because this problem is specific to your system, to which I have no access. Read the whole dump and look at all the objects mentioned there. -
Query syntax error after multiprovider change
Hi everyone,
I removed key figures from a multicube, changed a query on top afterwards and saved it. The key figures are no longer in the key figure list of the query in the Query designer, and are no longer used in any place within the query.
Now, I'm getting a syntax error on query execution, since the compiled query still contains a reference to the old key figures. Regeneration via RSRT or saving under a new name doesn't work, and to delete the generated report I need a developer key.
Any ideas?
Regards,
TilmanHi Shashank,
thanks for your response.
I did try the "check query" button, it didn't return an error. When executing the query via rsrt, I get a dump due to "Syntax error in program GP48VM7K0MSF08DRO2382A2PSTI ". The program still contains data type references to the removed infoobjects. When checking the program via SE38, you get just that syntax error.
I'm looking for a way to clean these things up. Even when creating a new query on the aggregation level (I was talking about a multiprovider earlier, which is located underneath), the error pops up. I activated all the objects along the way, with no effect.
Regards,
Tilman -
Hi,
I've a query for a report as below. I want distinct donor code whereas i have 2 or more customers with same name and i want to retrieve data of customers between specific donor codes.I've a syntax error where i give 'between' for the following syntax in the code
DONOR_TAB.DONOR_CODE BETWEEN DONOR_TAB.DONOR_CODE=:p_code AND DONOR_TAB.DONOR_CODE=:p_code
The following is the query:
SELECT ALL INITCAP(TITLE_TAB.TITLE_NAME||' '||DONOR_TAB.FIRST_NAME||' '||DONOR_TAB.MIDDLE_NAME||' '||DONOR_TAB.LAST_NAME) donor_name,
RTRIM(INITCAP(RPAD(DONOR_TAB.ADDRESS1, 35, ' ')||RPAD(DONOR_TAB.ADDRESS2, 35, ' ')||RPAD(DONOR_TAB.STREET, 30, ' '))) DISPLAY_COL2,
INITCAP(CITY_MASTER_TAB.CITY_NAME||' - '||DONOR_TAB.PIN) DISPLAY_COL3,
INITCAP(CITY_MASTER_TAB.STATE_NAME||', '||CITY_MASTER_TAB.COUNTRY_NAME) DISPLAY_COL4,
UPPER('DONOR CODE'||' - '||CITY_MASTER_TAB.CITY_NAME||'/'||DONOR_TAB.DONOR_CODE) DISPLAY_COL5
FROM DONOR_TAB, CITY_MASTER_TAB, TITLE_TAB, DONOR_PROG_TAB
WHERE donor_tab.donor_code = donor_prog_tab.donor_code AND DONOR_TAB.CITY_CODE = CITY_MASTER_TAB.CITY_CODE
AND DONOR_TAB.TITLE_CODE = TITLE_TAB.TITLE_CODE
OR DONOR_TAB.DONOR_CODE = :p_code
OR DONOR_TAB.DONOR_CODE BETWEEN DONOR_TAB.DONOR_CODE=:p_code AND DONOR_TAB.DONOR_CODE=:p_code
OR DONOR_TAB.LANG = :P_LANG
OR DONOR_TAB.REMINDER = :P_REMINDER
ORDER BY DONOR_TAB.DONOR_CODE
Can you help me as to how i rectify this error
ThanksSyntax is like this
DONOR_TAB.DONOR_CODE BETWEEN :p_code AND :p_code
Note:
You hav given initial and final values as same(p_code) -
Hi,
we have a syntax error in our JDOQL-namedQuery. We want to do a join over
two tables "TestOrder" and "TestOrderPosition" and get this error:
(we use Kodo 4.0)
<?xml version="1.0"?>
<jdoquery>
<package name="salt.domain.orderservice.entity">
<class name = "TestOrder">
<query name="findByOrderId">select where
testOrderPositions.contains(testOrderPosition) and
testOrderPosition.description==:t variables
salt.domain.orderservice.entity.TestOrderPosition testOrderPosition</query>
</class>
</package>
</jdoquery>
<4|false|4.0.0EA3> kodo.jdo.UserException: An error occurred while parsing the
query filter "testOrderPositions.contains(testOrderPosition) and
testOrderPosition.description==:t". Error message: The JDOQL string is not
valid. Make sure all parentheses are matched and that you use proper Java
syntax.
kodo.query.AbstractExpressionBuilder.parseException(AbstractExpressionBuilder.java:92)
kodo.query.jdoql.JDOQLExpressionBuilder.evalExpression(JDOQLExpressionBuilder.java:508)
kodo.query.jdoql.JDOQLExpressionBuilder.eval(JDOQLExpressionBuilder.java:265)
kodo.query.jdoql.JDOQLParser.eval(JDOQLParser.java:98)
kodo.query.ExpressionStoreQuery$DataStoreExecutor.<init>(ExpressionStoreQuery.java:542)
kodo.query.ExpressionStoreQuery.newDataStoreExecutor(ExpressionStoreQuery.java:154)
kodo.query.QueryImpl.createExecutor(QueryImpl.java:807)
kodo.query.QueryImpl.compileForDataStore(QueryImpl.java:741)
kodo.query.QueryImpl.compileForExecutor(QueryImpl.java:721)
kodo.query.QueryImpl.compile(QueryImpl.java:635)
kodo.kernel.BrokerImpl.namedQuery(BrokerImpl.java:3681)
kodo.kernel.DelegatingBroker.namedQuery(DelegatingBroker.java:1587)
kodo.jdo.PersistenceManagerImpl.newNamedQuery(PersistenceManagerImpl.java:1028)
salt.domain.orderservice.dao.jdo.JDOOrderRepositoryImpl.findOrderWithPositionById(JDOOrderRepositoryImpl.java:85)
salt.domain.orderservice.OrderRepositoryImpl.findOrderWithPositions(OrderRepositoryImpl.java:91)
salt.domain.orderservice.OrderServiceImpl.getOrderWithPosition(OrderServiceImpl.java:15)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
$Proxy0.getOrderWithPosition(Unknown Source)
salt.application.DddTestController.handleRequest(DddTestController.java:40)
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:717)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:658)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:347)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Does anyone have an idea?
Thanks,
Ingo SchneiderThanks for your help! It works now!
I have another problem with a very simple query:
I always get a ClassCastException with the follwoing query. If I left the
result parameter out the query works. Parameter "t" is an integer, but
there shouldn't be any cast problems between integer and long.
<?xml version="1.0"?>
<jdoquery>
<package name="salt.domain.orderservice.entity">
<class name="TestOrder">
<query name="findByOrderIdPosition">select idOrder where
idOrder==:t</query>
</class>
</package>
</jdoquery>
public class TestOrder implements Serializable{
private String description;
private long idOrder;
private Set testOrderPositions = new HashSet();
getters & setters...
java.lang.ClassCastException: java.lang.Long
salt.domain.orderservice.dao.jdo.JDOOrderRepositoryImpl.findOrderWithPositionById(JDOOrderRepositoryImpl.java:99)
salt.domain.orderservice.OrderRepositoryImpl.findOrderWithPositions(OrderRepositoryImpl.java:91)
salt.domain.orderservice.OrderServiceImpl.getOrderWithPosition(OrderServiceImpl.java:15)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
$Proxy0.getOrderWithPosition(Unknown Source)
salt.application.DddTestController.handleRequest(DddTestController.java:40)
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:717)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:658)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:347)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Thanks,
Ingo Schneider -
SQL query syntax error .......
I am using following query
SELECT PERNR VORNA NACHN GBDAT FROM PA0002
INTO CORRESPONDING FIELDS OF TABLE ITAB
WHERE UPPER( VORNA ) = UPPER( STRU_USERIP-VORNA )
AND ENDDA >= SY-DATUM
AND BEGDA <= SY-DATUM .
and I am geting syntax error as --
vorna is not valid comparison operator .
can anyone plz suggest me solution over this problem .Logic must be written,
The below logic is incomplete
Break your head and modify it
TABLES:pa0002.
DATA:itab TYPE TABLE OF pa0002.
DATA:wa TYPE pa0002.
DATA:lv_vorna TYPE pa0002-vorna.
DATA:ra_vorna TYPE RANGE OF pa0002-vorna.
DATA:wa_vorna LIKE LINE OF ra_vorna .
DATA:lv_index TYPE i.
DATA:offset TYPE i.
DATA:pa_vorna TYPE pa0002-vorna VALUE 'Frank'.
DATA:len TYPE i.
len = STRLEN( pa_vorna ).
MOVE pa_vorna TO lv_vorna.
TRANSLATE lv_vorna TO LOWER CASE.
wa_vorna-low = lv_vorna.
APPEND wa_vorna TO ra_vorna.
MOVE pa_vorna TO lv_vorna.
TRANSLATE lv_vorna TO UPPER CASE.
wa_vorna-low = lv_vorna.
APPEND wa_vorna TO ra_vorna.
wa_vorna-low = PA_VORNA.
APPEND wa_vorna TO ra_vorna.
TRANSLATE PA_VORNA TO LOWER CASE.
DO len TIMES.
lv_index = sy-index - 1.
offset = lv_index + 1.
DO len TIMES.
MOVE pa_vorna TO lv_vorna.
TRANSLATE lv_vorna+lv_index(offset) TO UPPER CASE.
wa_vorna-low = lv_vorna.
APPEND wa_vorna TO ra_vorna.
ADD 1 TO lv_index.
ENDDO.
ENDDO. -
MDX query : Syntax error at token 'NONEMPTYMEMBER'
Syntax error when executing this very simplified MDX query :
WITH
MEMBER [ANNEE].[YEAR1] AS
NONEMPTYMEMBER FY10
[FY10]
MEMBER [ANNEE].[YEAR2] AS
NONEMPTYMEMBER [FY10]
[FY10]
SELECT
{[YEAR1],[YEAR2]} ON COLUMNS
FROM [MICOPIGE.COM_MBU]
Syntax error in input MDX query on line 9 at token 'NONEMPTYMEMBER'
Note that line 9 "NONEMPTYMEMBER FY10" is a copy of line 4
No error if I delete line 4
Any help to understand and fix this error would be greatly appreciated.Precision : My goal is to reduce the 30mn duration of a complex MDX query with many calculated members, using the NONEMPTYMEMBER token.
-
I have a simple MDX query is shown in below:
SELECT [Accounts].[pv] ON ROWS,
[Reporting].Members ON COLUMNS
FROM RoggeBSO.Db
(please note that Accounts, pv and Reporting words are in square brackets)
When I execute this query on the MDX Script Editor (in EAS), I get the following syntax error:
Statement Executed with warnings.
Syntax error in input MDX Query on line 1 at token 'ON'
Unexpected Essbase error 1260052
I tried this on both ASO & BSO cubes but didn't work. Could anyone help please?
Regards
Chandra
Edited by: user2695091 on 22-Apr-2009 03:27SELECT {[Accounts].[pv]} ON ROWS,
{[Reporting].Members} ON COLUMNS
FROM RoggeBSO.Db -
XPATH Database Query Syntax in an Assign
Trying to get an XPATH Database query to work by assigning the Input variable value in a simple BPEL Process to my query condition. I keep getting invalid XPATH errors. I cannot seem to figure out how get write it out.
Here is what I have:
<from expression="orcl:query-database( 'select ename from emp where ename = bpws:getVariableData('inputVariable','payload','/client:ReadDBProcessRequest/client:input')' ,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')"/>
Here is my error:
Error(30): [Error ORABPEL-10039]: invalid xpath expression [Description]: in line 30 of "C:\OraBPELPM_1\integration\jdev\jdev\mywork\BPELws\ReadDB\ReadDB.bpel", xpath expression "orcl:query-database( 'select ename from emp where ename = bpws:getVariableData('inputVariable','payload','/client:ReadDBProcessRequest/client:input')' ,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')" specified in <from> is not valid, because XPath query syntax error. Syntax error while parsing xpath expression "orcl:query-database( 'select ename from emp where ename = bpws:getVariableData('inputVariable','payload','/client:ReadDBProcessRequest/client:input')' ,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')", at position "80" the exception is Expected: ). Please verify the xpath query "orcl:query-database( 'select ename from emp where ename = bpws:getVariableData('inputVariable','payload','/client:ReadDBProcessRequest/client:input')' ,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')" which is defined in BPEL process. . [Potential fix]: Please make sure the expression is valid.
Any help?
Thanks!!!Ok. I have figured out how to place the condition (variable value) inside a concatentated string. So my final result is the actual XPATH Query-Database statement. But the problem is it is being returned as a String. How can I turn that final string into the XPATH expression I need? I suspect another <COPY> block could pull this off but I am not sure how to do it.
Here is my code:
<process name="QueryBuild" targetNamespace="http://xmlns.oracle.com/QueryBuild" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:ns1="http://www.w3.org/2001/XMLSchema" xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:client="http://xmlns.oracle.com/QueryBuild" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
<partnerLinks>
<partnerLink name="client" partnerLinkType="client:QueryBuild" myRole="QueryBuildProvider"/>
</partnerLinks>
<variables>
<variable name="inputVariable" messageType="client:QueryBuildRequestMessage"/>
<variable name="outputVariable" messageType="client:QueryBuildResponseMessage"/>
<variable name="QueryText" type="ns1:string"/>
</variables>
<sequence name="main">
<receive name="receiveInput" partnerLink="client" portType="client:QueryBuild" operation="process" variable="inputVariable" createInstance="yes"/><!-- Generate reply to synchronous request -->
<assign name="Assign_1">
<copy>
<from expression="concat("orcl:query-database('select ename from emp where empno = ", bpws:getVariableData('inputVariable','payload','/client:QueryBuildProcessRequest/client:input'), ",false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL)'")"/>
<to variable="QueryText"/>
</copy>
<copy>
<from variable="QueryText"/>
<to variable="outputVariable" part="payload" query="/client:QueryBuildProcessResponse/client:result"/>
</copy>
</assign>
<reply name="replyOutput" partnerLink="client" portType="client:QueryBuild" operation="process" variable="outputVariable"/>
</sequence>
</process> -
Syntax error when adding variables in recordset (query)
MySql,PHP,Dreamweaver,WindowsVista
Hi I am receiving a syntax error: invalid quantifier ++ $orderNum;s*?> when adding two variables in the recordset (query) dialog box. I get the error when clicking OK.
Here is what is entered:
name: fieldname
type: text
default: -1
runtime value: $_GET['Field']
name: searchvalue
type:text
default: -1
runtime value: $_GET['Search']
Can anyone help with this?That's a completely separate issue. The error message is telling you that you have not defined the testing server correctly in the Site Definition dialog box.
The Host directory field and URL prefix should both point to the same place, in other words, the root of your website. Host directory is the physical path, while URL prefix is the address you would put in a browser address bar.
Select Site > Manage Sites. Select the name of the site, and click the Edit button. In the Site Definition dialog box, select the Advanced tab, and then choose Testing server from the Category list on the left.
Depending on how your remote login works, Host directory should probably be public_html or just /. Use the same value as in the Remote server part of the Site Definition dialog box. The URL prefix should be http://gaylehansen.aisites.com/. -
MySQL syntax error with TestStand 4.0 database logging
I had been using MS Access database to log results which worked fine but the access database is too limited. Switched to MySql. Database works fine and I can query it from Visual C++ and was able to create all my result tables fine from TestStand.
I get a syntax error when actually trying to log results and it has to do with either a missing quote or and extra quote, I can't quite tell. I thought I saw a post on this somewhere but can't find it now. Here is the complaint from TestStand:
An error occurred calling 'LogOneResult' in 'ITSDBLog' of 'zNI TestStand Database Logging'
An error occurred executing a statement.
Statement: UUT_RESULT.
[MySQL][ODBC 3.51 Driver][mysqld-5.0.45-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT VALUES' at line 1
Description: [MySQL][ODBC 3.51 Driver][mysqld-5.0.45-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT VALUES' at line 1
Number: -2147467259
NativeError: 1064
SQLState: 37000
Reported by: Microsoft OLE DB Provider for ODBC Drivers
Description: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
Number: -2147217887
NativeError: 0
SQLState: 37000
Reported by: Microsoft OLE DB Provider for ODBC Drivers
Source: TSDBLog
And here is all that appears in the MySql logfile:
INSERT INTO UUT_RESULT DEFAULT VALUES
070914
You can't see it here but the string is truncated after the word VALUES. The next line starts with the odd number.
Any ideas?
Thanks,
Bill Peters
BAE SYSTEMSSure. There were two bugs in the ini file that contains the default TS schemas (I think it was Default_Database_Options.ini or like that...).
Anyway the table description for STEP_NUMERICLIMIT had for it's command line INSERT INTO MEAS_NUMERICLIMIT. I guess TestStand looked at that and said hmm I better create that table too. Then later down the page when you try to create MEAS_NUMERICLIMIT it says the table already exists even though it is empty. The generate SQL button builds a bad file and then the database viewer creates a bad database. I would have to go into MySql and drop the database. I had to save the schema under a custom name, edit it read it back in, generate a new SQL file, but then it would still fail validation because the ini files don't get updated until you exit TestStand. So basically I did this process 3 times before I got it right.
It's wasn't a big deal but it's amazing how a little thing can cause a lot of work.
The second bug, I'm not certain was initially in the file or somehow got set on the fly. There was a random int statement at the very end of the SQL table description for UUT_RESULT. It was also in the schema INI file. Since the int had no name and occurred in a odd place, it created a syntax error in MySql. Same fix as above.
But like I said it's working great now. I like this approach because I serve it to the net with Apache and parse the database with simple PHP scripts.
Thanks,
Bill Peters
BAE SYSTEMS -
Syntax error while writing a select query.
Hi all,
I have a requirement where I have to pick a value if the text for that value is
MYCARu2019S Lovliest Car.
And so I wrote a query that
SELECT RUECK INTO XRUECK FROM AFVC WHERE ltxa1 = ' MYCARu2019S Lovliest Car'.
ENDSELECT.
But it gives me a syntax error saying
u201CLiterals taking up more than one line not permittedu201D.
Can some one tell me what is wrong. I need to select RUECK value from AFVC table if
ltxa1 value is ' MYCARu2019S Lovliest Car'.
Kindly help what is going wrong...
Regards,
Jessica SamHi,
Narendran is right use two single quotes.
also careful wile comparing string. i think as you write ltxa1 value is ' MYCARu2019S Lovliest Car'.
so while comparing you must not use space just before staring use the following
SELECT rueck INTO xrueck FROM afvc WHERE ltxa1 = 'MYCAR''S Lovliest Car'. " Not use Space before M
ENDSELECT.
Hope will help you.
Kind Regards,
Faisal -
Can not use SUM in a simple query because of a syntax error?
Hi
Thank you for reading my post.
I am trying to execute the following query:
q = em.createQuery("SELECT SUM((NE.pipeLength - 0.6)+((NE.networkDepth-NE.initialDepth)*0.41)+ NE.standLenght) FROM NExpansion NE where (( NE.contract.contractor=:contractor) AND (NE.pDiameter=:diameter))");
q.setParameter("contractor", contractor);
q.setParameter("diameter", diameter);
l = (Long) q.getSingleResult();And I get the following error:
Caused by: Exception [TOPLINK-8025] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.EJBQLException
Exception Description: Syntax error parsing the query [SELECT SUM((NE.pipeLength - 0.6)+((NE.networkDepth-NE.initialDepth)*0.41)+ NE.standLenght) FROM NExpansion NE where (( NE.contract.contractor=:contractor) AND (NE.pDiameter=:diameter))], line 1, column 12: unexpected token [(].
Internal Exception: line 1:12: unexpected token: (
at oracle.toplink.essentials.exceptions.EJBQLException.unexpectedToken(EJBQLException.java:389)
at oracle.toplink.essentials.internal.parsing.ejbql.EJBQLParser.handleANTLRException(EJBQLParser.java:350)
at oracle.toplink.essentials.internal.parsing.ejbql.EJBQLParser.addError(EJBQLParser.java:278)
at oracle.toplink.essentials.internal.parsing.ejbql.EJBQLParser.reportError(EJBQLParser.java:378)
at oracle.toplink.essentials.internal.parsing.ejbql.antlr273.EJBQLParser.aggregateExpression(EJBQLParser.java:1416)
at oracle.toplink.essentials.internal.parsing.ejbql.antlr273.EJBQLParser.selectExpression(EJBQLParser.java:1158)
at oracle.toplink.essentials.internal.parsing.ejbql.antlr273.EJBQLParser.selectClause(EJBQLParser.java:403)
at oracle.toplink.essentials.internal.parsing.ejbql.antlr273.EJBQLParser.selectStatement(EJBQLParser.java:178)
at oracle.toplink.essentials.internal.parsing.ejbql.antlr273.EJBQLParser.document(EJBQLParser.java:135)
at oracle.toplink.essentials.internal.parsing.ejbql.EJBQLParser.parse(EJBQLParser.java:166)
at oracle.toplink.essentials.internal.parsing.ejbql.EJBQLParser.buildParseTree(EJBQLParser.java:127)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:215)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:189)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:153)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.<init>(EJBQueryImpl.java:114)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.<init>(EJBQueryImpl.java:99)
at oracle.toplink.essentials.internal.ejb.cmp3.EJBQueryImpl.<init>(EJBQueryImpl.java:86)
at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl.createQuery(EntityManagerImpl.java:204)
... 30 more
Caused by: line 1:12: unexpected token: (
at oracle.toplink.essentials.internal.parsing.ejbql.antlr273.EJBQLParser.aggregateExpression(EJBQLParser.java:1365)
... 43 morePlease let me know what am I doing wrong?
Thanks.Hello,
From the grammar in the JPA spec, SUM only takes a state_field_path_expression which is defined as
state_field_path_expression := {identification_variable | single_valued_association_path_expression}.state_field
Please feel free to file an enhancement to have this expanded upon.
Best Regards,
Chris
Maybe you are looking for
-
How to use different pageFormats while printing in the same book object.
Hi All, I m able to print Multiple pages, but the problem is when i want print multple pages with different pageformates I mean One pages having 4X2" size and another one is 5X5", while print second page objects not appears properly Pls see the below
-
Best practice for backing bean population? (also, ActionListener RANT)
Hello, I am about 3/4 of the way through development of a small to medium size JSF application. Sometimes I really like JSF, but much of the time I am left puzzled or frustrated for hours trying to find workarounds to JSF's bugs/glitches and design f
-
Sync w/entourage x, iCal version 2.0.5 & most current version of iCal
PowerBook G4 (work computer) -Entourage X (I use calendar & contacts from the applicaiton everyday) - iCal version 2.0.5 **currently I am importing my Entourage calendar into my iCal and exporting my contacts from Entorage and importing them into Add
-
Geforce 4 MX460-VTP vs ECS K7S5A
Hi there - here are my current system specs. K7S5A rev1 MoBo with NEW BIOS update (as of today) Athlon XP 1700+ with Zalman Flower Cooler 256Mb SDRAM Creative Riva TNT2 32Mb AGP graphics Creative Live Value Sound Card Creative Blaster 56K Modem (bran
-
System is getting hanged while creating Adobe Form Layout
Hello, I have Adobe Lifecycle Designer and Adobe Document Service Installed on our server, i have created Adobe form interface in transaction SFP and then a new form created with this interface passing the parameter carrid. While creating from layout