Page 1 of 2

Command Line : Parameters

Posted: Mon 20 Feb 2017 12:42
by nusa
Hi,
I've a query for a report :

Code: Select all

SELECT
  Ticket.Number
 ,Company.FirmName AS Client
 ,Ticket.Subject AS [Objet de la demande]
 ,[User].Username AS Demandeur
 ,[User].Email
 ,TicketTask.Title AS [Titre tâche]
 ,Ticket.RequestDate AS [Date de la demande]
 ,TicketTask.Logwork AS [Durée de la tâche]
 ,TicketTask.CreationDate AS [Date de la tâche]
 ,User_1.FirstName
 ,User_1.LastName AS [Tech]
 ,TicketTask.Logwork AS timefromparts
 ,CONVERT(TIME(0), DATEADD(SECOND, TicketTask.Logwork, 0)) AS 'hh:mm:ss'
 ,User_1.Id AS [ID Tech]
FROM MembershipManagement.[User]
INNER JOIN OrganizationManagement.Company
  ON [User].CompanyId = Company.Id
INNER JOIN IncidentManagement.Ticket
  ON Ticket.RequesterId = [User].Id
INNER JOIN IncidentManagement.TicketTask
  ON TicketTask.TicketId = Ticket.Id
INNER JOIN MembershipManagement.[User] User_1
  ON TicketTask.AgentId = User_1.Id
WHERE TicketTask.DueDate BETWEEN DATEADD(d, 0, DATEDIFF(d, 0, GETDATE())) AND GETDATE()
AND User_1.Id = @Tech_Id
@Tech_Id is a parameter

On my script, .bat :

Code: Select all

C:\Program Files\Devart\dbForge Studio for SQL Server\dbforgesql.com" /datareport /reportfile:"C:\Reporting\DEV\ChargeTech\Chargetech.rdb" /parameters:Tech_Id="1c4cc27f-232c-4d67-8cef-aff15c7d96aa" /format:pdf /result email:"[email protected]"
If i run manually the query, it's OK :

https://cl.ly/1j1t0i0H1s0H

But whith the script .bat, I've this error :
------ Data report generation started ------


Retrieving data: Failed
Error: An error occurred while retrieving data: La variable scalaire "@Tech_Id"
doit être déclarée.


------ Data report generation finished ------
Nusa

Re: Command Line : Parameters

Posted: Mon 20 Feb 2017 14:51
by alexa
Please try replacing @ with : in the SELECT query before the parameter, resave the *.rdb file with the new character and call it from the command line.

Re: Command Line : Parameters

Posted: Mon 20 Feb 2017 15:02
by nusa
Hi,

My code :

Code: Select all

AND User_1.Id = :Tech_Id
But :
https://cl.ly/1O2W2J2i3C3u

And :
------ Data report generation started ------


Retrieving data: Failed
Error: An error occurred while retrieving data: Syntaxe incorrecte vers ':'.


------ Data report generation finished ------
Nusa

Re: Command Line : Parameters

Posted: Mon 20 Feb 2017 15:35
by alexa
Thank you for the reply.

Please try the following:

1. Replace it back to:

Code: Select all

@Tech_Id
2. Use the following command line string:

Code: Select all

C:\Program Files\Devart\dbForge Studio for SQL Server\dbforgesql.com" /datareport /reportfile:"C:\Reporting\DEV\ChargeTech\Chargetech.rdb" /parameters Tech_Id:"1c4cc27f-232c-4d67-8cef-aff15c7d96aa" /format:pdf /result email:"[email protected]"

Re: Command Line : Parameters

Posted: Mon 20 Feb 2017 15:58
by nusa
------ Data report generation finished ------


Invalid command line. Parameter name '' is not presented in report query.

Command line usage:

dbforgesql [/argfile:path] [/operation_switch] [/switch1[:value | [parameter1:va
lue parameter2:value ..]] /switch2 ..]

The first argument for dbforgesql is usually an operation switch that correspond
s to operation that you want to perform with the application.
:cry:

nusa

Re: Command Line : Parameters

Posted: Mon 20 Feb 2017 16:07
by alexa
Thank you for the reply.

Will it be possible to provide us the *.bat and *.rdb files?

You can send a reply straight to our support system at supportATdevartDOTcom and alexaATdevartDOTcom

Re: Command Line : Parameters

Posted: Tue 21 Feb 2017 11:53
by nusa
Hi,

Mail is sent.

Nusa

Re: Command Line : Parameters

Posted: Tue 21 Feb 2017 12:28
by alexa
Thank you for the reply.

Could you please also let us know what version of dbForge Studio for SQL Server you are using?

Re: Command Line : Parameters

Posted: Tue 21 Feb 2017 12:32
by nusa
Pro edition, V 5.4.215

Nusa

Re: Command Line : Parameters

Posted: Tue 21 Feb 2017 12:37
by nusa
Same problem with the 5.4.211

Nusa

Re: Command Line : Parameters

Posted: Tue 21 Feb 2017 14:23
by alexa
Thank you for the reply.

Please try the following

Code: Select all

C:\Program Files\Devart\dbForge Studio for SQL Server\dbforgesql.com" /datareport /reportfile:"C:\Reporting\DEV\ChargeTech\Chargetech.rdb" parameters Tech_Id:"1c4cc27f-232c-4d67-8cef-aff15c7d96aa" /format:pdf /result email:"[email protected]"

Re: Command Line : Parameters

Posted: Tue 21 Feb 2017 17:46
by nusa
Same result :
------ Data report generation started ------


Retrieving data: Failed
Error: An error occurred while retrieving data: La variable scalaire "@Tech_Id"
doit être déclarée.


------ Data report generation finished ------

Error: An error occurred while retrieving data: La variable scalaire "@Tech_Id"
doit être déclarée.
Nusa

Re: Command Line : Parameters

Posted: Wed 22 Feb 2017 14:40
by alexa
Thank you for the reply.

We will investigate this issue and will answer you as soon as possible.

Re: Command Line : Parameters

Posted: Thu 23 Feb 2017 10:34
by alexa
We were able to reproduce this issue and will fix it in the next product build that should be released next week.

The problem, in fact, happens when using the parameters containing upper case characters.

Re: Command Line : Parameters

Posted: Thu 23 Feb 2017 10:56
by nusa
Yes, good news.
It's possible to make a test with beta?

Thank's.

Nusa (I'm in holidays the newt week :-)