Solved

Help me: dbExpress AND generator

Posted on 2004-08-24
3
301 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
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 25 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 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