cancel
Showing results for 
Search instead for 
Did you mean: 

Unsupported Nested query in Ultralite database

Former Member
0 Kudos
6,636

I am using a Ultralite database file in SQL Anywhre to operate on. Getting the following error.

***Could not execute statement.
[UltraLite Database] Syntax error near 'Could'  [SQL Offset: 1099]
SQLCODE=-131, ODBC 3 State="42000"
Line 1, column 1***

The query:

SELECT COUNT() FROM RepPR                                                                         
JOIN RepPrPatient AS cust ON RepPR.PRGUID = cust.PRGUID                                                         
JOIN SFAFormDefinition AS sfd ON RepPR.FormDefKey = sfd.FormDefKey                                              
JOIN SfaTherapyType AS th ON sfd.TherapyTypeID = th.TherapyTypeID                                               
JOIN RepPrAccess AS pg ON RepPR.PRGUID = pg.PRGUID                                                                                                             
LEFT OUTER JOIN RepPrFacility AS fac ON RepPR.PRGUID = fac.PRGUID                                               
LEFT OUTER JOIN RepPrImpPhysician AS iphys ON RepPR.PRGUID = iphys.PRGUID                                       
LEFT OUTER JOIN RepPrDevice ON RepPR.PRGUID = RepPrDevice.PRGUID AND(RepPrDevice.DeviceTypeID = 100 OR RepPrDevice.DeviceTypeID = 104)                                                                                  
JOIN RepPrState AS st ON RepPR.PRStateID = st.PRStateID 
INNER JOIN ((SELECT prguid, LastName AS  RepFromLastName, FirstName AS  RepFromFirstName FROM RepPrAccess, SfaIrisUser WHERE 
rtrim(SfaIrisUser.RepSAPID) = rtrim(RepPrAccess.SAPID))
WHERE (RepPR.PRStateID <> 1) AND(pg.RepRoleID = 1) AND (PRRegionSAPID = 'UCP')

Upon searching I found few limitations for ultralite as it does not support Nested query. Is there any other way to test the query? Can I convert the .udb file to any other database file so that it gets me results to check.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

You should be able to run the ULUNLOAD command line utility with the -s flag to generate a SQL file, create an empty SQL Anywhere Server database and read the SQL file with DBISQL. (Or you could use the Unload Database tool from the UltraLite plug-in in Sybase Central to get your SQL file). Then try your query on the SQL Anywhere Server database.

There are no other "conversion" utilities shipped with SA that could turn the UltraLite database into anything else.