Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help me: dbExpress AND generator

Posted on 2004-08-24
3
Medium Priority
?
316 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

636 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