Contributions
flex datagrid wvalue returning unknown name listItems (103 0x80020006)
i'm getting an error (below), whenever i use the wvalue[row, column] property for a Flex datagrid object. I know that i have the correct row (integer) and column (string), since TestComplete gives me a different error if the integer is out of bounds or the column string doesn't matchan existing column name. However, the wColumn[num] works and shows me the correct column names. Advice appreciatedon how to debug this. ------ Possible reasons: 1. The application stopped responding. 2. The application was compiled incorrectly (see the Open Applications topic in the help system). 3. An error occurred in TestComplete/TestExecute. Technical information: 103 0x80020006 (Unknown name.) listItems. ------722Views0likes0CommentsRe: Python - Using ADO and RecordSet in testcomplete scripts
Based on my previous response, I agree that this is likely an issue with drivers for Oracle 11i DB. The driver I'm using is 'Microsoft ODBC for Oracle'. My further research has shown that the TO_CHAR() method on any timestamp field is used in many examples I've come across so far. I just wish there was a more generic solution so that I can safely use "SELECT *" without worrying about the field types.1.2KViews0likes0CommentsRe: Python - Using ADO and RecordSet in testcomplete scripts
tristaanogreI've narrowed down the problem with the "SELECT *...." statement. So, it turns out if any of the columns in my TT_ADJUST table is of type TIMESTAMP(6), that exception will be thrown. The "solution" is to do a TO_CHAR conversion on a timestamp field, i.e. 'SELECT TO_CHAR(SENTDATE, 'YYYY-MM-DD') FROM ....' However, that means I can't blindly use "SELECT *" on any table, which is what I'd ideally want. Is there another way to set a connection, cursoror recordset property to allow this conversion to happen automatically? From what I've found by searching, it was mentioned in https://docs.oracle.com/cd/E47955_01/win.121/e18594/using.htm that using a CursorLocation property was needed. So I tried the following, but it still gave the same error on SELECT *: def test_oracle(): conn = ADO.CreateADOConnection() conn_str = "Driver={%s};Server=%s;Uid=%s;Pwd=%s;" % ( Common.conf['GLOBAL.DB.DRIVER'], Common.conf['GLOBAL.DB.SERVER'], Common.conf['GLOBAL.DB.UID'], Common.conf['GLOBAL.DB.PWD']) Log.Message("conn_str: " + conn_str) conn.ConnectionString = conn_str conn.LoginPrompt = False conn.Open() rec_set = ADO.CreateRecordset() rec_set.CursorLocation = 2 rec_set = conn.Execute_("SELECT * FROM ADMD.TT_ADJUST WHERE ETD in ('AZ1014')")1.2KViews0likes2CommentsRe: Python - Using ADO and RecordSet in testcomplete scripts
cunderwthanks! that was the solution. Just for completeness this is translation in Python: l_recset = [] rec_set.MoveFirst() while not rec_set.EOF: d_row = {} for i in range(rec_set.Fields.Count): d_row[rec_set.Fields.Item[i].Name] = rec_set.Fields.Item[i].Value l_recset.append(d_row) rec_set.MoveNext()5.8KViews0likes0CommentsRe: Python - Using ADO and RecordSet in testcomplete scripts
tristaanogrethanks again for responding. Here're my select statements, showing one that worked, and another one that didn't: This one works: rec_set = conn.Execute_("SELECT ACTIONTYPE, BID, TYPE, ETD FROM ADMD.TT_ADJUST WHERE ETD in ('AZ1014')") This one doesn't: rec_set = conn.Execute_("SELECT * FROM ADMD.TT_ADJUST WHERE ETD in ('AZ1014')") I get this exception: RuntimeError Unspecified error Error location: Unit: "pyADMD\pyADMD\Script\sandbox" Line: 33 Column: 1.5.8KViews0likes3CommentsRe: Python - Using ADO and RecordSet in testcomplete scripts
Hi tristaanogrethanks for your reply. Yes I noticed all the examples I see are of this flavor (using my example): rec_set = conn.Execute_("SELECT * FROM C WHERE D='E'") rec_set.MoveFirst() while not rec_set.EOF: Log.Message(rec_set.Fields.Item["A"].Value, rec_set.Fields.Item["B"].Value) rec_set.MoveNext() But what if I don't want just the values for columns "A" and "B", but for all the columns. Also, I'm still having trouble with the "SELECT *...." statement, which is strange.5.8KViews1like7CommentsRe: Python - Using ADO and RecordSet in testcomplete scripts
Thanks NisHeraI saw this example as well. However what I was looking for was an iterative way of getting the values. In this example, "Emp ID" and "Name" are hardcoded, but what if I have a record that has about 100 columns and I want to print all the values of each column?5.8KViews0likes1CommentPython - Using ADO and RecordSet in testcomplete scripts
Two questions I have regarding the ADO interface with Python: 1. When I do: rec_set = conn.Execute_("SELECT A, B FROM C WHERE D='E") ... there's no problem, but if I do: rec_set = conn.Execute_("SELECT * FROM C WHERE D='E'") ... I get a RuntimeError - Unspecified error exception window? 2. I'm not sure how to iterate through and get rows from a RecordSet. Assuming rec_set above is populated from a successful query, how do you extract each row and put them in a list of dicts (where the dict keys are the column names, each row in the list is a row in the RecordSet). The examples one example I've seen in: https://support.smartbear.com/testcomplete/docs/testing-with/advanced/working-with-external-data-sources/databases/using-ado-and-bde-objects/working-with-ado-recordset.html doesn't really cover this in detail. thanks,Solved6.3KViews0likes12Comments