?
Solved

Help me: dbExpress AND generator

Posted on 2004-08-24
3
Medium Priority
?
307 Views
Last Modified: 2010-04-05
Hi,

With IBX components i can found the property GENERATORFIELD, and i can set my generator in that property.

And in dbExpress? How can I implement a generator?

Best regards.
0
Comment
Question by:joelsilva
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Expert Comment

by:wneub
ID: 12047755
Hi,
what Database do you use? I use Firebird. There I search the generator value with a stored procedure, which I can execute from Delphis dbexpress component SQLStoredProcedure.
0
 

Author Comment

by:joelsilva
ID: 12049770
Could you post your SP code, pls.?
0
 

Accepted Solution

by:
wneub earned 100 total points
ID: 12051673
The code of the SP in Interbase or Firebird:
CREATE PROCEDURE NAMEOFYOURSP returns (
  NAMEOFYOURPARAM Integer)
AS
BEGIN
   NAMEOFYOURPARAM = GEN_ID(NAMEOFYOURGENERATOR,1);
END

In Delphi you create a SQLStoredProcedure component and connect it with your NAMEOFYOURSP. Then:
SQLStoredProcedure.ExecProc;
MyID:=SQLStoredProcedure.ParamByName('NAMEOFYOURPARAM').AsInteger;

Thats is.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question