assign the value to a selection of the result of a query control
I want to assign a value to my controls with the result of the query.
It works for CFINPUT TEXT, but it does not work to SELECT
I want to know are there any way tp affect my drop-down list value based on the result of questy.
I have CFSTOREPROC as follows:
< cfstoredproc procedure = "PSP" >
< cfprocparam value = '#form. "IDNumber #" CFSQLTYPE = "cf_sql_integer" >
< name cfprocresult = resultset "spResult" = "1" >
< / cfstoredproc >
< type CFINPUT = 'text' id = "txtIDNumber" value = "" #spResult.IDNumber # "/ >"
I am able to name a TEXT of ENTRY CF as above the code value,
< select id = "lstNumber" value = "#spResult.lstNumber #" > < / select >
but it does not affect the value of my result of the query to SELECT entry.
Is it possible to assign a value to the query result SELECTION control?
I tried to use JavaScript that works if I pass a number, but it does not work if I pass a query result,
Your help is very appreciated,
Kind regards
Iccsi,
@Iccsi,
My bad! Yes, you will either need to the CFOUTPUT tag (that you commented out in your code) but without specifying a query or change the CFLOOP query CFOUTPUT = "Notes". If one of these should work:
OR
-Carl V.
Tags: ColdFusion
Similar Questions
-
Insert the result of a query select in another table
Hello
I have a strange problem when I try to insert all the results of a query select in another table, using the declaration of the order.
With the declaration of COMMAND it works fine
Work:
------------------------------
INSERT INTO ADART01 (SELECT (codart)
"STOCK". "" CODART_STO ".
Of
"DB". ' ' 'ACTIONS');
------------------------------
But if I try to sort the result using the declaration of the ORDER, I have the following error:
Error: ORA-00907 missing right parenthesis
------------------------------
INSERT INTO ADART01 (SELECT (codart)
"STOCK". "" CODART_STO ".
Of
"DB". "" "ACTIONS"
ORDER BY
"STOCK". ("' CODART_STO ASC ');
------------------------------
Any idea?
Thank you for your help,
Angel.delete "()" to select
create table test1 (a number, b varchar2(100)); insert into test1 (a, b) select level, 'level ' || level from dual connect by level < 101; insert into test1 (a, b) select level, 'level ' || level from dual connect by level < 101 order by to_char(sysdate - level, 'D'); select * from test1; drop table test1;
-
Need to print the results of a query in a CASE statement
I want to print the results of a query in a CASE statement:
SELECT RUN_STATUS
Of
(select check BOX WHEN COUNT (ROW_WID) = 0 THEN 'NO JOBS RAN AFTER' |) (select sysdate - XXAFL_MINUTES MINUTE)
END RUN_STATUS
of W_ETL_RUN_SDTL
where START_TS >
(sélectionnez sysdate-MINUTES de XXAFL_MINUTES)) where RUN_STATUS is not null; e
The query above subtracted 5 minutes from SYSDATE and he shoots XXAFL_MINUTES. I am doing this because we could change the number of minutes in the future. I want to print the number of minutes in the case statement.
If I execute this statement, it throws an error stating:
ORA-00937: not a single group group function
00937 00000 - 'not a single-group function.
* Cause:
* Action:
Error on line: 1 column: 96
How can I include "select sysdate - MINUTES of XXAFL_MINUTES" in the CASE that it calculates the number of minutes and it prints with the results.
Thanks in advance!
Hey guys,.
I found the solution:
SELECT
RUN_STATUS | TO_CHAR ((sélectionnez sysdate-MINUTES de XXAFL_MINUTES), 'HH24:MI:SS')
Of
(select check BOX WHEN COUNT (ROW_WID) = 0
THEN "NO JOB RAN.
END RUN_STATUS
of W_ETL_RUN_SDTL
where
START_TS > (select sysdate - XXAFL_MINUTES MINUTE))
where
RUN_STATUS is not null;
The output:
NO JOBS RAN AFTER 09:07:54
Thanks to you all!
-
defining the results of a query to a variable
Hi all
I'm having a problem affecting the results of a query to a variable. What I'm trying to do, is to do an AJAX call to a .cfc file and pass back the results of the function. The main problem is, I'm again moving a block of HTML (resulting from a cfquery in a cfoutput) stored in a variable. My code is something like...
< name cffunction = "getText" access = "remote" returntype = 'Cancel' >
< datasource = "" #request.dsn # cfquery "name ="queryTable">"
SELECT kort, infoBOf infoTable
< / cfquery >
< cfset result = ' <!-this is the part I'm stuck, I want the table go here. -> ">"< table >
< cfoutput query = "tablequery" >
< b >
< td > #infoA # < table > < td > #infoB # < table >
< /tr >
< / cfoutput >
< /table >
< cfwddx action = "cfml2js" input = "" # result # ' toplevelvariable 'o' = > "< / cffunction >
It is a simplified version of what I want to do, but you get the idea...
Is it still the right way to go about this? Thank you
That's what I get for trying the E-mail response feature! Are you not happy, that I double checked my post.
You could do a lot of string concatenation here to do stuff like
"& Kort &" "& infoB &" "> time and time again." But in reality the tagsis so much easier to use.
#infoA #. #infoB #.
-
I need to return the result of a query on a stored procedure
I need to return the result of a query to a stored procedure, I mean when I run a stored procedure it returns a result set in a select statement.
Best regards...Hello.
Do you really want a stored procedure for this?
Why not just a script that contains the query?Assuming that you don't really want a stored procedure, you'll have to decide what to do with the results.
An option is a slider.For example, you can write a procedure of this type to hold the query:
CREATE OR REPLACE PROCEDURE USP_TEST ( out_cursor OUT SYS_REFCURSOR ) IS BEGIN OPEN out_cursor FOR SELECT * FROM scott.emp; END USP_TEST; / SHOW ERRORS
You can move the cursor to another procedure for handling.
You could test this in SQL * more by creating a variable blond:
VARIABLE usp_test_cursor REFCURSOR; EXEC usp_test (:usp_test_cursor); PRINT :usp_test_cursor
-
Export the results of a query to a CSV file
Hello
My requirement is that I need to export the results of a query to a CSV file. Can someone please suggest a way to also include the names of columns in the CSV file?
Thanks in advance.
AnnieFollowing code comes from asktom. I changed to include the column header. This will get your CSV file desired for a given query.
create or replace function dump_csv( p_query in varchar2, p_separator in varchar2 default ',', p_dir in varchar2 , p_filename in varchar2 ) return number AUTHID CURRENT_USER is l_output utl_file.file_type; l_theCursor integer default dbms_sql.open_cursor; l_columnValue varchar2(2000); l_status integer; l_colCnt number default 0; l_separator varchar2(10) default ''; l_cnt number default 0; l_colDesc dbms_sql.DESC_TAB; begin l_output := utl_file.fopen( p_dir, p_filename, 'w' ); dbms_sql.parse( l_theCursor, p_query, dbms_sql.native ); for i in 1 .. 255 loop begin dbms_sql.define_column( l_theCursor, i, l_columnValue, 2000 ); l_colCnt := i; exception when others then if ( sqlcode = -1007 ) then exit; else raise; end if; end; end loop; dbms_sql.define_column( l_theCursor, 1, l_columnValue, 2000 ); l_status := dbms_sql.execute(l_theCursor); dbms_sql.describe_columns(l_theCursor,l_colCnt, l_colDesc); l_separator := ''; for lColCnt in 1..l_colCnt loop utl_file.put( l_output, l_separator || '"' || Upper(l_colDesc(lColCnt).col_name) || '"'); l_separator := p_separator; end loop; utl_file.new_line( l_output ); loop exit when ( dbms_sql.fetch_rows(l_theCursor) <= 0 ); l_separator := ''; for i in 1 .. l_colCnt loop dbms_sql.column_value( l_theCursor, i, l_columnValue ); utl_file.put( l_output, l_separator || '"' || l_columnValue || '"'); l_separator := p_separator; end loop; utl_file.new_line( l_output ); l_cnt := l_cnt+1; end loop; dbms_sql.close_cursor(l_theCursor); utl_file.fclose( l_output ); return l_cnt; end dump_csv;
The original link is below.
http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:95212348059
Thank you
Knani. -
The Variable value based on the results of SQL query
With the help of OBIEE 11.1
Is it possible to set the value of a variable presentation of the results of a SQL statement?
Scenario:
I have 2 topics.
SubjectArea1
Text1
Date1
SubjectArea2
Field1
Field2
UpdateDate
I have an analysis that uses only the SubjectArea2.
Using a dashboard quickly, the user must be able to select Text1 in the other topic area (SubjectArea1).
Assuming that selection will be stored in a variable of presentation (SelectedText),
The filter in the analysis should be something like
Upper UpdateDate to @{SelectedDate}
How can I set a variable (SelectedDate) using a SQL statement?
Something like this:
SELECT "Date1" TO "SubjectArea1" WHERE "Text1" = @{SelectedText}
So the command prompt text selection should give a date that is used to filter the second review?
If so:
The prompt on SA1.textCol
hidden analysis who is invited on SA1.texCol has SA1.dateCol in the criteria
Analysis SA2.dateCol is filetered on basis of the results of another analysis (any value analysis hidden SA1.dateCol)
-
How to store the result of a query in a variable in the data model
In a model of date I want to do something like this
< name of dataTemplate = than one dataSourceRef "HURDetail" = "BRM_DATA_SOURCE" >
< Parameters >
< parameter name = "PARAM_THRESHOLD_VALUE" dataType = "number", defaultValue = "0" / >
< / Parameter >
< SQLStatement instance name = "Q1" >
<! [CDATA]
SELECT count (*) FROM TABLE_NAME
[]] >
< / sqlStatement >
-I want to assign the output of the above query to PARAM_THRESHOLD_VALUE so I can use it in future requests...
-My query is complex, for reason of performance I want to store the output of the query.
Please suggest how do...
Made a package with the PARAM_THRESHOLD_VALUE parameter and the function value entry assigns the done variable to work?
Thank you
ShivaHey Shiva,
If you want to use the value of the counter in the other queries in the data model, you can have an alias for the extraction of County and use it as a bind variable in other queries as
SELECT count (*) PARAM_THRESHOLD_VALUE
FROM TABLE_NAME
]]>
and can use it in another query as
SELECT XYZ
FROM TABLE_NAME2
WHERE XXX = *: PARAM_THRESHOLD_VALUE *.
]]>
Hope this is what you want.
Thank you. -
View the results of a slider control
HI, I'm suggling on this pl/sql, because I just started learning a few weeks ago. Basically what this pl/sql is check
in my article "the time" to see if any time is not in the current time format and if it finds one it should display only and then someone can go and check.
Firstly this my_table has 3 different columns which makes it the primary key, so I need display the columns so that the administrator can find the
incorrect data easily in the time column.
These 3 columns that actually the primary key are 'sid', "setid" and "sentry".
I have created a slider and possesses the top loop to check all the my_table data but I do not know how to dmbs_output
all results at once. In the results, I need to display all the columns in key primary and thus 3 under and this column that the data is.
IF SQLCODE =-01858
THEN
Dbms_output.put_line (-);
Can someone help me please. Here are my codes
DECLARE
v_result varchar2 (4000);
v_key1 varchar2 (10 byte);
whole v_key2;
whole v_key3;
cursor c_get_times
is
SELECT sid, setid, Sentinel, time FROM my_table;
c_get_times_row c_get_times % ROWTYPE;
BEGIN
TIMES a c_get_times LOOP
v_key1: = times.sid;
v_key2: = times.setid;
v_key3: = times.sentry;
SELECT TO_DATE (times.time, "HH24") IN v_result FROM my_table;
END LOOP;
OPEN c_get_times.
LOOP
EXTRACT the c_get_times in c_get_times_row;
EXIT WHEN c_get_times % NOTFOUND;
END LOOP;
EXCEPTION
WHILE OTHERS
THEN
IF SQLCODE =-01858
THEN
Dbms_output.put_line ();
ELSIF SQLCODE =-01851
THEN
Dbms_output.put_line ('invalid value for minutes");
ON THE OTHER
Dbms_output.put_line (' failed with another unknown error: ' |) SQLERRM);
END IF;
END;
If you can create the object in your schema, create the function below and the race below query it will give a correct result. I think that's the test objective you ask, otherwise do not use DBMS_OUTPUT. Just create the function and run the select statement.
FUNCTION to CREATE or REPLACE date_chk (p_value VARCHAR2, VARCHAR2 p_format)
RETURN NUMBER
AS
v_val1 NUMBER (10);
T_DATE DATE;
BEGIN
T_DATE: = TO_DATE (p_value, p_format);
RETURN 1;
EXCEPTION
WHILE OTHERS THEN
IF SQLCODE =-01858 THEN
RETURN 0;
END IF;
END;
SELECT the sid,
SetID,
Sentinel,
timeval
OF test_time
WHERE date_chk(timeval,'HH24:MI') = 0;
-
Is it possible to put the results of a query in a variable to use in the bean class?
Hello, I am using JDeveloper 12.1.2.0.0
I like to keep the result of my queries (the method that I created in the AppModule) in a richeTableau or another type of variable, so I can get results and I don't have to make unnecessary after queries. I don't think that the query is the problem but keeping the results.
I tried to do in using this:
public String testVFactSales (String conditions) {}
PreparedStatement query = getDBTransaction () .createPreparedStatement ("" + "select * from v_fact_sales"+ conditions, 0 ");
ResultSet rs;
Outcome of the result set;
Result of the richeTableau;
String result = null;
try {}
query.setString (1, conditions);
Query.Execute ();
Query.Execute ();
result = query.getGeneratedKeys ();
Query.Close ();
System.out.println ("result:" + result.toString ());
return result.toString ();
} catch (SQLException e) {}
e.printStackTrace ();
}
Return ' ';
}
As you can see, I have already tried a few solutions, but so far I have only errors (cannot convert or null exception, when I try to put the result in a richeTableau in my bean class)
Any ideas?
It is very important for me, because it would improve the performance of my project a lot.
Kind regards
Frederico.
Although the issue is not 100% responded, I used the idea that Shay told me, where you can create a method in your AppModule to set your where clause!
Good luck to everyone who has the same problem.
As an attack similar to what I wanted in the first place, you can check this:
https://community.Oracle.com/thread/2619669
Kind regards
Frederico.
-
The results of F1-QUERY-how to restrict or to SQL with the role of access to the data?
Hello
With the help of CC & B 2.3.1.
I'm configuration of a Zone of F1-OF-QUERY to get and display customer information as level account; the filter criteria will be Geo val SP.
With our application, we use access to accounts and groups access to the data on users roles to restrict access to sensitive accounts, such as VIP.
What keywords should I use in the SQL statement to limit the results only for group accounts to which access is included in the Dar of the user?
Example: If the user has DAR 'STANDARD', it won't see accounts with group access 'VIP '.
I tried unsucessfully: USER: USER ID,: USER_ID.
Unsucessfull example:
Select dar_cd, user_id, expire_dt
of ci_dar_usr
Where user_id =: USER_ID
and expire_dt > =: F1
Thks,
FabienHi, Fabien,
If you are looking to determine the current user in the box,
the keyword to use is: USERIDYou can check the zone of F1 "F1-FAVSCR" for its use.
-
Compare the result of a query with a number and return a message
Hello
I have the following query in oracle 9i:
SELECT COUNT (*)
OF hourly_files
WHERE date_received = TO_DATE ((SELECT TO_CHAR (SYSDATE - INTERVAL '1' DAY, 'DDMMYYYY')
(THE DOUBLE), 'DDMMYYYY');
This will produce a number of lines required
I need to compare the number of output with another number hardcoded (threshold) and print an appropriate example message
If the result of the query above is 18000 and the number of threshold is fixed at 20000, then output a meesage:
Number of files received less than 2000
Any help will be very appreciated!
Thank you.SQL> ed Wrote file afiedt.buf 1 SELECT CASE WHEN COUNT(*) >5 THEN 'Number is > than 5' 2 WHEN COUNT(*) <1 THEN 'Its less than 1' 3 ELSE 'Its in between' 4 END 5 FROM emp 6* WHERE deptno=20 SQL> / CASEWHENCOUNT(*)>5 ------------------ Its in between SQL> SELECT COUNT(*) FROM emp 2 WHERE deptno=10; COUNT(*) ---------- 3
-
How to remove certain common values of the columns in the result of a query?
Hello
I have a simple table with the structure:
CREATE TABLE EMP
(
ID VARCHAR2 (10 BYTE),
NAME VARCHAR2 (20 BYTE),
DESC1 VARCHAR2 (30 BYTE),
COUNTRY_ID VARCHAR2 (10 BYTE)
)
with values like this:
ID NAME DESC1 COUNTRY_ID
Can you please what will be the query that gives me output like this:
001 abc1 description 1 CON0000006
001 abc2 descr2 CON0000004
001 abc3 dsc3 CON0000003
CON0000005 descr4 abc4 002
CON0000001 descr5 abc5 002
003 abc6 dfrer CON0000001
ABC7 003 ioioi CON0000001
Lilli abc8 004 CON0000001
001 abc1 description 1
edited by: bootstrap on August 11, 2011 21:46
--- abc2 ---
--- abc3 ---
abc4 002 descr4
--- abc5 ---
003 abc6 dfrer
--- abc7 ---
004 abc8 lilli
Published by: bootstrap on August 11, 2011 21:48with t as ( select '001' id,'abc1' name,'description1' desc1,'CON0000006' country_id from dual union all select '001','abc2','descr2','CON0000004' from dual union all select '001','abc3','dsc3','CON0000003' from dual union all select '002','abc4','descr4','CON0000005' from dual union all select '002','abc5','descr5','CON0000001' from dual union all select '003','abc6','dfrer','CON0000001' from dual union all select '003','abc7','ioioi','CON0000001' from dual union all select '004','abc8','lilli','CON0000001' from dual ) -- end of on-the-fly data sample select case rn when 1 then id end id, name, case rn when 1 then desc1 end desc1, case rn when 1 then country_id end country_id from ( select id, name, desc1, country_id, row_number() over(partition by id order by name) rn from t ) order by name, rn / ID NAME DESC1 COUNTRY_ID --- ---- ------------ ---------- 001 abc1 description1 CON0000006 abc2 abc3 002 abc4 descr4 CON0000005 abc5 003 abc6 dfrer CON0000001 abc7 004 abc8 lilli CON0000001 8 rows selected. SQL>
SY.
-
Display the result of a query in a particular format
Hello
I have a table in the database that contains a column that contains a user name. Now all empty/null values in this column, the corresponding value is popluted that the word blank. Now, I want to select data from the table that contains the data in ascending order wrt to name but for the name in the vacuum, the corresponding column should appear at the end of the table. For instance if data such as:
SQL > select name from test;
NAME
--------
Anie
Christina
Vacuum
John
Ryan
Phil
Vacuum
My output should be like:
NAME
----------
Anie
Christina
John
Phil
Ryan
Vacuum
Vacuum
Thanks in advance.pay attention to the correct spelling,... is "Blank", "blank", 'Rough', 'rough'... etc.
-
How to get the result using this query?
Hi using iam under query,
WITH CTE (SNO, ID, PNT)
AS
(SELECT ROWNUM as SNO, TRANS_ID, VCN_NO OF)
SELECT V.TRANS_ID, V.VCN_NO IN VSL_MOVES V
WHERE V.END_TIME > = TRUNC (TO_DATE (: pStartDate, ' dd/MM/yy HH24')) AND V.END_TIME < = TRUNC (TO_DATE (: pEndDate, ' dd/MM/yy HH24'))
AND V.MOVEMENT_TYPE_CODE NOT IN ORDER ("ATA") OF V.VCN_NO, V.END_TIME))
SELECT ROWNUM as SNO, TAB. VESSEL_NAME, TAB. FLAG, TAB. IMO_NO, TAB. ARRIVED_DATE, TAB. F_ROM,
NVL ((SELECT CASE WHEN VMS. MOVEMENT_TYPE_CODE = 'ATS' THEN (SELECT TO_CHAR (NBV. ATD, "DD/MM/YYYY HH24") OF PNTS WHERE NBV. DOC_NO = TAB. VCN_NO AND ROWNUM < = 1) WHEN VMS. MOVEMENT_TYPE_CODE = 'ATB' THEN (SELECT TO_CHAR (VBU. BRTH_ALL_FAST, "DD/MM/YYYY HH24") OF VSL_BERTH_UNBERTH VBU WHERE VBU. BERTH_TRANS_ID = VMS. TRANS_ID AND ROWNUM < = 1) END ELSE NULL VSL_MOVES VMS WHERE VMS. TRANS_ID = TAB. (T_ID),'-') Sailed_Date,.
NVL ((SELECT CASE WHEN VMS. MOVEMENT_TYPE_CODE = 'ATS' THEN (SELECT P.PORT_NAME OF RRS, PORT_MASTER P WHERE P.PORT_CODE = PNT. VSL_NXT_PRT_CALL AND PNT. DOC_NO = TAB. VCN_NO) WHEN VMS. MOVEMENT_TYPE_CODE = 'ATB' THEN (SELECT CASE WHEN VBU. BERTH_CODE LIKE "% VOPK" AND THEN "VOPAK" WHAT VBU. BERTH_CODE AS "VSPM %" THEN "VOPAK" ELSE "POF" VBU VSL_BERTH_UNBERTH END WHERE VBU. BERTH_TRANS_ID = VMS. TRANS_ID AND ROWNUM < = 1) END ELSE NULL VSL_MOVES VMS WHERE VMS. TRANS_ID = TAB. (T_ID), "-") DESTINATION
DE)
SELECT
VM. TRANS_ID,
VM. VCN_NO,
VM. MOVEMENT_TYPE_CODE,
(SELECT PNT. VSL_NAME OF PNTS WHERE NBV. DOC_NO = VM. VCN_NO AND ROWNUM < = 1) VESSEL_NAME;
(SELECT C.COUNTRY_NAME OF COUNTRY C, VESSEL_MASTER M WHERE C.COUNTRY_CODE = M.FLAG AND M.VSL_CODE = VM. VSL_CODE AND ROWNUM < = 1) AS FLAG,.
(SELECT M.VSL_IMO_NO FROM VESSEL_MASTER M WHERE M.VSL_CODE = VM. VSL_CODE AND ROWNUM < = 1) IMO_NO;
TO_CHAR (VM. END_TIME, "DD/MM/YYYY HH24") ARRIVED_DATE,.
WHEN VM BOX. MOVEMENT_TYPE_CODE = 'STA' THEN (SELECT P.PORT_NAME FROM RRS, PORT_MASTER P WHERE P.PORT_CODE = PNT. LST_PORT_CALL AND PNT. DOC_NO = VM. VCN_NO AND ROWNUM < = 1) WHEN VM. MOVEMENT_TYPE_CODE = 'UTA' THEN (SELECT VB. VSL_BERTH_UNBERTH VB BERTH_CODE WHERE VB. UNBERTH_TRANS_ID = VM. TRANS_ID AND ROWNUM < = 1) END F_ROM.
--(SELECT T2.ID DELE DE CTE T1 JOIN CTE T2 SUR T1.) SNO = T2. SNO + 1 WHERE T1.ID = VM. TRANS_ID AND T1. NBV = VM. VCN_NO AND T2. NBV = VM. ATD VCN_NO)
(SELECT T1.ID CTE T1 WHERE SNO = (SELECT T2. SNO + 1 ETC T2 WHERE T2.ID = VM. TRANS_ID AND T2. NBV = VM. T_ID VCN_NO))
OF VSL_MOVES VM
WHERE (VM. End_time > = TRUNC (TO_DATE (: pStartDate, ' dd/MM/yy HH24')) AND VM. End_time < = TRUNC (TO_DATE (: pEndDate, ' dd/MM/yy HH24')) or
((CASE WHEN VMS. MOVEMENT_TYPE_CODE = 'ATS' THEN (SELECT TO_CHAR (NBV. ATD, "DD/MM/YYYY HH24") OF PNTS WHERE NBV. DOC_NO = TAB. VCN_NO AND ROWNUM < = 1) WHEN VMS. MOVEMENT_TYPE_CODE = 'ATB' THEN (SELECT TO_CHAR (VBU. BRTH_ALL_FAST, "DD/MM/YYYY HH24") OF VSL_BERTH_UNBERTH VBU WHERE VBU. BERTH_TRANS_ID = VMS. TRANS_ID AND ROWNUM < = 1) END ELSE NULL VSL_MOVES VMS WHERE VMS. TRANS_ID = TAB. Saileddate T_ID)) > = TRUNC (TO_DATE (: pStartDate, ' dd/MM/yy HH24')) and
(CASE WHEN VMS. MOVEMENT_TYPE_CODE = 'ATS' THEN (SELECT TO_CHAR (NBV. ATD, "DD/MM/YYYY HH24") OF PNTS WHERE NBV. DOC_NO = TAB. VCN_NO AND ROWNUM < = 1) WHEN VMS. MOVEMENT_TYPE_CODE = 'ATB' THEN (SELECT TO_CHAR (VBU. BRTH_ALL_FAST, "DD/MM/YYYY HH24") OF VSL_BERTH_UNBERTH VBU WHERE VBU. BERTH_TRANS_ID = VMS. TRANS_ID AND ROWNUM < = 1) END ELSE NULL VSL_MOVES VMS WHERE VMS. TRANS_ID = TAB. T_ID) saileddate) < = TRUNC (TO_DATE (: pEndDate, ' dd/MM/yy HH24')))
--(Sailed_Date > = TRUNC (TO_DATE (: pStartDate, ' dd/MM/yy HH24 ')) AND Sailed_Date < = TRUNC (TO_DATE (: pEndDate, ' dd/MM/yy HH24')))
AND VM. MOVEMENT_TYPE_CODE IN ('STA', "UTA")
) TAB
now my Question is should I include Sailed date also starttime and endtime (ex: date range of pStartDate and pEndDate I need to display the date sailed respected records)
I mean the problem is solved, I found the solution
docks of pof-
WITH CTE (SL, VCN_NO, VESSEL_NAME, FLAG, IMO_NO, ARRIVED, FROM_, MOVEMENT_TYPE_, NEXT_MOVE, SAILED_DATE, DESTINATION, FID, TID)
AS
(SELECT T1.*,
WHEN T1 BOX. FROM_ = 'POF' THEN 1 OTHER 2 END FID,
WHEN T1 BOX. DESTINATION = "POF" THEN 1 OTHER 2 END TID
Of
(
SELECT ROW_NUMBER() OVER (PARTITION OF VM. VCN_NO ORDER BY VB. (SL BRTH_ALL_FAST),
VM. VCN_NO,
(SELECT M.VSL_NAME FROM VESSEL_MASTER M WHERE M.VSL_CODE = VM. VESSEL_NAME VSL_CODE),
(SELECT C.COUNTRY_NAME OF COUNTRY C, VESSEL_MASTER M WHERE C.COUNTRY_CODE = M.FLAG AND M.VSL_CODE = VM. VSL_CODE AND ROWNUM< =1="" )="" as="">
(SELECT M.VSL_IMO_NO FROM VESSEL_MASTER M WHERE M.VSL_CODE = VM. IMO_NO VSL_CODE),
VB. BRTH_ALL_FAST HAS ARRIVED,
(CASE WHEN VM. MOVEMENT_TYPE_CODE = 'ATB' THEN 'ANCHORAGE' WHAT VM. MOVEMENT_TYPE_CODE = "LTB" THEN 'LAND' WHEN VM. MOVEMENT_TYPE_CODE = "BTB" AND (SELECT TT1. VSL_MOVES TT, VSL_BERTH_UNBERTH TT1 BERTH_CODE WHERE TT. TRANS_ID = TT1. BERTH_TRANS_ID AND TT. VCN_NO = VM. VCN_NO AND TT1. UNBERTH_TRANS_ID = VB. BERTH_TRANS_ID) (SELECT WB. BERTH_MASTER BM BERTH_CODE WHERE BM. QUAY_CODE NOT IN ("VOPAK", "SPM")) THEN 'POF' WHEN VM. MOVEMENT_TYPE_CODE = "BTB" AND (SELECT TT1. VSL_MOVES TT, VSL_BERTH_UNBERTH TT1 BERTH_CODE WHERE TT. TRANS_ID = TT1. BERTH_TRANS_ID AND TT. VCN_NO = VM. VCN_NO AND TT1. UNBERTH_TRANS_ID = VB. BERTH_TRANS_ID) (SELECT WB. BERTH_MASTER BM BERTH_CODE WHERE BM. QUAY_CODE IN ("VOPAK", "SPM")) THEN "VOPAK" OTHER (SELECT P.PORT_NAME FROM RRS, P PORT_MASTER WHERE P.PORT_CODE = PNT. LST_PORT_CALL AND PNT. DOC_NO = VM. FROM_ VCN_NO END)).
VM. MOVEMENT_TYPE_CODE,
(SELECT THE VIRTUAL COMPUTERS. VSL_MOVES VMS MOVEMENT_TYPE_CODE WHERE VMS. TRANS_ID = VB. NEXT_MOVE UNBERTH_TRANS_ID),
VB. UB_LST_LNE_CASTOFF SAILED_DATE,
NVL ((SELECT CASE WHEN VMS. MOVEMENT_TYPE_CODE = 'UTA' THEN 'ANCHORAGE' WHAT VMS. MOVEMENT_TYPE_CODE = 'BTL' THEN 'LAND' WHEN VMS. MOVEMENT_TYPE_CODE = "UTS" THEN (SELECT P.PORT_NAME FROM RRS, PORT_MASTER P WHERE P.PORT_CODE = PNT. VSL_NXT_PRT_CALL AND PNT. DOC_NO = VMS. VCN_NO) WHEN VMS. MOVEMENT_TYPE_CODE = "BTB" AND (SELECT TT1. VSL_MOVES TT, VSL_BERTH_UNBERTH TT1 BERTH_CODE WHERE TT. TRANS_ID = TT1. BERTH_TRANS_ID AND TT. VCN_NO = VM. VCN_NO AND TT1. BERTH_TRANS_ID = VMS. TRANS_ID) (SELECT WB. BERTH_MASTER BM BERTH_CODE WHERE BM. QUAY_CODE NOT IN ("VOPAK", "SPM")) THEN 'POF' WHEN VMS. MOVEMENT_TYPE_CODE = "BTB" AND (SELECT TT1. VSL_MOVES TT, VSL_BERTH_UNBERTH TT1 BERTH_CODE WHERE TT. TRANS_ID = TT1. BERTH_TRANS_ID AND TT. VCN_NO = VM. VCN_NO AND TT1. BERTH_TRANS_ID = VMS. TRANS_ID) (SELECT WB. BERTH_MASTER BM BERTH_CODE WHERE BM. QUAY_CODE IN ("VOPAK", "SPM")) THEN "VOPAK" OTHERWISE NULL END VSL_MOVES VMS WHERE VB. UNBERTH_TRANS_ID = VMS. (TRANS_ID), "-") DESTINATION
OF VM, VSL_BERTH_UNBERTH VB VSL_MOVES WHERE (VM. TRANS_ID = VB. BERTH_TRANS_ID)
AND VM. MOVEMENT_TYPE_CODE LIKE '% TB '.
AND ((VB. BRTH_ALL_FAST > = TO_TIMESTAMP(:pStartDate,'DD/MM/YYYY HH24:MI') AND VB. BRTH_ALL_FAST<= to_timestamp(:penddate,'dd/mm/yyyy="">=>
OR (VB. UB_LST_LNE_CASTOFF > = TO_TIMESTAMP(:pStartDate,'DD/MM/YYYY HH24:MI') AND VB. UB_LST_LNE_CASTOFF<= to_timestamp(:penddate,'dd/mm/yyyy="" hh24:mi'))="">=>
AND VB. BERTH_CODE (SELECT WB. BERTH_MASTER BM BERTH_CODE WHERE BM. QUAY_CODE NOT IN ("VOPAK", "SPM"))
- AND VM. VCN_NO = 201510336
ORDER OF VB. BRTH_ALL_FAST
) T1
)
Select rownum AS SNO, tab2.* of)
SELECT
TAB1. VCN_NO, TAB1. VESSEL_NAME, TAB1. FLAG, TAB1. IMO_NO,
NVL (BOX WHEN TAB1. HAS ARRIVED< to_timestamp(:pstartdate,'dd/mm/yyyy="" hh24:mi')="" then="" '----------'="" else="" to_char(tab1.arrived,'dd/mm/yyyy="" hh24:mi')="" end,'----------')="">
NVL (BOX WHEN TAB1. HAS ARRIVED< to_timestamp(:pstartdate,'dd/mm/yyyy="" hh24:mi')="" then="" '----------'="" else="" (select="" t2.from_="" from="" cte="" t2="" where="" t2.sl="TAB1.FROM_" and="" t2.vcn_no="TAB1.VCN_NO)" end,'----------'="">
NVL (CASE WHEN (SELECT T2. DESTINATION OF THE CTE T2 WHERE T2.SL = TAB1. DEST AND T2. VCN_NO = TAB1. VCN_NO) = 'POF' THEN '-' ANOTHER BOX WHEN TAB1. SAILED_DATE > TO_TIMESTAMP (: pEndDate, ' DD/MM/YYYY HH24') THEN '-' ELSE TO_CHAR (TAB1. (SAILED_DATE, "DD/MM/YYYY HH24") A PIECE,'-') SAILED_DATE,.
NVL (BOX WHEN TAB1. SAILED_DATE > TO_TIMESTAMP (: pEndDate, ' DD/MM/YYYY HH24') THEN '-' ELSE (SELECT CASE WHEN T2. DESTINATION = 'POF' THEN '-' ANOTHER T2. THE END OF THE DESTINATION OF THE CTE T2 WHERE T2.SL = TAB1. DEST AND T2. VCN_NO = TAB1. (END OF VCN_NO), "-") DESTINATION
DE)
SELECT THE TAB. VCN_NO, TAB. VESSEL_NAME, TAB. FLAG, TAB. IMO_NO,
MIN (TAB. HAPPENED) ARRIVED,
MIN (TAB.SL) FROM_,
MAX (TAB. SAILED_DATE SAILED_DATE),
MAX (TAB.SL) DEST,
TAB. SNO
DE)
SELECT T1.*,
WHEN T1 BOX. FID = 2 AND T1. TID = 1 THEN 1 WHEN T1. FID = 1 AND T1. TID = 2 THEN 1 WHEN T1. FID = 1 AND T1. TID = 1 THEN 0
WHEN T1. FID = 2 AND T1. TID = ROWNUM THEN 2 + 1 END OF ANOTHER 3 SNO
T1 ETC
) GROUP OF TABS BY TABS. VCN_NO, TAB. VESSEL_NAME, TAB. FLAG, TAB. IMO_NO, TAB. SNO
) TAB1 WHERE TAB1. SNO<>0
) tab2
Maybe you are looking for
-
I can't find my old emails that is to say the last 4 years e-mails have disappeared. I can't see in the 'archives' folder list and also in my list of "local" filesI recently formatted my system. It causes this problem? Is there anyway to recover my e
-
Can I use a Dell P2714H HD and a monitor Dell P2715Q together on my new macpro?
I want to use a P2714H Dell HD and a Dell P2715Q monitor k 4 together on my new Mac Pro. This is so that I can see the differences between the two. I would like to know first if they can work together, and second, what are the pitfalls involved? If s
-
QuestionI get a dialog asking me if I want to open or save a document in firefox, whenever I click on an email in outlook in windows; What can I do to fix this? Thank you
-
If the box is checked, SUM Qty of the reds only
Column a: checkboxes Column B: colors (red, blue, green, etc.). [expression] Column C: quantity What I need the formula to do is... If the box is checked, SUM quantity of Red only. In this case, the answer would be 35. What is the formula to calcula
-
Install apple core foundation dll Syncnotifier
How to install the Syncnotifier Apple core foundation dll free Thanks in advance H.A.Jammal