|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
SQL error in Firebird 2.0
hi everybody
i use a software for business intelligence this software has a warehouse built on a database but i want to use firebird for datawarehouse now this software i use needs some records for expalme this query: SELECT concat(concat(WHTBLME.WHTBLME_CODICE,'§§'),WHTBLME.WHTBLME_DESCRIZIONE) AS D_001020_COD_TAB_ME, concat(concat(WHTBLME.WHTBLME_DESCRIZIONE,'§§'),WHTBLME.WHTBLME_CODICE) AS K_D_001020_COD_TAB_ME, concat(concat(WHART.WHART_CODICE,'§§'),WHART.WHART_DESCRIZIONE) AS D_001010_COD_ART, concat(concat(WHART.WHART_DESCRIZIONE,'§§'),WHART.WHART_CODICE) AS K_D_001010_COD_ART, sum( WHFMFAT.FMFAT_IMP_EUR ) AS M_000_001_VAL_FAT_EUR, sum(0.0000000000) AS M_001_001_VAL_FAT_EUR FROM WHTBLME WHTBLME, WHFMFAT WHFMFAT, WHART WHART WHERE WHTBLME.WHTBLME_CODICE=WHFMFAT.FMFAT_TAB_ME AND WHTBLME.WHTBLME_DIT=WHFMFAT.FMFAT_DIT AND cast(WHFMFAT.FMFAT_ART as char(15)) =WHART.WHART_CODICE AND WHART.WHART_DIT=cast(WHFMFAT.FMFAT_DIT as char(3)) AND (WHFMFAT.FMFAT_DATE between {d '2006-01-01'} AND {d '2006-04-30'}) GROUP BY WHTBLME.WHTBLME_CODICE, WHTBLME.WHTBLME_DESCRIZIONE, WHART.WHART_CODICE, WHART.WHART_DESCRIZIONE UNION ALL SELECT concat(concat(WHTBLME.WHTBLME_CODICE,'§§'),WHTBLME.WHTBLME_DESCRIZIONE) AS D_001020_COD_TAB_ME, concat(concat(WHTBLME.WHTBLME_DESCRIZIONE,'§§'),WHTBLME.WHTBLME_CODICE) AS K_D_001020_COD_TAB_ME, concat(concat(WHART.WHART_CODICE,'§§'),WHART.WHART_DESCRIZIONE) AS D_001010_COD_ART, concat(concat(WHART.WHART_DESCRIZIONE,'§§'),WHART.WHART_CODICE) AS K_D_001010_COD_ART, sum(0.0000000000) AS M_000_001_VAL_FAT_EUR, sum( WHFMFAT.FMFAT_IMP_EUR ) AS M_001_001_VAL_FAT_EUR FROM WHTBLME WHTBLME, WHFMFAT WHFMFAT, WHART WHART WHERE WHTBLME.WHTBLME_CODICE=WHFMFAT.FMFAT_TAB_ME AND WHTBLME.WHTBLME_DIT=WHFMFAT.FMFAT_DIT AND cast(WHFMFAT.FMFAT_ART as char(15)) =WHART.WHART_CODICE AND WHART.WHART_DIT=cast(WHFMFAT.FMFAT_DIT as char(3)) AND (WHFMFAT.FMFAT_DATE between {d '2007-01-01'} AND {d '2007-04-30'}) GROUP BY WHTBLME.WHTBLME_CODICE, WHTBLME.WHTBLME_DESCRIZIONE, WHART.WHART_CODICE, WHART.WHART_DESCRIZIONE the software didnt work because an error occurred i pasted the query into Interbase & Firebird Sql Manager and returns me this error fmIBSQLScript.DataSet.SelectQuery: Invalid token. Dynamic SQL Error. SQL error code = -104. Token unknown - line 15, column 37. '2006-01-01'. i tried the same query with another date format, but doesnt work by the way, the software successfull connect to the firebirdDB, indeed he let me explore the table records please any suggest or help? thanks a lot Tony |
|
#2
|
|||||
|
|||||
|
First of all, use proper code formatting with or without syntax highlingting, then you have invalid chars in your query
sql Code:
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
|
#3
|
|||
|
|||
|
thanks but...
now seems that there is another problem
fmIBSQLScript.DataSet.SelectQuery: An error was found in the application program input parameters for the SQL statement. Dynamic SQL Error. SQL error code = .804. Function unknown. CONCAT. is there any list of all SQL commands that are not supported by Firebird 2.0? thanks again buddies |
|
#4
|
|||
|
|||
|
oops...
sorry
i'm really a noob i made the correction i used (WHTBLME.WHTBLME_CODICE+'§§'+WHTBLME.WHTBLME_DESCRIZIONE) AS D_001020_COD_TAB_ME, (WHTBLME.WHTBLME_DESCRIZIONE+'§§'+WHTBLME.WHTBLME_CODICE) AS K_D_001020_COD_TAB_ME, (WHART.WHART_CODICE+'§§'+WHART.WHART_DESCRIZIONE) AS D_001010_COD_ART, (WHART.WHART_DESCRIZIONE+'§§'+WHART.WHART_CODICE) AS K_D_001010_COD_ART, instead of the CONCAT command but anyway... now there is another error... is it correct to use +??? thanks again |
|
#5
|
||||
|
||||
|
Would you mind telling us from which database are you porting this query to Firebird?
Note that the SQL standard concatenation operator is || |
|
#6
|
|||
|
|||
|
i cannot use +???
|
|
#7
|
||||
|
||||
|
Did you answer my questions?
|
|
#8
|
|||
|
|||
|
sorry, i forgot to answer
it's a software that generates SQL queries this queries are supported by DBmaker |
|
#9
|
||||
|
||||
|
Quote:
|
|
#10
|
|||
|
|||
|
really thanks a lot
i solved my problem thaaanks |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > SQL error in Firebird 2.0 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|