How to return a recordset when calling a stored procedure in delphi

Updated on technology 2024-03-27
6 answers
  1. Anonymous users2024-02-07

    Connecting oracle's stored procedure with Delphi's tadostoreprocedure works executable, I've used it a few times, it's just that my stored procedure is written in the middle of the three layers, and I don't return a dataset.

    You can define the data you put back as a multidimensional array, and return ** as follows:'ny').value:=ny;

  2. Anonymous users2024-02-06

    What is your data engine? Generally, you can connect to Oracle through tools such as UNIDAC and ODAC, so that the controls provided by the engine can directly run stored procedures and return results.

  3. Anonymous users2024-02-05

    When writing the SQL statement of the query control, it is written like this:

    declare @r int

    exec @r = myproc

    select @r as result

    Then open, read the value of the result field with fieldbynmae.

  4. Anonymous users2024-02-04

    outputDate is a parameter of type to be defined in the stored procedure. := ' declare @outputdata int '##10'excute storedproc1 @outputdata output'##10'select @outputdata ';select @outputdate returns a set of knots, just like a table, with only one field and one record. yes.

    For example, if the last line of the stored procedure is a select statement (which returns the set), it can be opened with open. Records and parameters are returned at the same time. Otherwise, only the arguments are returned.

    time1').value := now;result :

    @get1').value;View the original post

  5. Anonymous users2024-02-03

    Stored procedures: create procedure proc loginusername varchar(20), password varchar(20).

    asdeclare @result intselect @result=count(*)from table1 where user=@username and pass=@password

    if @result=0

    return 0

    return 1

    godelphi**:

    var ret:integer;

    with adostoredproc1 dobeginclose;

    procedurename:='proc_login';;;

    username').value:= ;

    password').value:= ;

    execproc;

    ret:= '@return_value').value;

    end;if ret=1 The user Liang Shen Yu respects the paragraph name and password matches.

    begin the you want. end

  6. Anonymous users2024-02-02

    You should want to return a result set, if you do, you can refer to the following with adoquery do

    beginclose;

    execute proc_rsj_sel ..Fill in the relevant parameters here, and I won't go into detail');

    open;end;

Related questions
14 answers2024-03-27

Create table as **selectThe table should exist in the data dictionary, so that the table can be created successfully, you have a complex subquery, such as count(*)as samplid, how does the database know whether samplid should be created as int or bigint? It is recommended that you split the dynamic statement into two statements, one for the regular table creation statement and the other for the insert statement.

4 answers2024-03-27

The solution is as follows: 1. The create global temporary table t temp statement is to create a temporary table, there are two kinds of temporary tables created in oracle, one is transaction-level and the other is session-level, when the creation of temporary table statement is followed by on commit delete rows, it means that the temporary table is transaction-level, and when on commit preserve rows it means that the temporary table is session-level. >>>More

11 answers2024-03-27

Visually, your stored procedure needs to run at these moments: >>>More

6 answers2024-03-27

。Is it necessary to repair spacecraft in space?

5 answers2024-03-27

F12 sets breakpointsF10 single-step debugging makes use of MATLAB vector operations as much as possible, and uses fewer cycles. Add a semicolon at the end of each line, and the calculation result is not displayed on the command line, which can speed up the operation. ......