Why I am getting SQL_NO_DATA_FOUND error while I am executing following code section? - sql

CODE:
This code runs successfully on a Windows machine. But it isn't working on a Linux machine. It does not perform any operation.
ret = SQLFetch(hstmt)
if (ret == SQL_SUCCESS_WITH_INFO)
ret = SQL_SUCCESS;
When I execute this code, I get the error SQL_NO_DATA_FOUND. Why am I getting this error? what is SQLFetch() and what is its functionality?

Related

Unable to update unidata from .NET

I've been attempting for the last couple of days to update unidata using sample code as a basis using .NET without success. I can read the database successfully and view the raw data within visual studio. The error reported back is a out of range error. The program is attempting to update the unit price of a purchase order.
Error:
{" Error on Socket Receive. Index was outside the bounds of the array.POD"}
[IBMU2.UODOTNET.UniFileException]: {" Error on Socket Receive. Index was outside the bounds of the array.POD"}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
HResult: -2146232832
InnerException: null
Message: " Error on Socket Receive. Index was outside the bounds of the array.POD"
Source: "UniFile Class"
StackTrace: " at IBMU2.UODOTNET.UniFile.Write()\r\n at IBMU2.UODOTNET.UniFile.Write(String aRecordID, UniDynArray aRecordData)\r\n at ReadXlsToUnix.Form1.TestUpdate(String PO_LINE_SHIP, String price) in c:\Users\xxx\Documents\Visual Studio 2013\Projects\ReadXlsToUnix\ReadXlsToUnix\Form1.cs:line 330"
TargetSite: {Void Write()}
failing Test Code is:
private void TestUpdate(string PO_LINE_SHIP,string price)
{
UniFile pod =null;
UniSession uniSession =null;
//connection string
uniSession = UniObjects.OpenSession("unixMachine", "userid", Properties.Settings.Default.PWD, "TRAIN", "udcs");
//open file
pod = uniSession.CreateUniFile("POD");
//read data
pod.Read(PO_LINE_SHIP);
//locking strategy
pod.UniFileLockStrategy = 1;
pod.UniFileReleaseStrategy = 1;
if (pod.RecordID == ""){
pod.UnlockRecord();
}
//replace existing value with one entered by user
pod.Record.Replace(4, (string)uniSession.Iconv(price, "MD4"));
try
{
pod.Write(pod.RecordID,pod.Record); //RecordId and Record both show correctly hover/immediate window
//pod.Write() fails with same message
}
catch (Exception err)
{
MessageBox.Show("Error" + err);
}
pod.Close();
UniObjects.CloseSession(uniSession);
}
}
Running on HP UX 11.31 unidata 7.2 and using UODOTNET.dll 2.2.3.7377
Any help greatly appreciated.
This is the write record version and have also tried writefield functionality with same error.
Rajan - thanks for the update and link. I have tried unsuccessfully to read/update my unidata tables using the U2 Toolkit. I can however read/update a file I have created within the same account. Does this mean there is a missing entry somewhere VOC, DICT for example.

python3 urllib.request.urlopen timeout error

i have script witch gets data from site. First i wrote it in 2.7 python and its works.
When i rewrite it to python3 i have problem.
In python2.7 that works fine
for x in xrange(len(ll.string2)-1):
psR = urllib2.urlopen(ll.string2[x]).read()
nrL = Przystanek()
nrL.feed(psR)
self.BusExtData += nrL.string2
python3
for x in range(len(ll.string2)-1):
psR = urllib.request.urlopen(ll.string2[x],timeout=3000).read().decode('iso-8859-2')
nrL = Przystanek()
nrL.feed(psR)
self.BusExtData += nrL.string2
Upper code generate timeout error.
i = 0
while i<(len(ll.string2)-1):
try:
psR = urllib.request.urlopen(ll.string2[i],timeout=3000).read().decode('iso-8859-2')
nrL = Przystanek()
nrL.feed(psR)
self.BusExtData += nrL.string2
i=i+1
except:
print("Error")
i=i-1
pass
I avoid this problem with upper case. But i dont know why urllib2.urlopen dont make timeout error. When i use urllib.request.urlopen i get this error message:
urllib.error.URLError:urlopen error timed out
or
urllib.error.URLError:urlopen error timed out [WinError 10060]
What is difference between urlib2.urlopen and urllib.request.urlopen?

CreateFile2 returns access denied error in Windows 8

I have written the following lines of code to open a file under InstalledFolder directory:
Platform::String^ locationPath = Platform::String::Concat(Package::Current->InstalledLocation->Path, "\\Assets\\Logo.png");
CREATEFILE2_EXTENDED_PARAMETERS extendedParams = {0};
extendedParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
extendedParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
extendedParams.dwFileFlags = FILE_FLAG_SEQUENTIAL_SCAN;
extendedParams.dwSecurityQosFlags = SECURITY_ANONYMOUS;
extendedParams.lpSecurityAttributes = nullptr;
extendedParams.hTemplateFile = nullptr;
Wrappers::FileHandle file(
CreateFile2(
locationPath->Data(),
GENERIC_READ,
0,
OPEN_EXISTING,
&extendedParams
)
);
DWORD e = GetLastError();
if (file.Get() == INVALID_HANDLE_VALUE)
{
throw ref new Platform::FailureException();
}
The CreateFile2 returns access denied error. Can anyone please help me out?
As suggested by JP Alioto, I have tried with WinRT File I/O as the following
create_task(StorageFile::GetFileFromApplicationUriAsync(ref new Windows::Foundation::Uri("ms-appx:///Assets/Logo.png")))
.then([=](StorageFile^ f)
{
auto p = create_task(f->OpenAsync(FileAccessMode::Read));
p.wait();
});
I still get the following error at p.wait():
An invalid parameter was passed to a function that considers invalid parameters fatal
Thanks,
You are passing 0 for dwShareMode. The documentation for CreateFile2 says that this value...
Prevents other processes from opening a file or device if they request delete, read, or write access. Exclusive access to a file or directory is only granted if the application has write access to the file.
You do not have write access to files within the package, which is why you get the access denied error. You need to set the share mode to FILE_SHARE_READ.

Occasionally get "attempt to apply non-function" error when applying getForm

I'm using getForm to repeatedly pull data from an api. Sometimes the program finishes, and other times after some amount of iterations, I get the following error message:
Error in curlPerform(url = url, curl = curl, .opts = .opts) :
attempt to apply non-function
In addition: There were more than 50 warnings (use warnings() to see the first 50)
> traceback()
5: .Call("R_curl_easy_perform", curl, .opts, isProtected, .encoding,
PACKAGE = "RCurl")
4: curlPerform(url = url, curl = curl, .opts = .opts)
3: getURLContent(uri, .opts = .opts, .encoding = .encoding, binary = binary,
curl = curl)
2: getForm("https://xx", .params = parval)
1: fromJSON(getForm("https://xx",
.params = parval)) at #32
the warnings are:
In RCurlIconv(str, from = "C99", to = encoding) :
UTF-8 not supported iconv entries
Thanks for your help!
It's just a download error, sometimes the download fails. I just put in a provision to try the download again in that case.

Which processes can be launched using performTaskWithPathArgumentsTimeout function?

I use UIAutomation to automate an iPad application. I have tried to use
(object) performTaskWithPathArgumentsTimeout(path, args, timeout) to run Safari.app from my script:
var target = UIATarget.localTarget();
var host = target.host();
var result = host.performTaskWithPathArgumentsTimeout("/Applications/Safari.app", ["http://www.google.com"], 30);
UIALogger.logDebug("exitCode: " + result.exitCode);
UIALogger.logDebug("stdout: " + result.stdout);
UIALogger.logDebug("stderr: " + result.stderr);
I got the following results:
exitCode: 5
stdout:
stderr:
I’ve also tried to launch echo:
var target = UIATarget.localTarget();
var host = target.host();
var result = host.performTaskWithPathArgumentsTimeout("/bin/echo", ["Hello
World"], 5);
UIALogger.logDebug("exitCode: " + result.exitCode);
UIALogger.logDebug("stdout: " + result.stdout);
UIALogger.logDebug("stderr: " + result.stderr);
Results:
exitCode: 0
stdout: Hello World
stderr:
So, looks like performTaskWithPathArgumentsTimeout works for specific applications only.
Could you please help me to answer the following questions:
1. What does exitCode = 5 mean?
2. Which processes can be launched using performTaskWithPathArgumentsTimeout function?
1) Exit code 5 is most likely EIO, as defined in : Input/Output error. You're attempting to execute "/Applications/Safari.app", which to the launching task is a directory and not a binary.
2) You can launch any application with performTaskWithPathArgumentsTimeout() that NSTask can launch. As long as it's a valid executable, it should work.
For your specific example though, Safari won't accept an argument passed on the command line like that as a URL to visit. You need to use open /Applications/Safari.app "http://www.google.com" instead:
var result = host.performTaskWithPathArgumentsTimeout("/usr/bin/open", ["/Applications/Safari.app", "http://www.google.com"], 30);