Autor Beitrag
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Fr 06.06.03 02:46 
wer sieht hier einen Fehler?

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
ALTER PROCEDURE RECEINGPROC (
    ID_RECKOPF_PAR INTEGER,
    ID_KUNDE_PAR INTEGER,
    ID_ART_PAR INTEGER,
    ID_RAB_PAR INTEGER,
    ID_KUART_PAR INTEGER,
    GRATIS SMALLINT,
    VKPREIS NUMERIC(9,2),
    EKPREIS NUMERIC(9,2),
    VORSKONTO NUMERIC(9,2),
    STATPREIS NUMERIC(9,2),
    RG NUMERIC(9,2))
AS
BEGIN
  INSERT INTO rec8 values (ID_RECKOPF_PAR,ID_ART_PAR,0,0,0,0,0,0,0,0,0);
  SUSPEND;
END;


Angeblich ist ID_RECKOPF_PAR nicht definiert?

_________________
Gruß
Hansa
Lemmy
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 792
Erhaltene Danke: 49

Windows 7 / 10; CentOS 7; LinuxMint
Delphi 7-XE10.1, VS 2015
BeitragVerfasst: Fr 06.06.03 07:42 
Hi Hansa,

mach mal VOR die Variablen (im insert) einen Doppelpunkt.

Grüße
Lemmy
hansa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Fr 06.06.03 19:15 
Hi Lemmy, ich Depp. Nur wie macht man das, wenn es keine Variablen sind? Wie in dem Beispiel mit den Nullen?

_________________
Gruß
Hansa
Lemmy
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 792
Erhaltene Danke: 49

Windows 7 / 10; CentOS 7; LinuxMint
Delphi 7-XE10.1, VS 2015
BeitragVerfasst: Di 10.06.03 09:09 
Hi Hansa,

die sollten eigentlich so funktionieren, wenn die Spalte vom entsprechenden Typ ist (also kein String).

Grüße
Lemmy
hansa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: So 15.06.03 12:15 
komme nicht weiter, was ist hier falsch :

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
ALTER PROCEDURE RECEINGPROC (
    ID_RECKOPF_PAR INTEGER,
    ID_KUNDE_PAR INTEGER,
    ID_ART_PAR INTEGER,
    VKPREIS NUMERIC(9,2))
AS
BEGIN 
  INSERT INTO rec8 values (:ID_RECKOPF_PAR,:ID_KUNDE_PAR,:ID_ART_PAR,:VKPREIS);
  SUSPEND; 
END;


dann kommt diese Fehlermeldung:

ausblenden Quelltext
1:
2:
3:
4:
An error was found in the application program input parameters for the SQL statement.
Dynamic SQL Error.
SQL error code = -804.
Count of read-write columns does not equal count of value

_________________
Gruß
Hansa
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: So 15.06.03 15:06 
das is ziemlich einfach: Wenn Du eine Insert-Anweisung so schreibst:
ausblenden Quelltext
1:
INSERT INTO tabelle VALUES (...)					

musst Du in Values genau dieselben Felder in genau der Reihenfolge, wie sie in den Meta-Daten stehen belegen. Willst Du nur ein paar belegen, dann musst Du in Klammern hinter der Tabellennamen die Feldnamen mit Kommata getrennt schreiben und entsprechend dann in Values die zugehörigen Werte.
hansa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: So 15.06.03 16:21 
aber genau so steht es doch da. :hair: Er beschwert sich über die Anzahl der Parameter und das sind genau 4. Da ist irgendwo ein prinzipieller Fehler drin, den ich nicht sehe.

_________________
Gruß
Hansa
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: So 15.06.03 16:28 
Lies mal meinen Text genauer durch, dann verstehst Du es: Es geht nicht um die Anzahl der Parameter, die die Prozedur hat, sondern um die Anzahl der übergebenen Werte, die INSERT INTO erwartet. Du musst innerhalb der Procedure etwas wie folgt schreiben:
ausblenden Quelltext
1:
INSERT INTO rec8(RECKOPF,KUNDE,ART,PREIS) values (:ID_RECKOPF_PAR,:ID_KUNDE_PAR,:ID_ART_PAR,:VKPREIS);					

wenn ich Deine Feldnamen jetzt richtig gedeutet habe.
hansa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Di 17.06.03 18:10 
Thx, die Prozedur steht jetzt in der DB, aber auf Delphi-Seite gehts weiter: "PROCEDURE NOT FOUND". Bei Execute XY. Es sollen nur Daten eingetragen werden. Ich habe eine StoredProc. Komponente auf der Form rumliegen, aber wie gehts jetzt weiter ? Der DataSource kann ich die nicht zuordnen, bzw. wie führe ich die jetzt aus?

_________________
Gruß
Hansa
hansa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Di 17.06.03 19:03 
Is ja schon gut. 8) Es heißt "Execute procedure XY" Nur was haben die Parameter jetzt zu sagen ?

_________________
Gruß
Hansa