Highlighted
New Member.
312 views

SQL query cannot be executed

Hi,

Iam trying to run a simple sql query but getting error. Please suggest where aim doing wrong. Also Iam using Webservices protocol.

lr_db_connect("StepName=myStep", 
        "ConnectionString=Initial Catalog=<DB Name>;Data Source=<server Name>;user id =sa ;password = <password>" ,
        "ConnectionName=MyConnection",
        "ConnectionType=SQL",
        LAST);
    
    lr_db_executeSQLStatement("StepName=UpdateStep", 
        "ConnectionName=MyConnection", 
        "SQLQuery=select * from employee", 
        "DatasetName=ds1", 
        LAST);
    

    lr_db_disconnect ("StepName=Closestep",
    "ConnectionName=MyConnection",
LAST);

=================================================================

The error is
 Error: The "SQLQuery=select * from employee" argument (#3) is invalid or not recognized at this position in the function call

Thanks
Dips

Tags (1)
0 Likes
1 Reply
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: SQL query cannot be executed

Hi

Not sure it will help, but try writing the select and from in upper case (SELECT / FROM).

let us know if it helpd.

Thanks,

Lior

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.