Please Help me remove the space。

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
storedproc
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 30.04.2018, 06:09

Please Help me remove the space。

Postby storedproc » 30.04.2018, 08:02

DELPHI 7 + zeosdbo-7.2.4-stable + MSSQL2000

MSSQL

Code: Select all

Host:127.0.0.1
User:sa   
password:zeoslib

DATABASE NAME:     tzstoredproc_demo
tzstoredproc_demo
-> table name:        demo_table                           
-> sql stored procedure    AAA_GetScore 
 


SQL

Code: Select all

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AAA_GetScore]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
dro p procedure [dbo].[AAA_GetScore]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[demo_table]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
dro p table [dbo].[demo_table]
GO

CREATE TABLE [dbo].[demo_table] (
   [id] [int] IDENTITY (1, 1) NOT NULL ,
   [fullid] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,
   [name] [char] (255) COLLATE Chinese_PRC_CI_AS NULL ,
   [subject] [char] (255) COLLATE Chinese_PRC_CI_AS NULL ,
   [score] [int] NULL
) ON [PRIMARY]
GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO

CREATE       PROCEDURE AAA_GetScore
          @Name varchar(8000) ,
          @score integer
AS
select * from demo_table where name=@name  and score=@score
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO


demo_table
demo_table.txt


TZConnection Protocol := mssql

Unit1.dfm

Code: Select all

object Form1: TForm1
  Left = 339
  Top = 160
  Width = 720
  Height = 395
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object dbgrd1: TDBGrid
    Left = 56
    Top = 112
    Width = 649
    Height = 169
    DataSource = ds1
    TabOrder = 0
    TitleFont.Charset = DEFAULT_CHARSET
    TitleFont.Color = clWindowText
    TitleFont.Height = -11
    TitleFont.Name = 'Tahoma'
    TitleFont.Style = []
  end
  object ds1: TDataSource
    DataSet = zsp1
    Left = 80
    Top = 24
  end
  object con1: TZConnection
    ControlsCodePage = cCP_UTF8
    Properties.Strings = (
      'controls_cp=CP_UTF8')
    Connected = True
    HostName = '127.0.0.1'
    Port = 0
    Database = 'tzstoredproc_demo'
    User = 'sa'
    Password = 'zeoslib'
    Protocol = 'mssql'
    Left = 152
    Top = 24
  end
  object zsp1: TZStoredProc
    Connection = con1
    Active = True
    Params = <
      item
        DataType = ftInteger
        Name = '@RETURN_VALUE'
        ParamType = ptResult
        Value = 0
      end
      item
        DataType = ftString
        Name = '@Name'
        ParamType = ptInput
        Value = 'john'
      end
      item
        DataType = ftInteger
        Name = '@score'
        ParamType = ptInput
        Value = '96'
      end>
    StoredProcName = 'AAA_GetScore;1'
    Left = 232
    Top = 24
    ParamData = <
      item
        DataType = ftInteger
        Name = '@RETURN_VALUE'
        ParamType = ptResult
        Value = 0
      end
      item
        DataType = ftString
        Name = '@Name'
        ParamType = ptInput
        Value = 'john'
      end
      item
        DataType = ftInteger
        Name = '@score'
        ParamType = ptInput
        Value = '96'
      end>
  end
end


Unit1.pas

Code: Select all

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, ZAbstractRODataset, ZAbstractDataset, ZStoredProcedure,
  ZAbstractConnection, ZConnection, Grids, DBGrids;

type
  TForm1 = class(TForm)
    ds1: TDataSource;
    con1: TZConnection;
    zsp1: TZStoredProc;
    dbgrd1: TDBGrid;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

end.


when zsp1.active:=true

SQL Server Profiler

Code: Select all

exec AAA_GetScore;1 'john                                                                                                                                                                                                                                                           ', 96


Find a record. No error was found in the result of the operation。


but I want to achieve this effect:when zsp1.active:=true
SQL Server Profiler

Code: Select all

exec AAA_GetScore;1 'john', 96


Please Help me remove the space. Thanks.
You do not have the required permissions to view the files attached to this post.

storedproc
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 30.04.2018, 06:09

Re: Please Help me remove the space。

Postby storedproc » 02.05.2018, 08:20

when

con2: TADOConnection;
sp2: TADOStoredProc;

and sp2.active:=true

SQL Server Profiler

Code: Select all

exec AAA_GetScore;1 'john', 96


Please help me.thanks.

marsupilami
Gold Boarder
Gold Boarder
Posts: 671
Joined: 17.01.2011, 14:17

Re: Please Help me remove the space。

Postby marsupilami » 07.05.2018, 11:20

Hello,

I think your bug has been fixed in the current Zeos 7.3 branch. In some days it surely will be merged with Zeos 7.2. See SVN Rev. 4538
Best regards,

Jan

marsupilami
Gold Boarder
Gold Boarder
Posts: 671
Joined: 17.01.2011, 14:17

Re: Please Help me remove the space。

Postby marsupilami » 08.05.2018, 09:58

Hello,

this bug should be fixed in Zeos 7.2 SVN now (Rev. 4545). Could you please try the current Zeos 7.2 from SVN and check wether it solves your problem?
With best regards,

Jan



Return to “ZeosLib 7.2 Forum”

Who is online

Users browsing this forum: No registered users and 1 guest