Adding multiple SQL Commands, Errors
When I add a second SQL Command to my report I get the following error messages right before it attempts to update the data. I have tried replacing the new SQL into the existing SQL command and it works, so I am fairly certain the SQL syntax is correct.
"Failed to retrieve data from the database" and "unknown database connection error".
Any idea as to why this is occurring?
Thanks!
If you're using a command, you should use a single command to provide ALL of the data for your report. Please see my post here Best Practices When Using Commands with Crystal Reports for more information about how to use commands.
-Dell
Similar Messages
-
Howto: multiple sql-commands in oracle-xe
Hi,
just installed the oracle-xe. Now I want to create tables, indexes etc within the sql-command tool.
For example:
CREATE TABLE ZUSTAENDIGKEIT (
INSTITUTION_ID VARCHAR2(30) NOT NULL,
FUNKTION_ID NUMBER(4) NOT NULL,
LIEGENSCHAFT_ID VARCHAR2(30) NOT NULL);
CREATE UNIQUE INDEX UX_ZUSTAENDIGKEIT
ON ZUSTAENDIGKEIT (LIEGENSCHAFT_ID,FUNKTION_ID)
Executing this as one command I receive an error ora-00911.
Executing this in two parts it works?
Thanks for any help.
grassuHere is just a sample that should work as a script in the web interface:
-- BVM
-- Benoetigte Sequence numbers
-- Globale Sequence
DROP SEQUENCE bvm_seq;
CREATE SEQUENCE bvm_seq
MINVALUE 1
MAXVALUE 999999999
INCREMENT BY 1
START WITH 1
CACHE 20
NOORDER
NOCYCLE
-- Log Sequence
CREATE SEQUENCE BVM_LOG_SEQ
MINVALUE 1
MAXVALUE 999999999
INCREMENT BY 1
START WITH 1
CACHE 20
NOORDER
NOCYCLE
;Note: no "/" (you need these only after trigger, procedures, etc.)
You need to execute this in the script section, not in the command section of the web interface.
C. -
SQL Command Error on Hosted environment
An error is occurring on the oracle hosted environment. I don't believe that it is a problem with my IE, but with my company's antivirus software. Is there some setting I should ask them to do? I am unable to run sql commands on the hosted environment.
Line: 241
Char: 7
Error: Automation server can't create object
Code:0
URL:http//htmldb.oracle.com/pls/otn/f?p=4500:1001Hi <please supply your name>,
SQL Developer Worksheet is not available from the command line.
The BRIDGE command is only supported in the Worksheet.
Its an interesting idea though. Are you trying to script data move from a non Oracle database to an Oracle database using the BRIDGE command?
The BRIDGE command was initially done to allow a simple data move from a non Oracle database to Oracle. We then build the "Copy to Oracle" feature out of it.
http://dermotoneill.blogspot.com/2010/11/cross-database-bridge-statement.html
http://dermotoneill.blogspot.com/2010/11/copy-to-oracle.html
Since the BRIDGE command references connection names, which have to be defined in UI of SQL Developer any solution to run this on the command line would have to work this out.
There are number of ways you can do this without using the BRIDGE command.
1) Perform a capture/convert of your non Oracle database and then generate the "offline" data move scripts.
Theses scripts use SQL*Loader and your non Oracle database tool (Ex: Sybase BCP).
These are run from the command line and can be modified ....
2) Use a database link from your Oracle database to your non Oracle database and reference /query the data that way.
I would interested to hear your thoughts.
Regards,
Dermot
SQL Developer Team. -
Unexpected end of SQl command error ORA-921
I wrote this query as part of a larger query, however I can't seem to figure out why this ection gives me the ORA-921 error after the comparison expression (underlined below).
with
s2n as (
select distinct employeefk, policyref, advicename
from source
where
(payrollfk = (select payrollfk1 from payroll_1) or payrollfk = (select payrollfk2 from payroll_2)) and
displaysequence >= 0
group by employeefk, displaysequence, policyref, classificationtype, advicename, payrollfk)I used hr demo tables for a similar query, check the usage examples of with clause - http://psoug.org/reference/with.html
C:\>sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Pzt Eyl 10 23:10:07 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> conn hr/hr
Connected.
SQL> WITH tong AS (
2 select distinct employee_id, first_name, last_name
3 from employees
4 where salary >= 0
5 and (department_id = (select department_id from departments
6 where department_name = 'IT') or
7 department_id = (select department_id from departments
8 where department_name = 'NOC')
9 )
10 group by employee_id, first_name, last_name)
11 SELECT /*+ MATERIALIZE */ * FROM tong ;
EMPLOYEE_ID FIRST_NAME LAST_NAME
104 Bruce Ernst
105 David Austin
106 Valli Pataballa
103 Alexander Hunold
107 Diana Lorentz -
Schema name added to SQL query after SQL Command
Post Author: rickeb1
CA Forum: Data Connectivity and SQL
Hello,
I am using Crystal Reports XI. I have created a Crystal report in the usual manner using a set of tables from a given database schema. When I look at the SQL query that Crystal generates, there are no data schema qualifiers anywhere.
Then I added an SQL Command object that I use as an additional table. Now when I look at the generated SQL query, the data schema name is added to the beginning of the original query as well as to the new SQL Comand code. It also creates an EXTERNAL JOIN which uses this hard-coded schema name (not exactly sure what an "external join" is).
This hard-coding of the schema name is causing a problem when we try to migrate the report to a different environment. Is there some way to avoid having Crystal generate a query with the schema name imbedded in the query, or is there a way to remove it after it is generated?
Thanks!Post Author: rickeb1
CA Forum: Data Connectivity and SQL
Actually, our problem may be related to this:
http://boardreader.com/t/Crystal_XI_249231/The_Show_SQL_Query_SQL_command_changes_89667.html
Any help greatly (and desparately) apapreciated! -
In batch file i want to execute sql commands
in x.bat file i write the following
sqlplus user/pass@host @c:\a.sql
@c:\b.sql
when i execute this batch file it is connected to the databse
and the table of a.sql is created in the database.
but b.sql is not created.
it is creating only one table
i want ot create more no of tables with different .sql files
like @c:b.sql
@c:c.sql
@c:d.sql
please any body helpThe problem you are running into is that SQL Plus only recognizes the first command you have written in the batch file.
sqlplus user/pass@host
SPOOL c:\master.log
@c:\a.sql
@c:\b.sql
SPOOL OFF
SQLPlus will recognize the spool and first sql command, but the batch file gets command back after the first sql command executes and doesn't recognize @c:\b.sql or know what to do with it. To run multiple SQL commands you have to create an external SQL file with all the sql commands in it with the Spool files you want created, then in the batch file you only call the one SQL script.
Create a master file like so:
-- Script Name : AllFiles.sql
SPOOL c:\master.log
@c:\a.sql
@c:\b.sql
SPOOL OFF
In x.bat
CALL SQLPlus user/password@database @AllFiles.sql
This should get you your required results. -
How can I search multiple columns in a SQL command of Union tables
Hi:
We have a database with tables that are nearly identical that we use for production and production history.
I have created an SQL command in Crystal 2008 to joins several of the tables and then added a "UNION" to connect the History and Prod tables.
I need to search multiple (3 total) columns for 5 different data types, to return the records being investigated. I tried this using an "OR" statement in the where clause and have had inconsistant results.
The first two or statement function perfectly the third works as long as the value being passed is numeric and the last two fail consistantly with invalid column name errors. It appears that crystal is getting confused and passing the wrong data type especially if I do a new search using a different option for the "?SearchParam"
Can some one offer some insite on how I can search these fields to return the record data needed
-- {?SearchParam} is the search parameter passed by Crystal that is a number 1 thru 5
-- {?Search_Val} is a parameter that is passed by Crystal that is a string of what to search for 1 = Numeric CMP ord #("TBSLI21"."LI21_OR_NO"), 2 = Numeric CI ord # ( "TBSLI33"."LI33_CI_OR_NO"),
-- 3 =String Ext Sys ord string ("TBSLI33"."LI33_EXT_SYS_SL_OR_NO"), 4 = String CMP Grp string ("TBSLI21"."LI21_OP_GRP_NO"), 5 = composit string PP ord string ("TBSOP13"."OP13_CLR_DAY" & "TBSOP13"."OP13_PP_GRP_SEQ_NO" & "TBSOP13"."OP13_CELL_ID")
SELECT "TBSLI21"."LI21_OR_NO",
"TBSLI21"."LI21_SH_DT_SCDL",
"TBSLI21"."LI21_TS_EN_ORIG",
"TBSLI21"."LI21_TS_SHIP",
"TBSLI21"."LI21_SYS_ORD_CD",
"TBSLI21"."LI21_SHIP_ID",
"TBSLI21"."LI21_WRKST_ID",
"TBSLI21"."LI21_LI_NO",
"TBSLI33"."LI33_CI_OR_NO",
"TBSLI33"."LI33_EXT_SYS_SL_OR_NO",
"TBSLI21"."LI21_OP_GRP_NO",
"TBSLI21"."LI21_LI_STAT",
"TBSOP13"."OP13_OP_GRP_STAT",
"TBSLI31"."LI31_LI_EV_DTL_TX",
"TBSLI31"."LI31_DT_EN",
"TBSLI31"."LI31_TM_EN",
"TBSLI31"."LI31_LI_EV",
"TBSLI21"."LI21_OP_WSH_FLNM",
"TBSLI21"."LI21_PR_ITF_CD",
"TBSLI21"."MFG_PLANT_CD",
"MFG_PLANT_LI"."MFG_PLANT_CD" as PrefPlant,
"TBSOP13"."OP13_OP_GRP_DSP_CD",
"TBSLI21"."LI21_LI_DSP_CD",
"TBSOP13"."OP13_CLR_DAY",
"TBSOP13"."OP13_PP_GRP_SEQ_NO",
"TBSOP13"."OP13_CELL_ID",
"MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG",
"TBSLI21"."LI21_OP_GRP_PS_NO1",
"TBSLI21"."LI21_POMS_MERGE_NO",
"TBSLI31"."LI31_OP_ID",
"TBSLI21"."LI21_LI_POR_FG",
"TBSLI21"."LI21_BIN_ID",
"TBSLI21"."LI21_TS_MRSHL",
"TBSLI33"."LI33_CI_LI_NO",
"TBSLI33"."LI33_SH_ADDR_1",
"TBSLI33"."LI33_SH_ADDR_2",
"TBSLI33"."LI33_SH_ADDR_3",
"TBSLI33"."LI33_SH_ADDR_4",
"TBSLI33"."LI33_SH_CITY_NM",
"TBSLI33"."LI33_SH_ST_NM",
"TBSLI33"."LI33_SH_ZIP_CD",
"TBSLI33"."LI33_CU_NM",
"TBSLI33"."LI33_CU_BUS_NM"
FROM ((("CMPREPORTING"."dbo"."TBSLI33" "TBSLI33" FULL OUTER JOIN "CMPREPORTING"."dbo"."TBSLI21" "TBSLI21" ON ("TBSLI33"."LI33_BS_OR_NO"="TBSLI21"."LI21_OR_NO") AND ("TBSLI33"."LI33_BS_LI_NO"="TBSLI21"."LI21_LI_NO")) LEFT OUTER JOIN "CMPREPORTING"."dbo"."TBSOP13" "TBSOP13" ON "TBSLI21"."LI21_OP_GRP_NO"="TBSOP13"."OP13_OP_GRP_NO") LEFT OUTER JOIN "CMPREPORTING"."dbo"."TBSLI31" "TBSLI31" ON ("TBSLI21"."LI21_OR_NO"="TBSLI31"."LI31_OR_NO") AND ("TBSLI21"."LI21_LI_NO"="TBSLI31"."LI31_LI_NO")) LEFT OUTER JOIN "CMPREPORTING"."dbo"."MFG_PLANT_LI" "MFG_PLANT_LI" ON ("TBSLI21"."LI21_OR_NO"="MFG_PLANT_LI"."OR_NO") AND ("TBSLI21"."LI21_LI_NO"="MFG_PLANT_LI"."LI_NO")
WHERE {?aSearchParam} = 1 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI21"."LI21_OR_NO"=Cast( {?Search_Val} as Int)
or {?aSearchParam} = 2 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI33"."LI33_CI_OR_NO"=Cast( {?Search_Val} as numeric(12,0))
or {?aSearchParam} = 3 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(20),"TBSLI33"."LI33_EXT_SYS_SL_OR_NO")= Convert( VarChar(20), {?Search_Val})
or {?aSearchParam} = 4 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8),"TBSLI21"."LI21_OP_GRP_NO") = Convert( VarChar(8), {?GroupNo})
or {?aSearchParam} = 5 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8), ("TBSOP13"."OP13_CLR_DAY" & "TBSOP13"."OP13_PP_GRP_SEQ_NO" & "TBSOP13"."OP13_CELL_ID")) = Convert( VarChar(8), {?GroupNo})
Union
SELECT "TBSLI21_HIST"."LI21_OR_NO",
"TBSLI21_HIST"."LI21_SH_DT_SCDL",
"TBSLI21_HIST"."LI21_TS_EN_ORIG",
"TBSLI21_HIST"."LI21_TS_SHIP",
"TBSLI21_HIST"."LI21_SYS_ORD_CD",
"TBSLI21_HIST"."LI21_SHIP_ID",
"TBSLI21_HIST"."LI21_WRKST_ID",
"TBSLI21_HIST"."LI21_LI_NO",
"TBSLI33_HIST"."LI33_CI_OR_NO",
"TBSLI33_HIST"."LI33_EXT_SYS_SL_OR_NO",
"TBSLI21_HIST"."LI21_OP_GRP_NO",
"TBSLI21_HIST"."LI21_LI_STAT",
"TBSOP13_HIST"."OP13_OP_GRP_STAT",
"TBSLI31_HIST"."LI31_LI_EV_DTL_TX",
"TBSLI31_HIST"."LI31_DT_EN",
"TBSLI31_HIST"."LI31_TM_EN",
"TBSLI31_HIST"."LI31_LI_EV",
"TBSLI21_HIST"."LI21_OP_WSH_FLNM",
"TBSLI21_HIST"."LI21_PR_ITF_CD",
"TBSLI21_HIST"."MFG_PLANT_CD",
"MFG_PLANT_LI_HIST"."MFG_PLANT_CD",
"TBSOP13_HIST"."OP13_OP_GRP_DSP_CD",
"TBSLI21_HIST"."LI21_LI_DSP_CD",
"TBSOP13_HIST"."OP13_CLR_DAY",
"TBSOP13_HIST"."OP13_PP_GRP_SEQ_NO",
"TBSOP13_HIST"."OP13_CELL_ID",
"MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG",
"TBSLI21_HIST"."LI21_OP_GRP_PS_NO1",
"TBSLI21_HIST"."LI21_POMS_MERGE_NO",
"TBSLI31_HIST"."LI31_OP_ID",
"TBSLI21_HIST"."LI21_LI_POR_FG",
"TBSLI21_HIST"."LI21_BIN_ID",
"TBSLI21_HIST"."LI21_TS_MRSHL",
"TBSLI33_HIST"."LI33_CI_LI_NO",
"TBSLI33_HIST"."LI33_SH_ADDR_1",
"TBSLI33_HIST"."LI33_SH_ADDR_2",
"TBSLI33_HIST"."LI33_SH_ADDR_3",
"TBSLI33_HIST"."LI33_SH_ADDR_4",
"TBSLI33_HIST"."LI33_SH_CITY_NM",
"TBSLI33_HIST"."LI33_SH_ST_NM",
"TBSLI33_HIST"."LI33_SH_ZIP_CD",
"TBSLI33_HIST"."LI33_CU_NM",
"TBSLI33_HIST"."LI33_CU_BUS_NM"
FROM ((("CMPREPORTING"."dbo"."TBSLI33_HIST" "TBSLI33_HIST" FULL OUTER JOIN "CMPREPORTING"."dbo"."TBSLI21_HIST" "TBSLI21_HIST" ON ("TBSLI33_HIST"."LI33_BS_OR_NO"="TBSLI21_HIST"."LI21_OR_NO") AND ("TBSLI33_HIST"."LI33_BS_LI_NO"="TBSLI21_HIST"."LI21_LI_NO")) LEFT OUTER JOIN "CMPREPORTING"."dbo"."TBSOP13_HIST" "TBSOP13_HIST" ON "TBSLI21_HIST"."LI21_OP_GRP_NO"="TBSOP13_HIST"."OP13_OP_GRP_NO") LEFT OUTER JOIN "CMPREPORTING"."dbo"."TBSLI31_HIST" "TBSLI31_HIST" ON ("TBSLI21_HIST"."LI21_OR_NO"="TBSLI31_HIST"."LI31_OR_NO") AND ("TBSLI21_HIST"."LI21_LI_NO"="TBSLI31_HIST"."LI31_LI_NO")) LEFT OUTER JOIN "CMPREPORTING"."dbo"."MFG_PLANT_LI_HIST" "MFG_PLANT_LI_HIST" ON ("TBSLI21_HIST"."LI21_OR_NO"="MFG_PLANT_LI_HIST"."OR_NO") AND ("TBSLI21_HIST"."LI21_LI_NO"="MFG_PLANT_LI_HIST"."LI_NO")
WHERE {?aSearchParam} = 1 and "MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI21_HIST"."LI21_OR_NO"= Cast( {?Search_Val} as Int)
or {?aSearchParam} = 2 and "MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI33_HIST"."LI33_CI_OR_NO"= Cast( {?Search_Val} as numeric(12,0))
or {?aSearchParam} = 3 and "MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(20), "TBSLI33_HIST"."LI33_EXT_SYS_SL_OR_NO")= Convert( VarChar(20),{?Search_Val})
or {?aSearchParam} = 4 and "MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8),"TBSLI21_HIST"."LI21_OP_GRP_NO")= Convert( VarChar(8), {?GroupNo} )
or {?aSearchParam} = 5 and "MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8), ("TBSOP13_HIST"."OP13_CLR_DAY" & "TBSOP13_HIST"."OP13_PP_GRP_SEQ_NO" & "TBSOP13_HIST"."OP13_CELL_ID")) = Convert( VarChar(8), {?GroupNo})This is actually a fairly easy fix - because of the way the "OR" works in SQL, you need to surround each "set" of statements in the or with parentheses. So, it would look something like this:
Where
({?aSearchParam} = 1 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI21"."LI21_OR_NO"=Cast( {?Search_Val} as Int))
or
({?aSearchParam} = 2 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI33"."LI33_CI_OR_NO"=Cast( {?Search_Val} as numeric(12,0)))
or
({?aSearchParam} = 3 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(20),"TBSLI33"."LI33_EXT_SYS_SL_OR_NO")= Convert( VarChar(20), {?Search_Val}))
or
({?aSearchParam} = 4 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8),"TBSLI21"."LI21_OP_GRP_NO") = Convert( VarChar(8), {?GroupNo}))
or
({?aSearchParam} = 5 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8), ("TBSOP13"."OP13_CLR_DAY" & "TBSOP13"."OP13_PP_GRP_SEQ_NO" & "TBSOP13"."OP13_CELL_ID")) = Convert( VarChar(8), {?GroupNo}))
-Dell -
Adding more statements to the sql commands window
Hi, I'm using oracle database express edition10g and I just started using oracle.
And I'm having a problem adding more then one statement inside the sql commands gui window.
I write:
CREATE TABLE "testTable" (
"field1" VARCHAR2(2),
"field2" NUMBER(2,0),
"field3" NUMBER(2,0),
CONSTRAINT "Test_PK" PRIMARY KEY("field1")
Oracle reports: table created
I write
DROP TABLE testTable;
CREATE TABLE "testTable" (
"field1" VARCHAR2(2),
"field2" NUMBER(2,0),
"field3" NUMBER(2,0),
CONSTRAINT "Test_PK" PRIMARY KEY("field1")
Oracle reports: ORA-00911: invalid character
I remove the ; char
ORA-00933: SQL command not properly ended
I look in the help files and it sais that ; / and nothing is allowed to end a operation.
I gues ; is a valid char so it's reporting something else?
I tried pasting my code inside wordpad and even retyping it. Mayby I have a hidden char? =>same error.
When I run drop and create seperatly it works.
When I run both sql statements inside sql+ it works
What m I doing wrong?To run multiple SQL in one shot, you need to save them as SQL batch file,
Save your statements as recreate.sql
DROP TABLE testTable;
CREATE TABLE "testTable" (
"field1" VARCHAR2(2),
"field2" NUMBER(2,0),
"field3" NUMBER(2,0),
CONSTRAINT "Test_PK" PRIMARY KEY("field1")
);Then call it from SQLPlus,
@recreate.sql -
SQL Command returns multiple records, but I see only one record in report
I work with Crystal Reports XI R2 SP3 and Oracle 10g R2 database.
I have an SQL Command that returns multiple records. Command name is "CommDivisionNames" and it returns column "CommDivisionNames.DIVISION_NAME". When I place this field into report details section of the report, I can see all 10 records returned and this is how it should be. I actually need this field to be placed in the report header section, and when I place the field there, then I see only the first record. I set that field as "can grow = true". When I do "browse field data" for this field, I see that all 10 records are there, but only the first one is displayed in report header section.
I thought that I can place SQL Command field anywhere on the report (page header, footer, details) and that it will always show all records that it returns from the database. Can that be done?
My "main part" of the report returns different set of records, and that's what I have in "report details" section. I need this list of divisions to be in the report header section, so user can see that the report was executed for DivA, DivC, DivE.
Thank you,
Milansharonamt:
Users select divisions from parameter, but the parameter multi values are division_numbers (1,5,10), not division_names. Division_names are visible in parameter_prompt_window as description, but parameter remembers only numbers and I don't know how I can reuse division_names later in formula.
I do join for division_numbers and make them into one string variable and pass to sub-report, but I think that I can only get these division_names by calling an SQL command or calling stored procedure.
If I try to do join({MySQLcommand.DIVISION_NAME}) I get error message "A string array is required here".
Carl:
I'm playing with cross-tab and I can use it to see all division_names in the report-header section. Since I need them in only one column or only one row, I have to edit cross-tab object and turn all unneeded border lines to white to make them look invisible. So, cross-tab could be a solution for my problem here.
Another option could be to re-write my SQL command. Since I've read here that SQL command could be written in the same way as I would write a stored procedure, then I could use a bit more complex code to get all multiple division names from the database table into a local cursor, and then use do-while loop to concatenate them into one string, and then to return that string as one record (like 'DivA, DivB, DivC'), and then it should not be a problem to display only that one record/string in report header. It is my understanding that Crystal Reports can call stored procedure that works with many cursors/recordsets and CR will use only the last recordset from the stored procedure. Do you think it could be done this way?
Thank you,
Milan -
I have created a execut sql task -
In that, i have a created a 'empidvar' variable of string type and put sqlstatement = 'select distinct empid from emp'
Resultset=resultname=0 and variablename=empidvar
I have added data flow task of ole db type and I put this sql statement under sql command - exec emp_sp @empidvar=?
I am getting an error.
[OLE DB Source [1]] Error: A rowset based on the SQL command was not returned by the OLE DB provider.
[SSIS.Pipeline] Error: component "OLE DB Source" (1) failed the pre-execute phase and returned error code 0xC02092B4.shouldnt setting be Result
Set=Full Resultset as your query returns a resultset? also i think variable to be mapped should be of object type.
Then for data flow task also you need to put it inside a ForEachLoop based on ADO.NET recordset and map your earlier variable inside it so as to iterate for every value the sql task returns.
Also if using SP in oledb source make sure you read this
http://consultingblogs.emc.com/jamiethomson/archive/2006/12/20/SSIS_3A00_-Using-stored-procedures-inside-an-OLE-DB-Source-component.aspx
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Validation Error - An error occured executing the provided SQL Command
Hi All,
I am new to using SQL Server in general (2008 R2) and am trying to change the source location for multiple packages in order to obtain our data from a more reliable environment.
I have created a copy of the target database where the data will be loaded, amended the source and target connection managers and ran through the packages to ensure they work, which many do.
We are changing the source from a local server to a cloud based server and when running a package that literally truncates target table, selects * from source, and inserts data to target I get a validation error "An error occurred executing the provided
SQL Command "Select *...." The connection has been disabled" and "component ADO NET Source failed validation and returned validation status "VS_ISBROKEN"".
The table structure from the 2 sources is the same and I have even recreated the data flow tasks to ensure the metadata has updated. When selecting 100 rows or even 5,000,000 rows from source the package runs fine but will fail as above
when selecting &* (around 9.5 million rows).
I'm not sure if this is due to the new data source being web based or if it could be some erroneous data in the table that isn't being selected when limiting to 5 milling rows etc.
I have spend hours trying to figure out what the issue could be (doesn't help being new to SQL Server) so any guidance would be hugely appreciated!!!
Thanks,
Louis.Hi All,
Unfortunately I don't believe any of the above are the issues.
Our current working project/packages run via an SQL agent job daily. To test and ensure the package in question ran outside of the agent WITHOUT changing the ADO NET Source I exported the package (that runs daily) and ran it locally,
to which it failed.
I then edited the select statement from 'select * from [table]' to 'select top(100) from [table] to which it ran without error.
So in summary:
Package will run fine if run as part of the agent job (with multiple other packages)
Package will not run from File System when selecting * from the source table
Package will run from File System when selecting limited rows
Could this be something to do with permissions? The errors I get are:
An error occurred executing the provided SQL command: "select * from [table]". The connection has been disabled.
"component" ADO NET Source"(396") failed validation and returned validation status "VS_ISBROKEN".
Thanks,
Louis. -
Any One Can Help Me--error :-SQL command not properly ended
hi,
this code has an error i have tried to find out this error but i can't find it so please help me :-
report error:
ORA-06550: line 1, column 149:
PL/SQL: ORA-00933: SQL command not properly ended
ORA-06550: line 1, column 7:
PL/SQL: SQL Statement ignored
Code
select HTMLDB_ITEM.HIDDEN(1,SEQ_ID),
HTMLDB_ITEM.TEXT(2,a.c001) c001,
HTMLDB_ITEM.TEXT(3,a.c002) c002,
HTMLDB_ITEM.TEXT(4,a.c003) c003,
APEX_ITEM.SELECT_LIST_FROM_QUERY(5,a.c004,'SELECT P_ID D,P_ID R FROM PARTY_DETAIL') c004,
APEX_ITEM.SELECT_LIST_FROM_QUERY
(6,a.c005,
'SELECT CATEGARY_NAME D,'||'CATEGARY_NAME R FROM ITEM_CATEGARY',
'style="width:220px" '
||'onchange="get_select_list_xml1(this,'
|| 'f7_'
|| LPAD (seq_id, 4, '0')
|| ')"',
'YES',
'0',
'-Select-',
'f6_'|| LPAD (seq_id, 4, '0'),
NULL,
'NO') c005,
APEX_ITEM.SELECT_LIST_FROM_QUERY
(7,a.c006,
'SELECT ITEM_CODE D,'
||'ITEM_CODE R FROM ITEM_MASTER'
||'WHERE CATEGARY_NAME ='
|| c005,
'style="width:220px"',
'YES',
'0',
'-Select Code ('
|| (Select Count(*)
from ITEM_MASTER
where CATEGARY_NAME = c005)
|| ')-',
'f7_' || LPAD (seq_id, 4, '0'),
NULL,
'NO') c006,
APEX_ITEM.SELECT_LIST_FROM_QUERY(8,a.c007,'SELECT ITEM_NAME D,ITEM_NAME R FROM ITEM_MASTER') c007,
HTMLDB_ITEM.TEXT(9,a.c008) c008,
APEX_ITEM.SELECT_LIST_FROM_QUERY(10,a.c009,'SELECT PACK_TYPE D,PACK_TYPE R FROM ITEM_PACKING') c009,
HTMLDB_ITEM.TEXT(11,a.c010) c010,
HTMLDB_ITEM.TEXT(12,a.c011) c011,
HTMLDB_ITEM.TEXT(13,a.c012) c012,
HTMLDB_ITEM.TEXT(14,a.c013) c013
FROM wwv_flow_collections a
where a.collection_name = 'REC_ITEM'
Thanks
Manoj
Edited by: Manoj Kaushik on Sep 10, 2009 3:36 AMhi mike,
My problem is:-
i have a bill with multiple item eg . Apple (12), Banana (49), Badam (145) , Grapes(25) with there quantity and now i want to Add these item with quantity in my database
when i finaly click on submit button .
Actully I have been used tabular form but i am facing one problem when using tabular form ,in Tabular form i enter first item eg . Apple and there quantity eg. 12 in textfield and after click on Add Row Buttom data insert in to the database . but i want Entry Shouldn't go in to the database. But only New Row Should Add there when i click on Add Row Button.
I want all these 4 item should enter in to data base when i click on Final Submit.
So i have use this collection report to insert multiple item .everything was all right when i was using text field but when i changed these textfield into select list then error has arise .
Actually i want also a cascade selectlist in this report .
eg .item name depend on item code and item code depend on item category name .
so i want when i select CATEGARY_NAME then item code come into report item and when i select ietem code them correcponding item name should come into item name field.
for cascade select list i have created application process and java script .
So please mike Suggest me some solution how can i do this .
its urgent for me .
This Is my code :-
select HTMLDB_ITEM.HIDDEN(1,SEQ_ID),
APEX_ITEM.TEXT(2,a.c001) c001,
APEX_ITEM.TEXT(3,a.c002) c002,
APEX_ITEM.TEXT(4,a.c003) c003,
APEX_ITEM.SELECT_LIST_FROM_QUERY(5,a.c004,'SELECT P_ID D,P_ID R FROM PARTY_DETAIL') c004,
APEX_ITEM.SELECT_LIST_FROM_QUERY
(6,a.c005,
'SELECT CATEGARY_NAME D,'||'CATEGARY_NAME R FROM ITEM_CATEGARY',
'style="width:220px" '
||'onchange="get_select_list_xml1(this,''f7_'|| LPAD (seq_id, 4, '0')
||''')"',
'YES',
'0',
'-Select-',
'f6_'|| LPAD (seq_id, 4, '0'),
NULL,
'NO') c005,
APEX_ITEM.SELECT_LIST_FROM_QUERY
(7,a.c006,
'SELECT ITEM_CODE D,'
||'ITEM_CODE R FROM ITEM_MASTER'
||'WHERE CATEGARY_NAME ='
|| c005,
'style="width:220px"',
'YES',
'0',
'-Select Code ('
|| (Select Count(*)
from ITEM_MASTER
where CATEGARY_NAME = c005)
|| ')-',
'f7_' || LPAD (seq_id, 4, '0'),
NULL,
'NO') c006,
APEX_ITEM.SELECT_LIST_FROM_QUERY(8,a.c007,'SELECT ITEM_NAME D,ITEM_NAME R FROM ITEM_MASTER') c007,
APEX_ITEM.TEXT(9,a.c008) c008,
APEX_ITEM.SELECT_LIST_FROM_QUERY(10,a.c009,'SELECT PACK_TYPE D,PACK_TYPE R FROM ITEM_PACKING') c009,
APEX_ITEM.TEXT(11,a.c010) c010,
APEX_ITEM.TEXT(12,a.c011) c011,
APEX_ITEM.TEXT(13,a.c012) c012,
APEX_ITEM.TEXT(14,a.c013) c013
FROM wwv_flow_collections a
where a.collection_name = 'REC_ITEM'
I am waiting for your positive responce.
thanks
Manoj
Edited by: Manoj Kaushik on Sep 10, 2009 4:46 AM -
I have an .XLSX File that I am trying to Upload into SQL Server. I use the Source as OLEDB Connection manager and pick OLDEB PROVIDER as MS OFFICE 12.0 ACCESS DATABASE ENGINE. In that I put this query but it gives the foll
error when I run the SSIS Package.
[OLE DB Source [1]] Error: No column information was returned by the SQL command.
Query I use in DATA FLOW TASK , IS SQL COMMAND:
Select top 1 [Investor #],[Investor Name], CONVERT (VARCHAR(1000),Delegation)AS DELEGATION ,[Date Added],[Date Revised] from [EXCELSHEET1$]
Any suggestion to fix this error? i have to do a convert since the excel datayype is DT_TEXT AND SQL TABLE DATATYPE is VARCHAR(1000) SO Have to do this Convert.If the target table's column is not a BLOB/CLOB (e.g. NVARCHAR(MAX)) and you have text longer than the max value it will not fit into the target, if you are allowed you need to trim it and convert, otherwise sure you get the error as the target datatype
is smaller.
Arthur My Blog -
Runtime Error in SQL command ..
Hi everybody
I have a report wich terminates with a dump message.
The error is in an SQL command, here the program aborts:
SELECT KUNNR KKBER KLIMK SAUFT SKFOR SSOBL
INTO TABLE I_KNKK
FROM KNKK
WHERE KUNNR IN R_KUNNR
AND KKBER IN R_KKBER
AND SBGRP IN S_SBGRP.
DATA: BEGIN OF I_KNKK OCCURS 0,
KUNNR LIKE KNKK-KUNNR,
KKBER LIKE KNKK-KKBER,
KLIMK LIKE KNKK-KLIMK,
SAUFT LIKE KNKK-SAUFT,
SKFOR LIKE KNKK-SKFOR,
SSOBL LIKE KNKK-SSOBL,
SBGRP LIKE KNKK-SBGRP,
END OF I_KNKK.
In first moment, i saw the table and SQL filter have the SBGRP field but the SQL fields selection has not this field. But, these same program works good with others selection parameters, in fact this SQL only terminates the program for the bigest company, wich causes the program make many BD access because all previous SQL.
The dump log says:
Runtime errors DBIF_RSQL_INVALID_RSQL
Exception CX_SY_OPEN_SQL_DB
Occurred on 23.05.2006 at 17:27:15
Error in the module RSQL accessing the database interface.
An exception occurred. The exception, which is assigned to the class 'CX_SY_OPEN_SQL_DB', neither caught nor passed along using a RAISING clause, in the procedure "(FORM)" . Since the caller of the procedure could not have expected this except to occur, the running program was terminated.
The reason for the exception is:
The SQL statement generated from the SAP Open SQL Statement violates restriction imposed by the database system used in R/3.
Possible errors:
o The maximum size of an SQL statement has been exceeded.
o The statement contains too many input variables.
o The space needed for the input data exceeds the
available memory.
o ...
How can i be sure the dump is for a lot of BD access for all the SQL commands ?
If these is the error, does somebody knows how can i eliminate this error ?
Please help ..
Regards
FrankI think the field discrepancy is a red herring here. Not guilty! I agree that using the 'CORRESPONDING FIELDS OF' is safer though.
The error could be happening because your range variables have lots of entries in them which makes the generated sql huge.
To break it up you could use the 'package size' option of the select. This will work it's way through the input in chunks (or packages) of the size you specify.
You could change it to:
SELECT KUNNR KKBER KLIMK SAUFT SKFOR SSOBL
INTO TABLE I_KNKK package size 2000 "or a variable value
FROM KNKK
WHERE KUNNR IN R_KUNNR
AND KKBER IN R_KKBER
AND SBGRP IN S_SBGRP.
process current contents of i_knkk here
endselect.
or ,
SELECT KUNNR KKBER KLIMK SAUFT SKFOR SSOBL
appending TABLE I_KNKK package size 2000
FROM KNKK
WHERE KUNNR IN R_KUNNR
AND KKBER IN R_KKBER
AND SBGRP IN S_SBGRP.
endselect. -
CallableStatement error: SQL command not properly ended
I am getting a strange error using CallableStatement and Oracle 7.3.4 with PL/SQL 2.3 using Classes12 JDBC driverset from Oracle. Here is the code we are using, which is almost verbatim from several Java/Oracle CallableStatement examples for Oracle 8. I am wondering what I am missing to make this work on Oracle 7 and am unable to find a reference online:
//String query = "begin PAC.PAC_WIP_WIPHEADER_PKG.GetWipNumPartList(?,?); end;";
String query = "{ call PAC.PAC_WIP_WIPHEADER_PKG.GETWIPNUMPARTLIST(?,?) } ";
CallableStatement csth = Connection.prepareCall(query);
csth.setString(1, wipNumber);
csth.setInt(2, PacCarousel.getCarouselNumber());
csth.execute();
using either the Begin or the call query (Begin commented in above code snip) is returning the following error from the JDBC driver:
java.sql.SQLException: ORA-00933: SQL command not properly ended
This identical 'begin' query works fine in TOAD or the PL/SQL console for Oracle, but just won't work using this set of JDBC drivers.
Has anyone run into this problem before or perhaps have some suggestions?
Thanks in advanceI am getting a strange error using CallableStatement and Oracle 7.3.4 with PL/SQL 2.3 using Classes12 JDBC driverset from Oracle. Here is the code we are using, which is almost verbatim from several Java/Oracle CallableStatement examples for Oracle 8. I am wondering what I am missing to make this work on Oracle 7 and am unable to find a reference online:
//String query = "begin PAC.PAC_WIP_WIPHEADER_PKG.GetWipNumPartList(?,?); end;";
String query = "{ call PAC.PAC_WIP_WIPHEADER_PKG.GETWIPNUMPARTLIST(?,?) } ";
CallableStatement csth = Connection.prepareCall(query);
csth.setString(1, wipNumber);
csth.setInt(2, PacCarousel.getCarouselNumber());
csth.execute();
using either the Begin or the call query (Begin commented in above code snip) is returning the following error from the JDBC driver:
java.sql.SQLException: ORA-00933: SQL command not properly ended
This identical 'begin' query works fine in TOAD or the PL/SQL console for Oracle, but just won't work using this set of JDBC drivers.
Has anyone run into this problem before or perhaps have some suggestions?
Thanks in advance
Maybe you are looking for
-
How to Read the Image in SQL server
I want to read the image from SQL server using labview.In our project languages used are JAVA and Labview Through java we acquiring the image and write in to SQL Server. Through Labview I want to read the image form SQL server and i will do some imag
-
Error in soa 11g enterprise manager console
I am getting this error, enterprise manager was working fine before, Error 404--Not Found From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1: 10.4.5 404 Not Found The server has not found anything matching the Request-URI. No indication is given o
-
i had my phone reset and without paying for my music i have already got is there anyway of getting all my songs back?
-
Hi all I am sorry of there is another thread to this, but this is the firsttime i have used this forum. I was just wondering if anyone has been having any problems with the Nokia N97. I got the black one sim free. I bought it from carphone warehou
-
Capturing from DVD I get "Capture Now has reached end of tape..."
What do I have set wrong in "Log and Capture" to keep getting this @#$$%% message??? The message comes up as soon as I hit the "Capture Now" button Help