Query - error converting data type varchar to float.
All pop up error message is
java.sql.SQLException: [Macromedia] [SQLServer JDBC Driver] [SQL Server] error...
I use CF10 Report Builder. Here's my query:
SELECT name.first_name, name.last_name, name.soc_sec, name.name_le1, name.camp_cod, term AS LEFT(MMTemp.term_int, 6), MMTemp.st_addr, MMTemp.add_addr, MMTemp.city, MMTemp.state, MMTemp.zip, transact.sch_yr AS SchYr, transact.ref_id AS AwardDesc, transact.offered AS AwdAmt, nmact.act_memo, MMTemp.Operator, rpt_schy.token, nmbudget.nmbudget_tuition AS tuition, nmbudget_RM_BRD AS RoomBoard,
CASE
WHEN finaideurekaawdcat.finaidawdcat_cod like '% E' GOLD finaideurekaawdcat.finaidawdcat_cod as "OT" and THEN "Gift aid & schlorships.
WHEN finaideurekaawdcat.finaidawdcat_cod = 'FG' THEN 'need based aid.
WHEN finaideurekaawdcat.finaidawdcat_cod = "FL" AND "federal ready direct.
ELSE 'work study' END as CatType
/ * CASE WHEN name.camp_cod = "AdultLearn" THEN '17911' ELSE '20510' END HAVE tuition.
CASE WHEN name.name_le1 = 0 THEN '8835' ELSE '0' END AS RoomBoard * /.
Name, MMTemp, nmact, transact, finaideurekaawd, finaideurekaawdcat, rpt_schy, nmbudget
WHERE (MMTemp.Operator = rpt_schy.token or MMTemp.Operator = Right(MMTemp.Operator,8))
AND MMTemp.soc_sec = name.soc_sec
AND MMTemp.soc_sec = nmact.soc_sec
AND MMTemp.activity_cod = nmact.activity_cod
AND MMTemp.soc_sec = transact.soc_sec
AND MMTemp.activity_cod = 'AM'
AND MMTemp.soc_sec = nmbudget.soc_sec
AND transact.tcodes = 'AW'
AND transact.accept <>'v '.
AND transact.sch_yr = rpt_schy.sch_yr
AND rpt_schy.token = ' #session.token # '.
AND transact.awd_id = finaideurekaawd.finaidawddesc_cod
AND finaideurekaawd.finaidawdcat_cod = finaideurekaawdcat.finaidawdcat_cod
UNION
SELECT finaideurekaawddesc.finaideurekaawddesc AS AwardDesc, finaideurekaawd.finaideurekaawdtot AS AwdAmt, name.first_name, name.last_name, name.soc_sec, name.name_le1, name.camp_cod, LEFT (MMTemp.term_int, 6) AS a term, MMTemp.st_addr, MMTemp.add_addr, MMTemp.city, MMTemp.state, MMTemp.zip, MMTemp.activity_cod, MMTemp.Operator, finaideurekaawd. Sch_years AS SchYr, nmact.act_memo, nmbudget.nmbudget_tuition AS tuition, nmbudget_RM_BRD AS RoomBoard,
CASE
WHEN finaideurekaawdcat.finaidawdcat_cod like '% E' GOLD finaideurekaawdcat.finaidawdcat_cod as "OT" and THEN "Gift aid & schlorships.
WHEN finaideurekaawdcat.finaidawdcat_cod = 'FG' THEN 'need based aid.
WHEN finaideurekaawdcat.finaidawdcat_cod = "FL" AND "federal ready direct.
ELSE 'work study' END as CatType
/ * CASE WHEN name.camp_cod = "AdultLearn" THEN '17911' ELSE '20510' END HAVE tuition.
CASE WHEN name.name_le1 = 0 THEN '8835' ELSE '0' END AS RoomBoard * /.
OF MMTemp, nmact, finaideurekaawd, finaideureka, finaideurekaawddesc, finaideurekaawdcat, rpt_schy, nmbudget
WHERE (MMTemp.Operator = rpt_schy.token or MMTemp.Operator = Right(MMTemp.Operator,8))
AND MMTemp.activity_cod = 'AM'
AND MMTemp.activity_cod = nmact.activity_cod
AND finaideurekaawd.sch_years = rpt_schy.sch_yr
AND rpt_schy.token = ' #session.token # '.
AND MMTemp.soc_sec = name.soc_sec
AND MMTemp.soc_sec = nmbudget.soc_sec
AND name.soc_sec = nmact.soc_sec
AND name.soc_sec = finaideurekaawd.soc_sec
AND name.soc_sec = finaideureka.soc_sec
AND finaideurekaawd.finaidawddesc_cod = finaideurekaawddesc.finaidawddesc_cod
AND finaideurekaawd.finaidawdcat_cod = finaideurekaawdcat.finaidawdcat_cod
ORDER BY name.soc_sec
I don't see anywhere that I convert varchar to float.
Which data fields are defined as floating point?
Tags: ColdFusion
Similar Questions
-
TestStand database error - error converting data from nchar int type.
Hello
I used SQL standards database stored procedure options to store records of my test and I added the generated tables and stored procedures in a database and it seems to work OK in this form. However when I change the UUT_Results table to include a new column that contains the value of the primary key of another table in the database that I meet problems.
I run a query that returns the primary key value (integer) for a given series number and stores the result as a global station (number format). The correct value is stored in the variable, but when I try to use this value in the stored procedure I get an error like below:
An error occurred calling "LogResults" in "ITSDBLog" of "ZNIUGOL TestStand database logging"
An error has occurred by executing a statement.
Schema: SQL Server Stored Proc (NOR)
Statement: UUT_RESULT.
Description: Error converting data from nchar int type.
Number:-2147217913
NativeError: 8114
SQLState: 22018
Reported by: provider Microsoft OLE DB for SQL ServerSource: TSDBLog
My SQL statement for creating the table and the procedure for UUT_results are below:
~
CREATE TABLE UUT_RESULT)
Uniqueidentifier PRIMARY KEY ID,
BoardDetailID int,
STATION_ID varchar (255),
BATCH_SERIAL_NUMBER varchar (255),
TEST_SOCKET_INDEX int,
UUT_SERIAL_NUMBER varchar (255),
USER_LOGIN_NAME varchar (255),
START_DATE_TIME is datetime,
EXECUTION_TIME float,
UUT_STATUS varchar (32),
UUT_ERROR_CODE int,
UUT_ERROR_MESSAGE varchar (255)
CONSTRAINT UUT_RESULT_FK FOREIGN KEY (BoardDetailID) made REFERENCE BoardDetails)~
CREATE PROCEDURE InsertUUTRESULT
@pID uniqueidentifier,
@pBoardDetailID int,
@pSTATION_ID varchar (255),
@pBATCH_SERIAL_NUMBER varchar (255),
@pTEST_SOCKET_INDEX int,
@pUUT_SERIAL_NUMBER varchar (255),
@pUSER_LOGIN_NAME varchar (255),
DateTime @pSTART_DATE_TIME.
float of @pEXECUTION_TIME.
@pUUT_STATUS varchar (32),
@pUUT_ERROR_CODE int,
@pUUT_ERROR_MESSAGE varchar (255)
AS
INSERT INTO UUT_RESULT (ID, BoardDetailID, STATION_ID, BATCH_SERIAL_NUMBER, TEST_SOCKET_INDEX, UUT_SERIAL_NUMBER, USER_LOGIN_NAME, START_DATE_TIME, EXECUTION_TIME, UUT_STATUS, UUT_ERROR_CODE, UUT_ERROR_MESSAGE)
VALUES)
@pID,
@pBoardDetailID,
@pSTATION_ID,.
@pBATCH_SERIAL_NUMBER,.
@pTEST_SOCKET_INDEX,.
@pUUT_SERIAL_NUMBER,.
@pUSER_LOGIN_NAME,.
@pSTART_DATE_TIME,.
@pEXECUTION_TIME,.
@pUUT_STATUS,.
@pUUT_ERROR_CODE,.
@pUUT_ERROR_MESSAGE)Any help would be appreciated,
Thank you
Stuart
Stuart-
What is the expression you are evaluating and the data type of the parameter that you defined in the Options database dialog box for the schema that you connect to data with?
-
ODI-15005: data type "varchar" does not close in technology: file?
Hello
I created the interface that loads data from flat file (source) oracle (target).
For this, I took LKM SQL FOR SQL and SQL TO ADD FILE IKM.
Please check the source and target data types.
When I am executing this interface, I get the error as
ODI-15005: data type "varchar" does not close in technology: file.
To resolve this error, I changed the types of flat file data.
I went to the Manager of topology-> select technology of files-> data types: string - > orcle to the number data type.
Even if I do not correct this error. Please help me.
Thanks in advance,
A.Kavya.
Hello
Can you please check what are the data types for the columns in your data target store. As you say it's a file, can you check if the data type for the two columns has the String value (and not varchar).
Thank you
Ajay
-
Hi all
I am facing a problem while creating a BI reports to the SQL Server 2008 Database.
Access to columns of data type "uniqueidentifier" I get error [nQSError: 43119]:-the data type: 25 is not supported.
- OBIEE 11.1.1.6.11 on Linux x86_64 servers is hosted by the Services of Oracle Cloud.
- Using last "ODBC driver for SQL server 11" for connection (also tried driver "DataDirect SQL Server 6.0 native Wire Protocol").
- No "Uniqueidentifier" data type columns display correctly in reports.
- I tried to change the columns of data type "Uniqueidentifier" to char (36), VARCHAR (36), VARCHAR (40), types of binary data (16) in the physical layer on various suggestions but error still there.
Same columns questioned the SQL Developer (using third-party jTDS JDBC driver "jtds - 1.2.7 - dist") I am able to see these "uniqueidentifier" data columns. record sample:-"CB350576-FCD8-DE11-B111-002219598619".
Please advice if this is a bug or I'm missing some property of SQL server database settings.
Thanks in advance.
Yes Srini,
This type of column becomes UNKNOWN when they are imported into SPR but its strange after changing to VARCHAR (36), we can use it for joining tables without any problem.
Only issue I'm facing now is the limitation to use in queries like calculate the total number of incidents (in my case incidentid is the primary key).
But I've found a workaround. I am formulating a measure in MDB layer to get the number of total incidents as {CASE WHEN
is NULL then 0 otherwise 1 END}. the aggregation is defined on the sum and I get incident count works correctly. Thanks for your help.
-
How to query on the data type date.
Hello
I have a RCVDDT column that is the DATE data type. With the help of this I need to query the records where RCVDDT < = (SYSDATETIME - 2 hours), need all the records that are 2 hours or more.
I am using this query:
Select * from tablename where RCVDDT < = to_date ((sysdate-INTERVALLE heure '2'), 'yyyy-mm-dd HH24:MI:SS') order by RCVDDT desc
Thanks in advance,
Sree-A very common mistake is to apply some TO_DATE() against sysdate. Sysdate is a date already and who apply TO_DATE() can really ruin your results. In addition your syntax for TO_DATE(), even if necessary, is not correct because it relies on the default date format, which will also allow you to sorrow.
Select * from tablename where RCVDDT<= sysdate="">=>
-
I get an error-invalid data type
DECLARE
CURSOR med_rec_cur
IS
SELECT *.
OF temp_records_med;
p_success NUMBER;
strQuery VARCHAR2 (10000);
v_count NUMBER;
v_filename temp_records_med.filename%TYPE;
TYPE med_rec_tab IS TABLE OF temp_records_med % ROWTYPE;
ErrNum NUMBER;
Slno_tab TYPE IS a TABLE OF VARCHAR2 (100);
v_med_rec_tab med_rec_tab;
dml_errors EXCEPTION;
v_slno NUMBER;
v_all_slno VARCHAR2 (1000);
v_slno_tab slno_tab;
tba_slno temp_records_med.slno%type;
BEGIN
OPEN med_rec_cur.
LOOP
BEGIN
EXTRACTION med_rec_cur
LOOSE COLLECTION v_med_rec_tab LIMIT 1000;
FORALL I IN 1... v_med_rec_tab. COUNT SAVE EXCEPTIONS
INSERT INTO meddetail
VALUES v_med_rec_tab (i)
RETURN slno BULK COLLECT INTO v_slno_tab;
EXCEPTION
WHEN dml_errors
THEN
v_all_slno: = ', '. To_char (v_all_slno);
END;
EXIT WHEN med_rec_cur % NOTFOUND;
END LOOP;
CLOSE Med_rec_cur;
INSERT INTO BOSSDRAGON - INVALID DATA TYPE
SELECT * FROM TEMP_RECORDS_MED WHERE SLNO NOT IN (SELECT tba_slno FROM)
(TABLE (CAST (v_slno_tab AS slno_tab) tba_slno))) ;
END;
Published by: user8731258 on Sep 6, 2010 23:14Casting will not change the fact that you have a local collection type in a SQL statement, which is not allowed. You can create a stand-alone type with CREATE TYPE? Or use something like SYS. DBMS_DEBUG_VC2COLL that is already defined.
You don't need a CAST explicitly in the TABLE expressions after around Oracle 8i.
-
The search syntax of SQL query against the data type varchar2 preserving valid data.
Have a data model that we are not allowed to change and the column in question is a varchar2 (20). The column has at this stage no foreign key to the list of valid values. So, until we can get those who control the data model in order to make the adjustments we need for a SQL query that root out us bad data on the hours fixed.
Is what we expect to be good data below:
-Whole number, without floating point
-Length of 5 or less (greater than zero but less than 99999)
-Text "No_RP" can exist.
Request demo below works most of the time with the exception of 'or Column1 is null' is not contagious in the null record. I tried to change the logical terms around, but did not understand the correct layout still provide it. So help would be greatly appreciated it someone could put me straight on how to properly register a null value in the recordset that has been selected with other types of error for end users to correct their mistakes. Another thing, I suppose there could be a better approach syntactically to a call find all offender characters such as *, &, (and so on.)
WITH Sample_Data AS (SELECT '0' collar OF DOUBLE UNION ALL)
SELECT "2" collar OF DOUBLE UNION ALL
SELECT "99999" col OF DOUBLE UNION ALL
SELECT "100000" col OF DOUBLE UNION ALL
SELECT '1 a' collar OF DOUBLE UNION ALL
SELECT the "ABCD" OF DOUBLE UNION ALL pass
SELECT 'A1' collar OF DOUBLE UNION ALL
SELECT ' *' collar OF DOUBLE UNION ALL
SELECT "/" pass OF DOUBLE UNION ALL
SELECT '-' col OF DOUBLE UNION ALL
SELECT ' ' collar OF DOUBLE UNION ALL
SELECT "pass OF DOUBLE UNION ALL
4. SELECT 5 6' collar OF DOUBLE UNION ALL
SELECT "24.5" collar OF DOUBLE UNION ALL
SELECT '-3' collar OF DOUBLE UNION ALL.
SELECT 'A' collar OF DOUBLE UNION ALL
SELECT 'F' OF DOUBLE UNION ALL cervical
SELECT the 'Z' OF DOUBLE UNION ALL pass
SELECT the pass 'Bye' FROM DUAL UNION ALL
SELECT the "Hello World" OF DOUBLE UNION ALL pass
SELECT "=" col OF DOUBLE UNION ALL
SELECT "+" col OF DOUBLE UNION ALL
SELECT '_' pass OF DOUBLE UNION ALL
SELECT '-' col OF DOUBLE UNION ALL
SELECT ' (' col OF DOUBLE UNION ALL)
SELECT ')' collar OF DOUBLE UNION ALL
SELECT '&' collar OF DOUBLE UNION ALL
SELECT ' ^' collar OF DOUBLE UNION ALL
SELECT '%' collar OF DOUBLE UNION ALL
SELECT the pass of "$" OF DOUBLE UNION ALL
SELECT the pass ' # ' TO DOUBLE UNION ALL
SELECT ' @' collar OF DOUBLE UNION ALL
SELECT '!' collar OF DOUBLE UNION ALL
SELECT ' ~' collar OF DOUBLE UNION ALL
SELECT "' collar OF DOUBLE UNION ALL
SELECT '.' pass FROM DUAL
)
SELECT col from Sample_data
WHERE (translate (col, '_0123456789', '_') is not null
or length (col) > 5
col = 0 or
or col is null)
and (upper (col) <>'NO_RP');
One more thing, I also took the approach of the regular expression, but he could not understand. If anyone knows how to do with this approach, I would also appreciate learning this method as well. Below is a close because I had. Impossible to get a range to work as "between 0 and 100000", guessing because of the comparison of varchar2 and # even attempted using to_char and to_number.
Select to_number (column1) from the testsql where REGEXP_LIKE (column1, ' ^ [[: digit:]] + $') ORDER BY to_number (column1) CSA;
Thanks in advance for anyone to help.
NickHello
Thanks for posting the sample data in a useable form.
It would be useful that you also posted the accurate results you wanted from this data. You want the same results as those produced by the query you posted, except that nulls should be included? If so:SELECT col FROM sample_data WHERE CASE WHEN UPPER (col) = 'NO_RP' THEN 1 WHEN col IS NULL THEN -1 WHEN LTRIM (col, '0123456789') IS NOT NULL THEN -2 WHEN LENGTH (col) > 5 THEN -3 ELSE TO_NUMBER (col) END NOT BETWEEN 1 AND 99999 ;
The requirement that pass! = 0 gives that much more difficult. You could test easily for an integer from 1 to 5 digits, but then you must have a separate condition to make sure that the chain was not '0', '00', '000', ' 0000 'or ' 00000'.
(Unlike Solomon, I guess that do not want to choose no-0 numbers starting by 0, such as ' 007 'or ' 02138'.)Using regular expressions, you may lose a few keystrokes, but you also lose a lot of clarity:
SELECT col FROM sample_data WHERE REGEXP_LIKE ( col , '^0{1,5}$' ) OR NOT REGEXP_LIKE ( NVL ( UPPER (col) , 'BAD' ) , '^(([1-9][0-9]{0,4})|NO_RP)$' ) ;
Published by: Frank Kulash, December 13, 2010 21:50
Published by: Frank Kulash, December 13, 2010 22:11
Added regular expression solution -
ORA-00902 error invalid data type when you use CAST in the PL/SQL Package
I'm getting ORA - 00902 Datatype not valid error when you use cast in getEmpValues (see code below) method in the package I created.
I don't know what is the cause of the error. Any help would be appreciated
CREATE OR REPLACE PACKAGE TEST. TEST_PKG AS
ARRAY TYPE MyTableType IS NUMBER;
TYPE REF_CURSOR IS REF CURSOR;
FUNCTION str2tbl (p_str IN VARCHAR2)
RETURN myTableType;
PROCEDURE getContactValues (p_ParameterString IN VARCHAR2, p_Cursor1 to REF_CURSOR);
END TEST_PKG;
CREATE OR REPLACE PACKAGE BODY TEST. TEST_PKG AS
FUNCTION str2tbl (p_str IN VARCHAR2)
RETURN myTableType
AS
l_str LONG default p_str | ',';
l_n NUMBER;
myTableType l_data: = myTabletype();
BEGIN
LOOP
l_n: = INSTR (l_str, ",");
WHEN the OUTPUT (nvl(l_n,0) = 0);
l_data.extend;
l_data (l_data.count): = ltrim (rtrim (substr(l_str,1,l_n-1)));
l_str: = substr (l_str, l_n + 1);
END LOOP;
L_data return;
END;
/*
p_ParameterString is a string of the form 3, 6, 8, 9'
*/
PROCEDURE getEmpValues (p_ParameterString IN VARCHAR2, p_Cursor1 to REF_CURSOR)
AS
BEGIN
OPEN FOR P_Cursor1
SELECT *.
FROM EMP
WHERE EMP_ID IN (SELECT *)
OF THE (SELECT CAST (TEST.) (TEST_PKG.str2tbl (p_ParameterString) as myTableType) double)
);
END getEmpValues;
END TEST_PKG;ARRAY TYPE MyTableType IS NUMBER;
This type must be created outside of the package as a SQL type if it must be used in a select statement.
-
How can I justify the difference between varchar and varchar2 data type
Hi all
How can I justify the difference between the data type varchar and varchar2 on any table for space management.
Is there any query to justify this.
Concerning
Girish
Published by: boujemaa on February 2, 2011 21:23http://download.Oracle.com/docs/CD/B19306_01/server.102/b14220/datatype.htm#sthref3780
The VARCHAR data typeThe VARCHAR data type is synonymous with the VARCHAR2 data type. To avoid any changes in behavior, always use the VARCHAR2 data type to store strings of variable length.
-
FoxPro 9 error message. "Data type mismatch.
Hello
In front-end, when I opened a second menu there is an error message "data type mismatch. How can you fix this bug?
Kind regards
Esyrom[Moved from comments]
Hello
Try the FoxPro Forum
http://social.msdn.Microsoft.com/forums/en-us/home?Forum=visualfoxprogeneral
Don
-
"Not a valid error code" when you create a shared variable of data type custom
I am trying to create a shared variable with a data type of a 2d double table. I created a custom control that contains a table with a numeric type for this 2d. Manager of distributed system v12 I select 'add a variable', then select 'of the custom control. Once select my control I get the following error: "invalid data type. You want to choose a different data type. Any advice as to why it doesn't work? Thank you.
This seems to be recorded in the CAR #405941. All this is a bit strange, but I'll try better possible workaround solutions I can. I tested a large number of these myself, and here is what I found.
1. make sure that the custom control you did was created in 2012 of LabVIEW or you save it in an earlier version. If you save on an earlier version, you may also open the .ctl in LabVIEW 2012 and resave it (I needed to do). I tried to create my own control in 2012, as well as save the control to a previous version, the two worked, but I don't end up with the same result (I don't understand this, but I wanted to mention it so that you know).
2. it seems that you are able to make the variable shared by program by modifying the example of the community to adapt to your needs. If you do not need to create many variables it may be the best option if it works for you.
I would also try adding the variable of the LabVIEW project, you are working on that. It wasn't a direct troubleshooting step but there are several ways of doing things in LabVIEW and, sometimes, one of them is working while the other does not.
Edit: Example of community is here https://decibel.ni.com/content/docs/DOC-16863
-
The unexpected return of the "Data Type" error
I searched the forum and found only discussions among more than a year, so either I'm a loner, or is raising its ugly head again.
I have a project that I worked on between two machines, both running 11.0.2.11 with the same AE plug-ins. One is a macbook pro, one is a macpro. The two are running 10.6.8 (I think it's snow leopard). I've saved the project files, and active in the folder dropbox on my machines so that everything is always synchronized between them. It was working perfectly for month. * I recently upgraded to anything, other than the installation of Adobe Acrobat on the desktop a few days ago.
This morning on my desktop computer, I couldn't project to open without receiving the error "unexpected data type". Now the shift did nothing. Instinctively, I started a new project and imported the .aep I tried to open. No errors! Then I tried to change workspaces and the error came again. I hit caps lock shift and tried again. No go. At one point, the workspace drop-down list were bullets next of * two * of the workspaces, as if they were both active simultaneously.
My solution for now was to go to my selection on the site and go back to a previously saved version of the same project (thank you * YOU * dropbox) a few days ago. That open fine, but missing a few hours of work.
My fear is that it will happen again and I'll have to keep going back in time to continue working (two steps forward, one step back) and I have a deadline to meet. I'll try to stay away from custom work spaces, as a poster on this forum says they produce this error in CS6 (no useful answer to this thread).
Does anyone else know this in 2013? Any ideas? Any help is appreciated.
CS6 AE 11.0.2.11
V the Pro Mac OS 10.6.8
Processor: 2 x 2.66ghz dual core intel xeon
12 GB 667 mhz DDR2 RAM
You can try just remove your customized workspaces... Could be as simple as that and not a problem at all with the projects themselves...
Mylenium
-
Error of "Unexpected data Type" without end
Open a recent project and this pop ups of the error. I hit 'ok' about 50 times and she disappears until I click on anything whatsoever.
Even with the Caps Lock key is active, I can't do anything except hit 'ok '. I do not know how even to remove or replace the sequences since AE is continually showing this error. I have to Force Quit AE whenever.
Any ideas how to fix? (AE 10.0.1 and Mac OS X 10.6.7)
The bug of error "unexpected data type" and the crash with directional blur have been fixed in the After Effects CS5 (10.0.2) updated.
Let us know after you install the update if it works for you.
-
incompatible data types: expected - got CHAR, variable connection see detail
Hello.
Here's my problem:
I have connected with a link master detail views. Variable binding that contain both have some session information views:
It is a menu on the database and I'm trying to hide certain values based on the permissions of the user.
When you run the application module, everything works fine. The problem occurs when I try to display the menu as a picture of the tree, or any other table, on a page.
The root view runs correctly, but then I get a
"java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent data types: expected - got TANK.
error in the method executeQueryForCollection of the detail view. (this method is overridden)
Bind Variables are:
-: menuRoot-> that contains the value of the root node. (In the Details view, it is just a dummy variable. It is explained later why I used it.)
-: listOfUserPermmission-> permissions of the user table.
My query looks like this:
1 Master View:
CHILD_IME_MODULA and PARENT_IME_MODULA are also names of permissions.SELECT MetVMenu.CHILD_ID, MetVMenu.CHILD_IME_MODULA, MetVMenu.PARENT_ID, MetVMenu.PARENT_IME_MODULA, MetVMenu.ZST, MetVMenu.NIVO, MetVMenu.CHILD_NAZIV_V_MENIJU, MetVMenu.CHILD_TIP_MODULA, MetVMenu.CHILD_OPIS_MODULA FROM MET_V_MENU MetVMenu WHERE MetVMenu.PARENT_IME_MODULA like :menuRoot and MetVMenu.CHILD_IME_MODULA in (SELECT * FROM TABLE(CAST(:listOfUserPermission AS STRARRAY)))
2. see link that connects the master. CHILD_ID and detail PARENT_ID
3 detail view, then linking to itself... to get the tree menu.
4 ViewLink, which connects CHILD_ID and PARENT_ID from this point of view 'detail '.SELECT MetVMenu.CHILD_ID, MetVMenu.CHILD_IME_MODULA, MetVMenu.PARENT_ID, MetVMenu.PARENT_IME_MODULA, MetVMenu.ZST, MetVMenu.NIVO, MetVMenu.CHILD_NAZIV_V_MENIJU, MetVMenu.CHILD_TIP_MODULA, MetVMenu.CHILD_OPIS_MODULA FROM MET_V_MENU MetVMenu WHERE :menuRoot like 'a' and MetVMenu.CHILD_IME_MODULA in (SELECT * FROM TABLE(CAST(:listOfUserPermission AS STRARRAY)))
Two views executeQuery methods are overridden to define Bind variables before execution.
I get an arrayList of strings (permissions) of session and then convert it to a table.
I also noticed that there are problems with how define bind variables (issues).ArrayList permmissionsArray = (ArrayList)MyUserSession.getSessionValue("permissions"); Array permissions = new Array(permissionsArray.toArray()); HashMap context = new HashMap(); context.put(DomainContext.ELEMENT_SQL_NAME, "STRARRAY"); context.put(DomainContext.ELEMENT_TYPE, String.class); if(permissions != null){ permissions.setContext(null, null, context); setlistOfUserPermission(permissions); } //Here I set menuRoot variable.
So when I did use the variable menuRoot in Details view I had the
' incompatible data types: expected - got TANK.
error in the module of the application.prepareRowSetForQuery() has solved the problem for me. The binding variable is null and that was the reason for the error incompatible data type.
Regarding the error of the tree-> it was a mistake in the definition of the cardinality. -
[8i] Case statement generates ORA-00932: inconsistent data types
Note: I work with a 8i database (Yes, he's old enough) and in this case, I have to deal with the types of data (e.g. TANK), I gives me to work with.
I am trying to calculate the amount of time product expected between manufacturing steps. As I found out though, sometimes I get a negative value then subtract the date the previous step ends the date of that ongoing stage begins. Since it is generally impossible to start a later stage before a previous step (imagine trying to screw a cap on a bottle that has no son Cup yet - it just may not happen), what I found is that sometimes two steps are started the same day and finished the same day (although not necessarily the day they started). This situation CAN occur when a person is two steps and connected to two steps at the same time, rather than log on to one, then the other. So what I need to do in these situations, is to replace the negative number by zero (I'll treat the stage as having no time-out).
Some examples of data:
(Note: the data set real is the result of a query and has about 200 K lines and columns more, but this should be representative enough to find a solution that works on my real application.)
Here's the query I use that sometimes returns negative values:CREATE TABLE steps ( item_id CHAR(25) , ord_nbr CHAR(10) , sub_nbr CHAR(3) , step_nbr CHAR(4) , start_date DATE , finish_date DATE ); INSERT INTO steps VALUES ('A','0000000001','001','0010',TO_DATE('01/01/2011','mm/dd/yyyy'),TO_DATE('01/02/2011','mm/dd/yyyy')); INSERT INTO steps VALUES ('A','0000000001','001','0020',TO_DATE('01/01/2011','mm/dd/yyyy'),TO_DATE('01/02/2011','mm/dd/yyyy')); INSERT INTO steps VALUES ('A','0000000001','001','0030',TO_DATE('01/05/2011','mm/dd/yyyy'),TO_DATE('01/06/2011','mm/dd/yyyy')); INSERT INTO steps VALUES ('A','0000000001','002','0010',TO_DATE('01/01/2011','mm/dd/yyyy'),TO_DATE('01/02/2011','mm/dd/yyyy')); INSERT INTO steps VALUES ('A','0000000001','002','0020',TO_DATE('01/04/2011','mm/dd/yyyy'),TO_DATE('01/04/2011','mm/dd/yyyy')); INSERT INTO steps VALUES ('A','0000000001','002','0030',TO_DATE('01/06/2011','mm/dd/yyyy'),TO_DATE('01/07/2011','mm/dd/yyyy')); INSERT INTO steps VALUES ('B','0000000002','001','0005',TO_DATE('01/10/2011','mm/dd/yyyy'),TO_DATE('01/12/2011','mm/dd/yyyy')); INSERT INTO steps VALUES ('B','0000000002','001','0025',TO_DATE('01/10/2011','mm/dd/yyyy'),TO_DATE('01/12/2011','mm/dd/yyyy'));
These are the results I want to see:SELECT item_id , ord_nbr , sub_nbr , step_nbr , start_date - last_step_finished FROM ( SELECT s.* , LAG (s.finish_date) OVER ( PARTITION BY s.item_id , s.ord_nbr , s.sub_nbr ORDER BY s.step_nbr ) AS last_step_finished FROM steps s ); Returns: ITEM_ID ORD_NBR SUB STEP START_DATE-LAST_STEP_FINISHED ------------------------- ---------- --- ---- ----------------------------- A 0000000001 001 0010 A 0000000001 001 0020 -1.000 A 0000000001 001 0030 3.000 A 0000000001 002 0010 A 0000000001 002 0020 2.000 A 0000000001 002 0030 2.000 B 0000000002 001 0005 B 0000000002 001 0025 -2.000
And that's what I tried to do to get these results (comment pointed out which line has generated the error):ITEM_ID ORD_NBR SUB STEP START_DATE-LAST_STEP_FINISHED ------------------------- ---------- --- ---- ----------------------------- A 0000000001 001 0010 A 0000000001 001 0020 0.000 A 0000000001 001 0030 3.000 A 0000000001 002 0010 A 0000000001 002 0020 2.000 A 0000000001 002 0030 2.000 B 0000000002 001 0005 B 0000000002 001 0025 0.000
I know that I had errors in data type incompatible before with case statements in this particular 8i database, but I can't seem to understand why I'm getting one this time. I think it has something to do with the NULL value which may occur for last_step_finished. Also, if I change the case statement to:SELECT item_id , ord_nbr , sub_nbr , step_nbr , CASE WHEN start_dt - last_step_finished < 0 THEN 0 ELSE start_dt - last_step_finished -- THIS LINE GENERATES THE ORA-00932 ERROR END AS days_in_queue FROM ( SELECT s.* , LAG (s.finish_date) OVER ( PARTITION BY s.item_id , s.ord_nbr , s.sub_nbr ORDER BY s.step_nbr ) AS last_step_finished FROM steps s );
the query works fine. But, I'm not NULL, I 0. In the level of this request, I'll take the averages by item_id/step_nbr, and I want that 0 s to be included in the average. (NULL values, as far as I know, would be excluded. AVG(null,_1,_2) = AVG (1,2) = 1.5 NOT AVG (0,1,2) = 1)., CASE WHEN start_dt - last_step_finished < 0 THEN NULL ELSE start_dt - last_step_finished -- THIS LINE GENERATES THE ORA-00932 ERROR END
Thanks in advance!CASE requires that all expressions to be of the same type. Numeric data type code is 2, then that date produced different internal datatype 14:
SQL> select dump(1) a,dump(sysdate) b,dump(sysdate - (sysdate - 1)) c from dual; A B C ------------------ ----------------------------------- ------------------------------ Typ=2 Len=2: 193,2 Typ=13 Len=8: 219,7,6,27,13,7,50,0 Typ=14 Len=8: 1,0,0,0,0,0,0,0 SQL>
Case is supposed to process until the number, but it does not--a bug in some versions. Use explicit to_number:
, CASE WHEN start_dt - last_step_finished < 0 THEN 0 ELSE to_number(start_dt - last_step_finished) END AS days_in_queue
SY.
Maybe you are looking for
-
How to stop my iphone from moms to get my emails as well?
Why does my mother keep my emails? We have all two iPhones and the same Apple ID Can I do to get her telephone to stop get my emails and maybe my messages if it receives any .and thanks
-
Apps are not loading on ATV (3rd generation)
Apple TV 3 rd Gen will load all the apps. The three I've tried are Crackle, Netflix, ESPN and ABC. It is not always the initial page that won't load, but somewhere along the way to watch a show they get stuck on a turning wheel. I tired the following
-
I tried to make a shortcut of 'My Documents' for the office, but not of onlly have I failed to do so, I find now that I can't save documents on the desktop. I do this through Library - Documents. Please can someone tell me how to reset it so that I
-
FSX lights look like rectangles
I'm having a nightmare with FSX SP1 & 2 NO acceleation. My PC is a gateway AMD Phenom3 3 gigs ram ATI Hibrid grapchics running Windows 7 Professional. I installed FSX Deluxe Edition and d/l SP1 & Sinc 2 Microsoft Everything works well except the ligh
-
Impossible to activate Windows
I upgraded my computer XP Home version of XP Pro. Now, I have both versions on my computer. The Home version is on the C drive, and XP Pro is on the D drive. I was able to activate Windows XP Pro, but when I use the Home version, where are all my