Board index » delphi » Need Help on Stored Procedures Pleeeeeease!

Need Help on Stored Procedures Pleeeeeease!

HI Guys!

I am Using Interbase server 4.0.

I would like to create one Dynamic  parameterised SP to read any Table and
select criteria based on my parameter input.

Is this possible.

Will appreciate any help.

Thanx!

"The Shah"

 

Re:Need Help on Stored Procedures Pleeeeeease!


Quote
"The Shah" <shah...@caseynet.co.za> wrote:
>I am Using Interbase server 4.0.
>I would like to create one Dynamic  parameterised SP to read any Table and
>select criteria based on my parameter input.
>Is this possible.

I'm using Oracle, and it's not possible. What doesn't work is
parametrizing the "from <tablename>" part. It has to be specified
fully and can't be changed "on the fly".

Marc

======================================================================
[ Marc Scheuner, marc.scheu...@berner.ch  CH-3001 BERNE, Switzerland ]
======================================================================

Re:Need Help on Stored Procedures Pleeeeeease!


Quote
Marc Scheuner wrote:

> "The Shah" <shah...@caseynet.co.za> wrote:
> >I am Using Interbase server 4.0.
> >I would like to create one Dynamic  parameterised SP to read any Table and
> >select criteria based on my parameter input.
> >Is this possible.

> I'm using Oracle, and it's not possible. What doesn't work is
> parametrizing the "from <tablename>" part. It has to be specified
> fully and can't be changed "on the fly".

> Marc

> ======================================================================
> [ Marc Scheuner, marc.scheu...@berner.ch  CH-3001 BERNE, Switzerland ]
> ======================================================================

Glad to see you here Marc.  I only use the Delphi Deverloper edition.  I do
not have the Delphi C/S suite.  

Nonetheless I want to understand how to create triggers/Stored proceures for
Oraxcle/Sybase/DB2/MSSQL, etc.  In other worlds afor all Remote Servers.

I have a 3rd party Delph 1 book with a very brief example of a
Data-Definition file - but for the Remote Interbase. Ugh.

This book refers me to the durn C/S suite docs - which I do not have.  Got
any other type of 3rd party sources that you would recommend?

I would be satisfied with one very good book for Oracle only if you got one.

My Oracle 5/6/7.x books from Oracle are not much help on giving any
information of this Delphi "Data Definition file" or what goes into it or how
it gets onto the server.  Can you help?

Thanks.

Regards, -= Lou Rizzuto =-

PS:  How is the weather in Cerne?  :)  We just got our first 6 inchs of snow
- small storm.

Re:Need Help on Stored Procedures Pleeeeeease!


Quote
Marc Scheuner wrote:

> "The Shah" <shah...@caseynet.co.za> wrote:
> >I am Using Interbase server 4.0.
> >I would like to create one Dynamic  parameterised SP to read any Table and
> >select criteria based on my parameter input.
> >Is this possible.

> I'm using Oracle, and it's not possible. What doesn't work is
> parametrizing the "from <tablename>" part. It has to be specified
> fully and can't be changed "on the fly".

> Marc

> ======================================================================
> [ Marc Scheuner, marc.scheu...@berner.ch  CH-3001 BERNE, Switzerland ]
> ======================================================================

Glad to see you here Marc.  I only use the Delphi Deverloper edition.  I do
not have the Delphi C/S suite.  

Nonetheless I want to understand how to create triggers/Stored proceures for
Oraxcle/Sybase/DB2/MSSQL, etc.  In other worlds afor all Remote Servers.

I have a book with a very brief example of a Data-Definition file - but for
the Remote Interbase. Ugh.

This book refers me to the durn C/S suite docs - which I do not have.  Got
any other type of 3rd party sources that you would recommend?

I would be satisfied with one very good book for Oracle only if you got one.

My Oracle books from Oracle are not much help on giving any information of
this Delphi "Data Definition file" or what goes into it or how it gets onto
the server.  Can you help?

Thanks.

Regards, -= Lou Rizzuto =-

Re:Need Help on Stored Procedures Pleeeeeease!


Re:Need Help on Stored Procedures Pleeeeeease!


Yes, it is possible -what you need to do is use a string Format call to insert
the table name parameter into the SQL string before passing it to the
TStoredProc/TQuery

Charles Johnson

Re:Need Help on Stored Procedures Pleeeeeease!


Quote
cehjohn...@aol.com (CEHJohnson) wrote:
>Yes, it is possible -what you need to do is use a string Format call to insert
>the table name parameter into the SQL string before passing it to the
>TStoredProc/TQuery

Correct. If you build up the query from scratch, you can introduce a
"parametrized" table name.

However, you can't do something like:
        SELECT * FROM :MyTable ........

and use ParamByName('MyTable').AsString := 'SOMETABLE';

Marc

======================================================================
[ Marc Scheuner, marc.scheu...@berner.ch  CH-3001 BERNE, Switzerland ]
======================================================================

Other Threads