Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Bases";
Current archive: 2004.12.12;
Download: [xml.tar.bz2];

Down

Problem with parameter return to TADOStoredProc Find similar branches


alsov1   (2004-11-15 13:23) [0]

Greetings Master!

That's the problem
There is a procedure
CREATE or replace PROCEDURE Addtest (
HowMany in number,
now in timestamp,
nowdate out timestamp)

is BEGIN
declare
i number;
begin
for i in 1..HowMany loop

insert into test
values
(dbms_Random.STRING ("p", 20),
dbms_Random.normal,
now);

end loop;
nowdate: = sysdate;
commit;
end;
END;
/

I call it from Delphi using TADOStoredProc like this

Proc.ProcedureName: = "ADDTEST";
proc.Parameters.Clear;
for i: = 0 to 2 do
Proc.Parameters.AddParameter;

Proc.Parameters.Items [0] .Value: = "10";
Proc.Parameters.Items [1] .Value: = "10.10.04/10/34 09:XNUMX:XNUMX";
Proc.Parameters.Items [2] .DataType: = ftTimeStamp;
Proc.Parameters.Items [2] .Direction: = pdOutput;

proc.Prepared: = true;
proc.ExecProc;

Doesn't want to work - swears
Moreover, if there is no third paramatra in the procedure (nowdate out timestamp; naturally, it is not registered in delphi), then everything works fine.

And as soon as you declare the returned parameter - here everything is bad.

Tell me what is the mistake?

Thanks in advance



Соловьев ©   (2004-11-15 13:29) [1]


> nowdate out timestamp)

nowdate timestamp output)

?



Соловьев ©   (2004-11-15 13:30) [2]


> nowdate: = sysdate;

set nowdate = sysdate



alsov1   (2004-11-15 15:13) [3]

The procedure compiles and works, but doesn’t even think in your way
DBMS - I have Oracle.

The problem is calling the procedure from Delphi.



Соловьев ©   (2004-11-15 15:22) [4]


> DBMS - Oracle at me.

Well, you have to write right away :) here I am not an expert ...



alsov1   (2004-11-15 15:25) [5]

So a call from delphi using TADOStoredProc should be the same for any supported DBMS.



Соловьев ©   (2004-11-15 15:42) [6]


> Proc.ProcedureName: = "ADDTEST";
> proc.Parameters.Clear;
> for i: = 0 to 2 do
> Proc.Parameters.AddParameter;
>
> Proc.Parameters.Items [0] .Value: = "10";
> Proc.Parameters.Items [1] .Value: = "10.10.04 10:34:09";
> Proc.Parameters.Items [2] .DataType: = ftTimeStamp;
> Proc.Parameters.Items [2] .Direction: = pdOutput;
>
> proc.Prepared: = true;
> proc.ExecProc;


And if everything is set up in the design time? Works?



alsov1   (2004-11-15 16:59) [7]

in design time doesn’t want either



alsov1   (2004-11-15 18:11) [8]

Figured out
it turns out timestamp in delfs is
Proc.Parameters.Items [2] .DataType: = ftString

damn not humanly somehow :(



Pages: 1 whole branch

Forum: "Bases";
Current archive: 2004.12.12;
Download: [xml.tar.bz2];

Top





Memory: 0.57 MB
Time: 0.052 c
1-1101802891
Grisha
2004-11-30 11:21
2004.12.12
File scan


14-1100855778
WondeRu
2004-11-19 12:16
2004.12.12
Something from the army VS. Graduate School


3-1100080243
WolandUSSR
2004-11-10 12:50
2004.12.12
QLE Object + Access


14-1101352312
Dumkin
2004-11-25 06:11
2004.12.12
Happy Birthday! 25 November


6-1096974106
Algol
2004-10-05 15:01
2004.12.12
FTP file change dates





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic Indonesian Irish italian Japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Spanish swahili Swedish ภาษาไทย turkish Ukrainian urdu Tiếng Việt welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada Khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish