Announcement

Collapse
No announcement yet.

Unauffindbarer SQL Syntaxerror

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unauffindbarer SQL Syntaxerror

    Hallo zusammen,

    ich bin seit einer halben Woche dran einen Syntaxfehler zun finden der mir mitgeteilt wird. Ich bekomme SQL statement error number -201. Hier ist der SQL Code:
    PHP Code:
                insert into ops_tmp(tmp_Mandanttmp_Klassetmp_Kassetmp_Kassengr,tmp_KassenName,tmp_Jahr,
                                    [
    B]tmp_Monattmp_Lfd_Nrtmp_Aufteiltmp_Beleg_Nrtmp_Belegdatum,[/B]
                                    
    tmp_Urs_DMtmp_Urs_Eurotmp_Ursaldotmp_Ursaldo_SH,
                                    
    tmp_Anz_Bewtmp_Lasts_DMtmp_Lasts_Eurotmp_Lastsaldo,
                                    
    tmp_Lasts_SHtmp_Lastsaldo_proz,tmp_Gesamts_S_DMtmp_Gesamts_S_EU,
                                    
    tmp_Gesamts_Stmp_Gesamts_H_DMtmp_Gesamts_H_EU,
                                    
    tmp_Gesamts_Htmp_Texttmp_Mahnstufetmp_Mahndat1,
                                    
    tmp_Mahndat2tmp_Mahndat3tmp_Mahn_KZtmp_Mahnform,
                                    
    tmp_Gemahnttmp_Mahnfäll,
                                    
    #050406
                                    
    tmp_Privat_Rechnrtmp_Ursaldo_Priv ,tmp_Lastsaldo_Priv ,tmp_bezahlt  ,
                                    
    #050406
                                    
    tmp_Film_Nrtmp_Gegen_Klasse,
                                    
    tmp_Kunden_Nrtmp_Kunden_Ik,tmp_Kundengrtmp_Rechnung_Nrtmp_Info_Key,
                                    
    tmp_Statustmp_opb_text_1,tmp_Rechnung_Nr_alt,tmp_Bemerktextetmp_Datenlieferung,tmp_Datei )
                            
    values(r_ops.ops_mandantr_ops.ops_klasser_ops.ops_ktonrr_ops.ops_gruppe,
                                    
    r_deb.deb_name_1,
                                    
    r_ops.ops_rg_jahrr_ops.ops_rg_monatr_ops.ops_rg_nrr_ops.ops_rg_aufteil,
                                    
    r_ops.ops_beleg_nrr_ops.ops_beleg_datr_ops.ops_ursaldo_dm,
                                    
    r_ops.ops_ursaldo_er_ops.ops_ursaldor_ops.ops_ur_shr_ops.ops_anzahl_bew,
                                    
    r_ops.ops_lastsaldo_dmr_ops.ops_lastsaldo_er_ops.ops_lastsaldo,
                                    
    r_ops.ops_last_sh,r_ops.ops_lastsaldo_proz,
                                    
    r_ops.ops_gessaldo_s_dmr_ops.ops_gessaldo_s_e,
                                    
    r_ops.ops_gessaldo_sr_ops.ops_gessaldo_h_dmr_ops.ops_gessaldo_h_e,
                                    
    r_ops.ops_gessaldo_hr_ops.ops_textr_ops.ops_mahnstufe,
                                    
    r_ops.ops_mahndat_1r_ops.ops_mahndat_2r_ops.ops_mahndat_3,
                                    
    r_ops.ops_mahn_kzr_ops.ops_mahn_formr_ops.ops_mahn_durchf,
                                    
    r_ops.ops_mahn_faellig,
                                     
    privat_rechnrursaldo_privlastsaldo_privbezahlt_jn,
                                    
    r_ops.ops_film_nrr_ops.ops_gegen_klasse,
                                    
    r_ops.ops_gegen_ktonr,r_kre.kre_ikr_ops.ops_gegen_grupper_ops.ops_rechnr,
                                    
    r_ops.ops_bmt_keyr_ops.ops_status,
                                    
    r_opb.opb_text_1rechnr_han_alt,r_icont.icont_info,datum_datlief,dat_datei
    Der Fehler wird mir mit der Zeile 1211 angezeigt welche die fett Markierte ist.
    Die Tabelle wird folgendermaßen erstellt:
    PHP Code:
                            create temp table ops_tmp(
                            
    tmp_Mandant smallinttmp_Klasse smallinttmp_Kasse integer,
                            
    tmp_Kassengr smallint,tmp_KassenName char(40), tmp_Jahr smallinttmp_Monat smallint,
                            
    tmp_Lfd_Nr smallinttmp_Aufteil smallinttmp_Beleg_Nr integer,
                            
    tmp_Belegdatum datetmp_Urs_DM moneytmp_Urs_Euro money,
                            
    tmp_Ursaldo moneytmp_Ursaldo_SH char(1), tmp_Anz_Bew smallint,
                            
    tmp_Lasts_DM moneytmp_Lasts_Euro moneytmp_Lastsaldo money,
                            
    tmp_Lasts_SH char(1), tmp_Lastsaldo_proz decimal(8,1),
                            
    tmp_Gesamts_S_DM moneytmp_Gesamts_S_EU money,
                            
    tmp_Gesamts_S moneytmp_Gesamts_H_DM moneytmp_Gesamts_H_EU money,
                            
    tmp_Gesamts_H moneytmp_Text char(13), tmp_Mahnstufe smallint,
                            
    tmp_Mahndat1 datetmp_Mahndat2 datetmp_Mahndat3 date,
                            
    tmp_Mahn_KZ smallinttmp_Mahnform smallinttmp_Gemahnt char(1),
                            
    tmp_Mahnfäll date,
                           
    #050406
                            
    tmp_Privat_Rechnr inttmp_Ursaldo_Priv money,tmp_Lastsaldo_Priv money,tmp_bezahlt char(1) ,
                            
    #050406
                            
    tmp_Film_Nr integertmp_Gegen_Klasse smallint,
                            
    tmp_Kunden_Nr integertmp_Kunden_Ik decimal(9,0),tmp_Kundengr smallint,
                            
    tmp_Rechnung_Nr char(20),
                            
    tmp_Info_Key integertmp_Status smallint,
                            
    tmp_opb_text_1 char(10), tmp_Rechnung_Nr_alt char(20),
                            
    tmp_Bemerktexte char(374)   ,
                            
    tmp_Datenlieferung date  ,
                            
    tmp_Datei char(12
    Ich hoffe jemand hat eine Idee. Der Fehler 201 ist nämlich alles andere als Aussagekräftig.
    -201 A syntax error has occurred.

    This general error message indicates mistakes in the form of an SQL statement. Look for missing or extra punctuation (such as missing or extra commas, omission of parentheses around a subquery, and so on), keywords misspelled (such as VALEUS for VALUES), keywords misused (such as SET in an INSERT statement or INTO in a subquery), keywords out of sequence (such as a condition of "value IS NOT" instead of "NOT value IS"), or a reserved word used as an identifier.

    Database servers that provide full NIST compliance do not reserve any words; queries that work with these database servers might fail and return error -201 when they are used with earlier versions of Informix database servers.

    The cause of this error might be an attempt to use round-robin syntax with CREATE INDEX or ALTER FRAGMENT INIT on an index. You cannot use round-robin indexes.

  • #2
    Locale-Einstellungen und Klammer

    Hi Chicky,

    zwei Dinge fallen mir auf:
    a) Erlaubt dein Ländercode Umlaute? Also wie ist die DB_Locale gesetzt?
    b) im Create-Statement fehlt eine abschließende Klammer

    Grüße
    estjump

    Comment


    • #3
      Hi estjump.

      also DB_LOCALE=de_de.8859-1. Die Klammer hatte ich vergessen zu kopieren. Die ist normal da. Sonst hätte ich den Fehler ja auch schon beim compilieren bekommen denke ich. Ich bekomme ihn aber erst wenn ich das Programm starte und die entsprechende Stelle erreicht ist.

      Also mit dem "ä" hatte ich auch schonmal überlegt, das war hier aber immer schon so.

      Gruß

      Comment


      • #4
        Also ich habe den Fehler behoben. Ich hab eine ältere Version eingespielt und die lief wieder. Leider habe ich immmer noch keinen Plan woran es nun lag.
        Danke dennoch

        Comment


        • #5
          Hi Chickey,

          wie soll das ein Außenstehender finden? Du hast ja noch nicht einmal Deine Versionsnummern angegeben. Außerdem sieht man nicht, wie die Werte aussehen, die eingespielt werden sollen. Du könntest ja mal versuchen den Fehler einzukreisen, indem Du bei VALUES in der betreffenden Zeile die Variablen durch Konstanten ersetzt (aber einzeln nacheinander).

          Gruß
          docendo discimus

          Comment

          Working...
          X