Jump to content

Stéphane Wierzbicki

Members
  • Content Count

    146
  • Joined

  • Last visited

Community Reputation

24 Excellent

About Stéphane Wierzbicki

  • Birthday July 20

Technical Information

  • Delphi-Version
    Delphi 10.3 Rio

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Stéphane Wierzbicki

    "SQL Command Preprocessor" pitfall

    Hi, I'm having a problem with the "SQL Command Preprocessor". Whenever I enter values containing special characters such as '{' ,'!', '&', '}' , Firedac tries to treat this value as a new macro. I played with ResourceOptions.MacroCreate, ResourceOptions.MacroExpand and ResourceOptions.EscapeExpand but I was not able to get a correct password. The only thing I found was to "duplcate" any of these '{' ,'!', '&', '}'. Password 'Let me out !!" will becomes 'Let me out !!!!'. Some Delphi code: FDQuery2.Macros.MacroByName('USER').AsRaw := 'Blablabla'; FDQuery2.Macros.MacroByName('USER_PASSWORD').AsRaw := 'Let me out !!!!'; FDQuery2.ExecSQL; MS SQL Script ALTER LOGIN [&USER] WITH PASSWORD = N'&USER_PASSWORD', DEFAULT_DATABASE = [&Database], DEFAULT_LANGUAGE = [us_english], CHECK_EXPIRATION = OFF, CHECK_POLICY = OFF; Is there not a way to tell the "SQL Command Preprocessor" not to preprocess value passed thanks to FDQuery2.Macros.MacroByName method call ? Thank you. Stéphane
  2. Stéphane Wierzbicki

    Translations of the exception notification dialog text

    French translation is also correct.
  3. Stéphane Wierzbicki

    IDE Fixpack Sydney

    Too bad.... We will have to wait until Emb decided to release the community version, which will not occurs soon for what I understood... I guess I'll have to stay with 10.3.3... Regards
  4. Stéphane Wierzbicki

    IDE Fixpack Sydney

    Hi there, Is anyone aware if Andreas is working on an updated version of it's wonderful tool? Thanks Stephane
  5. Stéphane Wierzbicki

    Crash when Delphi 10.n exits... again

    Hi, In my case FixInsight is throwing an error on IDE splashscreen (plus many time within the IDE, and when closing the IDE Looks like GExperts and FixInsign doesn't like each others 🙂 ps2: FixInsight does not crash on 10.3.3 (where GExperts is also installed). Regards Stephane
  6. Stéphane Wierzbicki

    Your RAD Studio 10.4 Sydney issues

    This is really insane that we still need to wait for an IDE fixe pack... Embarcadero, what the hell are you doing... Waiting now for Andreas to fix this....
  7. Stéphane Wierzbicki

    Need help adding namespaces to SOAP

    What disturbs me the most is the lack of available documentation and examples. I really don't know how to properly handle this... I've also tried to use Indy and send an pre-formatted XML file (thanks to SOAPUI) but it failed (504 Connection reset by peer). Maybe @Remy Lebeau can helps on this?
  8. Stéphane Wierzbicki

    Need help adding namespaces to SOAP

    Good morning, I have difficulties consuming a SOAP Web Service (obviously developed in C#). I managed to create the different Delphi classes via the WDSL import wizard. Unfortunately the request sent is not correctly formatted when generated by Delphi. I don't have any problems when I run my tests via SOAPUI. I have attached the two XML requests (the expected format generated by SOAPUI and the one generated by Delphi). I could see that the namespaces were not added to the different XML nodes/properties. Delphi generated SOAP Request <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <Invocar xmlns="http://www.smart-ix.com/SXAPI/"> <contexto> <CodNegocio>BUI</CodNegocio> <CodSistema>BUI</CodSistema> <Token/> <Usuario/> </contexto> <request> <Formulario> <VariableCircuitoConsultaInDTO> <Codigo>From</Codigo> <Valor>20190122</Valor> </VariableCircuitoConsultaInDTO> <VariableCircuitoConsultaInDTO> <Codigo>To</Codigo> <Valor>20190522</Valor> </VariableCircuitoConsultaInDTO> </Formulario> <Comando>Reporte_5</Comando> <Paginacion> <NroPagina>0</NroPagina> <RegistrosPorPagina>1</RegistrosPorPagina> <RetornaTotalRegistros>false</RetornaTotalRegistros> </Paginacion> <QuerySettings> <Paging> <PageNumber>1</PageNumber> <PageSize>1</PageSize> <TotalElements>1</TotalElements> <TotalPages>0</TotalPages> </Paging> </QuerySettings> <ReportCode>Reporte_5</ReportCode> </request> </Invocar> </SOAP-ENV:Body> </SOAP-ENV:Envelope> SOAPUI SOAP Envelope (good) <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sxap="http://www.blablabla.com/SXAPI/" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:apis="http://schemas.datacontract.org/2004/07/APISX.Contracts.Query.Models"> <soapenv:Header/> <soapenv:Body> <sxap:Invocar> <!--Optional:--> <sxap:contexto> <sxap:CodNegocio>BUI</sxap:CodNegocio> <sxap:CodSistema>BUI</sxap:CodSistema> <sxap:CodProducto></sxap:CodProducto> <sxap:Usuario></sxap:Usuario> </sxap:contexto> <!--Optional:--> <sxap:request> <!--Optional:--> <sxap:Formulario> <VariableCircuitoConsultaInDTO> <Codigo>From</Codigo> <Valor>20190122</Valor> </VariableCircuitoConsultaInDTO> <VariableCircuitoConsultaInDTO> <Codigo>To</Codigo> <Valor>20190522</Valor> </VariableCircuitoConsultaInDTO> </sxap:Formulario> <!--Optional:--> <sxap:Aditional> </sxap:Aditional> <!--Optional:--> <sxap:Comando>Reporte_5</sxap:Comando> <!--Optional:--> <sxap:Paginacion> <sxap:NroPagina>0</sxap:NroPagina> <sxap:RegistrosPorPagina>20</sxap:RegistrosPorPagina> <sxap:RetornaTotalRegistros>false</sxap:RetornaTotalRegistros> </sxap:Paginacion> <sxap:QuerySettings> <apis:Filters> </apis:Filters> <apis:Paging> <apis:ContinuationToken></apis:ContinuationToken> <apis:PageNumber>1</apis:PageNumber> <apis:PageSize>20</apis:PageSize> <apis:TotalElements>20</apis:TotalElements> <apis:TotalPages>0</apis:TotalPages> </apis:Paging> <apis:Sorting> </apis:Sorting> </sxap:QuerySettings> <sxap:ReportCode>Reporte_5</sxap:ReportCode> </sxap:request> </sxap:Invocar> </soapenv:Body> </soapenv:Envelope> As you can see there are severals differencies. Envelop are not the same between Delphi and SOAPUI Namespace are missing in Delphi generated code. I tried to modify InvRegistry.RegisterMethodInfo(TypeInfo(ISrvConsultaCartera), 'Invocar', '','[ReturnName="InvocarResult"]', IS_OPTN or IS_NLBL); to InvRegistry.RegisterMethodInfo(TypeInfo(ISrvConsultaCartera), 'Invocar', 'sxap:Invocar',[ReturnName="InvocarResult"]', IS_OPTN or IS_NLBL); This worked but I have no clue on how to do this for other properties (paginacion, paging...) I search the internet but dod not found relevant info. Can someone help me on this ? Thank you Expected Soap Request.xml ISrvConsultaCartera1.pas Delphi Generated SOAP Request.xml
  9. Stéphane Wierzbicki

    TFDBatchMoveSQLWriter and table structure updates

    It's not 😉, I know. I've implemented some checks before uploading data. I do have a mapping table used to control XLS file. XLS file is not uploaded if there is a change in the header (a column name changed for example). Problem is that I need to both update the mapping table and to create new fields in my database table. I wanted the later to be automatically handled by Tfdbatchmove component.
  10. Stéphane Wierzbicki

    TFDBatchMoveSQLWriter and table structure updates

    Thanks Dmitry, do you have some advice on how to get this done in another way ?
  11. Stéphane Wierzbicki

    TFDBatchMoveSQLWriter and table structure updates

    I forgot to tell you that I've already tried this. Removing from the the options set did not changed any thing.
  12. Stéphane Wierzbicki

    TFDBatchMoveSQLWriter and table structure updates

    No, I'm sorry, I'm receiving those files every month and data needs to be appended into the same table.
  13. Stéphane Wierzbicki

    TFDBatchMoveSQLWriter and table structure updates

    Hello I transfer Excel data to an MS SQL database. To do this I use the TFDMemTable, TFDBatchMove and TFDBatchMoveSQLWriter components. The TFDMemTable field definitions are automatically created according to the Excel file (Excel columns and data type are used to create the field definitions). The name of the Excel file is used to fill in the Tablename property of the TFDBatchMoveSQLWriter component. When the TFDBatchMove is executed, the "TableName" table is created if it does not exist in the MS SQL database. If the table does exist, the data is inserted into it. This is perfect. I have a problem when the Excel file evolves and especially when a new column appears. TFDBatchMoveSQLWriter does not update the SQL table structure and the new field(s) are not created. Anyone have an idea to help me solve this problem? Maybe should I use another FireDac for this purpose? Here is my function function StoreDataset(aFDConnection: TFDConnection; aDataset: TDataSet; aTableName: string = ''; aOptions: TFDBatchMoveOptions = [poIdentityInsert, poCreateDest, poSkipUnmatchedDestFields, poUseTransactions]; aMode: TFDBatchMoveMode = dmAlwaysInsert): boolean; var FFDTable: TFDTable; FBatchmove: TFDBatchMove; FBatchmoveDatasetReader: TFDBatchMoveDataSetReader; FBAtchMoveSQLWriter: TFDBatchMoveSQLWriter; begin Result := False; if not assigned(aFDConnection) then raise Exception.Create('Please provide a Connection'); if not assigned(aDataset) then raise Exception.Create('Please provide a Dataset'); if aTableName = '' then aTableName := aDataset.Name; if aTableName = '' then raise Exception.Create('Please provide a table name'); FBatchmove := TFDBatchMove.Create(nil); FBatchmoveDatasetReader := TFDBatchMoveDataSetReader.Create(nil); FBAtchMoveSQLWriter := TFDBatchMoveSQLWriter.Create(nil); FFDTable := TFDTable.Create(nil); try FBatchmove.Reader := FBatchmoveDatasetReader; FBatchmove.Writer := FBAtchMoveSQLWriter; FBatchmove.Options := aOptions; FBatchmove.Mode := aMode; FBAtchMoveSQLWriter.Connection := aFDConnection; aFDConnection.Connected := True; FBatchmoveDatasetReader.Dataset := aDataset; FBAtchMoveSQLWriter.TableName := aTableName; try FBatchmove.Execute; Result := True; except on e: Exception do begin Result := False; TMSLogger.Exception(e.message); end; end; finally aFDConnection.Connected := False; FBatchmove.Free; FBatchmoveDatasetReader.Free; FBAtchMoveSQLWriter.Free; FFDTable.Free; end; end;
  14. Stéphane Wierzbicki

    Barcode reading on Honeywell and Zebra devices

    Thank you for sharing this!
  15. Stéphane Wierzbicki

    RAD Studio 10.3.3 now available

    Sorry for the confusion! I should have said that I don't understand why your fixes are not TOTALLY included in Delphi RIO! Anyways... I'm still thanking you for all your hard work.
×