Invalid column index

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

mkushwaha
Ebase User
Posts: 29
Joined: Mon Nov 02, 2015 7:19 pm

Invalid column index

#1

Postby mkushwaha » Thu Jun 09, 2016 12:34 pm

Getting following error

028 Debug: select '?' as item_id, '?' as item_name, sequence as sequences, status from LIST_ANGINA
07:34:38.028 Debug: parameter1 : value ANGINA_ID
07:34:38.028 Debug: parameter2 : value ANGINA_DESCRIPTION
07:34:38.029 Error: unable to set column column1 with type CHAR from field with type CHAR, types incompatible? - Invalid column index
029 Error: Fetch error: unable to set column column1 with type CHAR from field with type CHAR, types incompatible? - Invalid column index
07:34:38.030 Error: Wrapped com.ebasetech.xi.exceptions.FormRuntimeException: Fetch error: unable to set column column1 with type CHAR from field with type CHAR, types incompatible? - Invalid column index (CCORE_LIST_BP#22)

Could anyone give me pointers as to where to look ?
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Thu Jun 09, 2016 2:29 pm

I guess you are trying to substitute database column names dynamically into the SQL statement and have them returned as item_id and item_name. To do this dynamic substitution you need to click the Dynamic Sql checkbox for both of these dynamically substitutable column names - column1 and column 2? So the database resource should have 4 resource fields (ignoring any other columns you might need) and these are all mapped to form fields.

Resource fields
column1 Dynamic Sql set to a valid column name e.g."ANGINA_ID"
column2 Dynamic Sql set to a valid column name e.g. "ANGINA_DESCRIPTION"
item_id After fetch, will contain the selected value from the DB
item_name After fetch, will contain the selected value from the DB
0 x

mkushwaha
Ebase User
Posts: 29
Joined: Mon Nov 02, 2015 7:19 pm

#3

Postby mkushwaha » Thu Jun 09, 2016 4:01 pm

Thanks Jon. Just on the same note. I have a database resource as table and I have native SQL configured for select, update, delete and insert. When I am doing following insert

Code: Select all

insert into &&list_name values (&&item_id,&&item_name,&&sequences, &&status)
the code it generate has quotes with list name so it gives me invalid table name. The generated query looks like this.

Code: Select all

insert into 'LIST_ANGINA' values (6,'CCS Class 5',6, 'Active')
How do I tell Ebase to remove the quotes which I didn't put in the first place. See insert code above. Thanks for the help
0 x

mkushwaha
Ebase User
Posts: 29
Joined: Mon Nov 02, 2015 7:19 pm

#4

Postby mkushwaha » Thu Jun 09, 2016 4:07 pm

Never mind my last comment. I figured it out through documentation. Thanks Jon for all your help :)
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#5

Postby Jon » Thu Jun 09, 2016 4:15 pm

I think it's valid to have quotes around the table name but it should then instruct the database to treat the name as case sensitive i.e. it should work so long as your table is actually named LIST_ANGINA in upper case.

To answer your question I think you can con the system into removing the quotes by changing the type of the list_name resource field in the Database Resource to INTEGER. This is a bit of a hack but I think it will work.
0 x

mkushwaha
Ebase User
Posts: 29
Joined: Mon Nov 02, 2015 7:19 pm

#6

Postby mkushwaha » Fri Jun 10, 2016 5:02 pm

Thanks Jon. I appreciate your help!
0 x


Who is online

Users browsing this forum: No registered users and 3 guests