Solved

Help me: dbExpress AND generator

Posted on 2004-08-24
3
295 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
  • 2
3 Comments
 

Expert Comment

by:wneub
Comment Utility
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
Comment Utility
Could you post your SP code, pls.?
0
 

Accepted Solution

by:
wneub earned 25 total points
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now