BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Can I create Oracle Stored procedure via Delphi ?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Edgar
Guest





PostPosted: Wed Sep 10, 2003 11:28 pm    Post subject: Can I create Oracle Stored procedure via Delphi ? Reply with quote



Can I create Oracle Stored procedure via Delphi ?

I try with TQuery control but when i have an assigment statement fails....

Error: Field '=' is of unknown type

example:

query.sql.add('CREATE OR REPLACE PROCEDURE EX AS ') ;
query.sql.add(' vgProceso NUMBER ; ') ;
query.sql.add(' BEGIN' ) ;
query.sql.add(' vgProceso := 200 ;') ;
......
query.sql.add('END EX') ;
query.execsql ;


How to do ???



Back to top
Ping Kam
Guest





PostPosted: Thu Sep 11, 2003 12:07 am    Post subject: Re: Can I create Oracle Stored procedure via Delphi ? Reply with quote



"Edgar" <jira_kbsoft (AT) hotmail (DOT) com> wrote

Quote:
Can I create Oracle Stored procedure via Delphi ?

I try with TQuery control but when i have an assigment statement fails....

Error: Field '=' is of unknown type

example:

query.sql.add('CREATE OR REPLACE PROCEDURE EX AS ') ;
query.sql.add(' vgProceso NUMBER ; ') ;
query.sql.add(' BEGIN' ) ;
query.sql.add(' vgProceso := 200 ;') ;
.....
query.sql.add('END EX') ;
query.execsql ;


Have you tried to turn ParamCheck property to false?


HTH,
Ping Kam



Back to top
Edgar
Guest





PostPosted: Thu Sep 11, 2003 2:32 pm    Post subject: Re: Can I create Oracle Stored procedure via Delphi ? Reply with quote



Yes, I set ParamCheck to False, dont work, same error.... :(

"Ping Kam" <pkam (AT) quikcard (DOT) com> escribió en el mensaje
news:3f5fbb09$2 (AT) newsgroups (DOT) borland.com...
Quote:
"Edgar" <jira_kbsoft (AT) hotmail (DOT) com> wrote in message
news:3f5fb2b4 (AT) newsgroups (DOT) borland.com...
Can I create Oracle Stored procedure via Delphi ?

I try with TQuery control but when i have an assigment statement
fails....

Error: Field '=' is of unknown type

example:

query.sql.add('CREATE OR REPLACE PROCEDURE EX AS ') ;
query.sql.add(' vgProceso NUMBER ; ') ;
query.sql.add(' BEGIN' ) ;
query.sql.add(' vgProceso := 200 ;') ;
.....
query.sql.add('END EX') ;
query.execsql ;


Have you tried to turn ParamCheck property to false?

HTH,
Ping Kam






Back to top
Ping Kam
Guest





PostPosted: Thu Sep 11, 2003 5:28 pm    Post subject: Re: Can I create Oracle Stored procedure via Delphi ? Reply with quote

"Edgar" <jira_kbsoft (AT) hotmail (DOT) com> wrote

Quote:
Yes, I set ParamCheck to False, dont work, same error.... :(

I have just tried with D5 and it works for me. You have to do it at runtime

though. Read the online help:

Set ParamCheck to specify whether or not the Params property is cleared and
regenerated if an application modifies the query's SQL property at runtime.

Did you enter the DDL at runtime?

HTH,
Ping Kam




Back to top
Edgar
Guest





PostPosted: Thu Sep 11, 2003 11:15 pm    Post subject: Re: Can I create Oracle Stored procedure via Delphi ? Reply with quote

Thanks Ping Kam!!, i set to false, then enter the DDL and exec, thats
works!!

"Ping Kam" <pkam (AT) quikcard (DOT) com> escribió en el mensaje
news:3f60af37$1 (AT) newsgroups (DOT) borland.com...
Quote:
"Edgar" <jira_kbsoft (AT) hotmail (DOT) com> wrote in message
news:3f6086bf$1 (AT) newsgroups (DOT) borland.com...
Yes, I set ParamCheck to False, dont work, same error.... :(

I have just tried with D5 and it works for me. You have to do it at
runtime
though. Read the online help:

Set ParamCheck to specify whether or not the Params property is cleared
and
regenerated if an application modifies the query's SQL property at
runtime.

Did you enter the DDL at runtime?

HTH,
Ping Kam






Back to top
Ping Kam
Guest





PostPosted: Thu Sep 11, 2003 11:31 pm    Post subject: Re: Can I create Oracle Stored procedure via Delphi ? Reply with quote

"Edgar" <jira_kbsoft (AT) hotmail (DOT) com> wrote

Quote:
Thanks Ping Kam!!, i set to false, then enter the DDL and exec, thats
works!!

Glad to hear that. I use ODAC which is more intelligent than the TQuery and

it let code this without creating the parameter even at designtime.

If you want to hardcode the DLL into the SQL property at designtime, you can
clear the param at runtime with the following code:

var
tempstr: string;
begin
tempstr := AQuery.SQL.Text;
AQuery.SQL.Clear;
AQuery.Params.Clear;
AQuery.ParamCheck := False;
AQuery.SQL.Text := tempstr;
AQuery.ExecSQL;
end;

Ping Kam




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.