Selenium RC: How to verfiy the format/Datatype of a table columns - selenium-rc

There are three columns in a table: 'ID', 'Name', 'DoB' with datatype as number, string and date resp.
now i need to verify that data displayed in each column matches its datatype.
How can i do this in Selenium RC?

Extract everything as string and then apply regular expressions.

Related

Cascading LOV - Invalid number while updating record - Oracle Apex

I have a select list based on other select list. It works fine on the create screen but gives 'Invalid number' error in update screen.
SQL query:
select description, account_id
from t_account
where chart_id = :P15_chart_name
Please help me out!
You are trying to convert a string into a number, and that failed.
As Select List item has 2 values: 1st being display and the 2nd return value, it is the 2nd value that causes problems - account_id in your case.
For example, it contains value A while column that is supposed to accept this value is declared as NUMBER. Oracle can't convert A into a number and raises an error.
What to do?
make sure that Select List item LoV query returns only numbers, or
modify column's datatype to varchar2
If that's not it, then :P15_CHART_NAME item and chart_id table column differ in datatypes; a simple option is to fix page item's datatype.

Phoenix: Convert String column to Integer column

I am looking for a Built-in UDF or any other method to convert values of a string column to integer in my phoenix table for sorting using SELECT and ORDER BY. I searched in the apache language Manual, but no use. Any other suggestions also welcome.
Actual Query
select "values" from "test_table"
I tried below approach but did not work
select TO_NUMBER("values", '\u00A4') from "test_table"
TO_NUMBER returns decimal but you can cast the result to INTEGER
SELECT CAST(TO_NUMBER(MY_COLUMN) AS INTEGER) FROM MY_DB
select TO_NUMBER(values) from test_table;
see https://phoenix.apache.org/language/functions.html#to_number

Parse a varchar2 Column Value

I want to remove a piece of a string from a particular table's column. The string I wish to remove is the &expires and everything after it but leave everything before the &expires the same. Is there a way to accomplish with the update statement or is a stored procedure needed?
Table column value is:
Starting Value: DAABq3J65GvwBABbWdkFOnpCj2mEA1lMonZBZADcTYJR6QuLPUlfZBtMyoEl4x2JXQ49cOzjZAStQxWNOgrurtnMNIw04bmOcQ4SsrjuPKH4AZBBBAf8ZBjWhs8BM52aC0OpnPGzjm6V2x50qk6wboT&expires=5183999
Desired Ending Value:
DAABq3J65GvwBABbWdkFOnpCj2mEA1lMonZBZADcTYJR6QuLPUlfZBtMyoEl4x2JXQ49cOzjZAStQxWNOgrurtnMNIw04bmOcQ4SsrjuPKH4AZBBBAf8ZBjWhs8BM52aC0OpnPGzjm6V2x50qk6wboT
update table set column = regexp_replace(column, '&'||'expires=.*$')

Determining the data type of a string value in Oracle

Ok...this is what I've got. There's an Oracle database table that has a column which is a VARCHAR data type. This column, call it 'value', contains strings that represent different values for different things. So some records have a number in this column, others have scientific notation, others dates, other actual characters etc. but they'll all are stored as strings in this 'value' column.
I need to write a view that can query this table and determine what data type is represented by the string in the 'value' column. I know I can do PL/SQL to do this, but I don't have access to create a stored procedure and this needs to be in a view - for other reasons.
I think you need to have an extra column describing the value stored in the Value column
Value VARCHAR2,
ValueType VARCHAR2 -- e.g. Age, Name, Money
In your view you then use a CASE statement to determine
CASE
WHEN ValueType = 'Age' THEN 'integer'
WHEN ValueType = 'Name' THEN 'string'
WHEN ValueType = 'Money' THEN 'decimal'
END As ColumnValueType
You can also use Regular expression

Oracle nested data type as a flat file

This is a script to produce the dataset of a nested table:
create table descriptions(
id number,
description varchar2(10)
);
insert into descriptions values(1,'abfd');
insert into descriptions values(1,'frte');
insert into descriptions values(2,'eewd');
insert into descriptions values(2,'outr');
create or replace type nt_description as table of varchar2(10);
-- the following query produces a dataset to save as a flat file
select id, cast(collect(description) as nt_description) as nested_column from descriptions group by id;
What I want to achieve is to produce flat output txt file. However, the result of the nested column output as flat file is unexpected when using SQL Developer GUI. The format of the output file is following when exporting data as text:
"ID" "NESTED_COLUMN"
1 DBUSER.NT_DESCRIPTION('abfd','frte')
2 DBUSER.NT_DESCRIPTION('eewd','outr')
I would like to get the following format instead of preceding format:
"ID" "NESTED_COLUMN"
1 'abfd','frte'
2 'eewd','outr'
I can achieve it by using text editor and replacing or regexing undesirable data (with the help of notepad++) but is it possible to get the same result without manually replacing "DBUSER.NT_DESCRIPTION(" and ")" by void string?
If you obligatory need use collect, you can make a function as shown in this link.
If not, you can use wm_concat:
select d.id,
wm_concat(d.description)
nested_column
from
descriptions d
group by id;

Resources