I have a dblink called times.
Im creating oracle report.
This is my query:
select
tbloola_master."account_name" acctname
from
"tblOOHA_Master"#times tbloola_master;
Problem:
When I run the report, I GOT EMPTY REPORT.
I tried converting the field using TO_CHAR and it works.
select
TO_CHAR(tbloola_master."account_name") acctname
from
"tblOOHA_Master"#times tbloola_master;
I don't understand.Please help.Thanks.
Related
I use Crystal report 2011 to create report from with data from Oracle database. I have a Allow multi values parameter name userid (userid is string).
I want to query
Select ... from table where userid in {?userid};
I try {?userid}, ({?userid}), '{?userid}' ... but it's not working.
what should I do?
Put the cursor on the place where you want it, and double click on the parameter.
I have configured JDBC connection in my JMeter test plan.
The database settings in JDBC connection are configured correctly.
I am extracting employee id from one of my requests response.(i.e Employee_Id)
By using BSF PostProcessor, i have stored the employee id into a variable called as Emp_ID
I want to insert the extracted employee id into my database.
Database used is Oracle SQL developer, Version 4.0.1.14,Build MAIN-14.48.
Table name is : Employee_Details
Column name is : Employee_id ,Datatype: VARCHAR2
In JDBC request,i have selected "Query Type" as "Update Statement" and entered the following query:
Query 1: INSERT INTO Employee_Details (Employee_id)
VALUES (${Emp_ID})
Query 2: INSERT Employee_id='${Emp_ID}'
Parameter Types is given as VARCHAR2.
On both the execution, JMeter displays error as "Cannot create PoolableConnectionFactory (ORA-00923: FROM keyword not found where expected)"
Please provide your valuable suggestion on this.
I found a workaround for this that avoids having problems:
JDBC Request Query Type needs to be: Update Statement
The query needs to be processed as a block
BEGIN
SQL Statement
END;
My expectation is that you have incorrect validation query:
If you left the "Validation Query" box value default - Select 1 - Oracle may not like it very much. You need to change it to select 1 from dual
References:
DBCP - validationQuery for different Databases
The Real Secret to Building a Database Test Plan With JMeter
ORA-00923: FROM keyword not found where expected tips
There are 3 things as follows:
Check the validation query and keep it blank. Screenshot is attached
When you are executing insert query, keep Query Type as Updated
When you are executing query please add database.tablename and then execute.
I have bunch of plsql which has dynamic queries ( ie queries are framed as string and executed with immediate execute function). I want to find the dependent tables and columns for a plsql. I am planning to achieve by GSQL parser. I tried the plsql file as it is, because of dynamic queries, I am not able to get the dependency information. The alternate way is collecting the list of SQL statements executed during the plsql run. How to get sql statement for a plsql and store it a table with unit name mapping ?
Hi you need execute the sql you have saved with execute immediate;
you will get all sql in below oracle view
select * from v$sql;
select * from dba_hist_sqltext;
Currently I'm using Birt Report to generate report from my system. I'm using input parameter to send parameter from my system to Birt Report. The problem is when I'm trying to send multiple parameter from my system.
SQL statement at Birt Report for one parameter
select actualdate from table1 where storeloc = ?;
When I use this query for one parameter, it work.
I tried sql like this
select actualdate from table1 where storeloc = params["storeloc"].value;
I already created parameter at data set and report parameter but it's still can't gets to work
and also birt dont show me the options in edit dataset for query and Linked To Report Parameters in parameters
so what should i do?
Create a parameter storeloc in report params section of Data source.
Write this query in dataset open:
select actualdate from table1 where storeloc='"+params["storeloc"]+"';
Fetch the actualdate value in data source fetch and run the report.
I'm having one of those throw the computer out the window days.
I am working on a problem involving Crystal Reports (Version 10) and an Oracle Database (11g).
I am taking a view from the database that returns a string (varcahr2(50)) which is actually a number, when a basic SELECT * query is run on this view I get the number back in the format 000000000000100.00.
When this view is then used in Crystal Reports I can view the field data, but I can't sum the data as it is not a number.
I began, by attempting to using ToNumber on the field, to which Crystal's response was that the string was not numeric text. Ok fair enough, I went back to the view and ran TO_NUMBER, when this was then used in crystal it did not return any results. I also attempted to run TO_CHAR on the view so that I could hopefully import the field as text and then perform a ToNumber, yet the same as with the TO_NUMBER no records were displayed.
I've started new reports, I've started new views. No avail.
This seems to have something to do with how I am retrieving the data for the view.
In simplistic terms I'm pulling data from a table looking at two fields a Foreign Key and a Value field.
SELECT PRIMARY_KEY,
NVL(MAX(DECODE(FOREIGN_KEY, FOREIGN_KEY_OF_VALUE_I_NEED, VALUE_FIELD)), 0)
FROM MY_TABLE
GROUP BY PRIMARY_KEY
When I attempted to put modify the result using TO_NUMBER or TO_CHAR I have used it around the VALUE_FIELD itself and the entire expression, wither way works when the run in a SQL statement. However any TO_NUMBER or TO_CHAR modification to the statement returns no results in Crystal Reports when the view is used.
This whole problem smacks of something that is a tick box or equivalent that I have overlooked.
Any suggestions of how to solve this issue or where I could go to look for an answer would be greatly appreciated.
I ran this query in SQL Developer:
SELECT xxx, to_number(xxx) yyy
FROM (
SELECT '000000000000100.00' XXX FROM DUAL
)
Which resulted in:
XXX YYY
000000000000100.00 100
If your field is truly numeric, you could create a SQL Expression field to do the conversion:
-- {%NUMBER_FIELD}
TO_NUMBER(TABLE.VALUE_FIELD)
This turned out to be an issue with how Crystal Reports deals with queries from a database. All I needed to do was contain my SQL statement within another Select Statement and on this instance of the column apply the TO_NUMBER so that Crystal Reports would recognize the column values as numbers.
Hopefully this helps someone out, as this was a terrible waste of an afternoon.