Help needed - debug the script.
Hi Experts,Can someone help me to debug the script below.
Basically, I'm just checking the dates of a column DATE_NAME and if its between the selected range, I'm assiging a number.
Select DATE_NAME, CASE
WHEN
Trim (to_char(DATE_NAME,'DD-MON')) BETWEEN the TRIM (TO_CHAR (to_DATE (15 - DEC ',' DD - MY '), "JJ - LUN")) AND TRIM (TO_CHAR (to_DATE (10-JAN ',' DD - MY '), "JJ - LUN")) THEN 1
WHEN
Trim (to_char(DATE_NAME,'DD-MON')) BETWEEN the TRIM (TO_CHAR (to_DATE (11-JAN ',' DD - MY '), "JJ - LUN")) AND TRIM (TO_CHAR (to_DATE ('07 - FEB ',' DD - MY '), "JJ - LUN")) THEN 2
WHEN
Trim (to_char(DATE_NAME,'DD-MON')) BETWEEN the TRIM (TO_CHAR (to_DATE ('08 - FEB ',' DD - MY '), "JJ - LUN")) AND TRIM (TO_CHAR (to_DATE ('07 - MAR ',' DD - MY '), "JJ - LUN")) THEN 3
WHEN
Trim (to_char(DATE_NAME,'DD-MON')) BETWEEN the TRIM (TO_CHAR (to_DATE ('08 - MAR ',' DD - MY '), "JJ - LUN")) AND TRIM (TO_CHAR (to_DATE ('04 - APR ',' DD - MY '), "JJ - LUN")) THEN 4
WHEN
Trim (to_char(DATE_NAME,'DD-MON')) BETWEEN the TRIM (TO_CHAR (to_DATE ('05 - APR ',' DD - MY '), "JJ - LUN")) AND TRIM (TO_CHAR (to_DATE ('02-MAY ',' DD - MY '), "JJ - LUN")) THEN 5
WHEN
Trim (to_char(DATE_NAME,'DD-MON')) BETWEEN the TRIM (TO_CHAR (to_DATE ('03-MAY ',' DD - MY '), "JJ - LUN")) AND TRIM (TO_CHAR (to_DATE (MAY 30 ',' DD - MY '), "JJ - LUN")) THEN 6
WHEN
Trim (to_char(DATE_NAME,'DD-MON')) BETWEEN the TRIM (TO_CHAR (to_DATE (MAY 31 ',' DD - MY '), "JJ - LUN")) AND TRIM (TO_CHAR (to_DATE (27 - JUN ',' DD - MY '), "JJ - LUN")) THEN 7
WHEN
Trim (to_char(DATE_NAME,'DD-MON')) BETWEEN the TRIM (TO_CHAR (to_DATE (28 - JUN ',' DD - MY '), "JJ - LUN")) AND TRIM (TO_CHAR (to_DATE (25 - JUL ',' DD - MY '), "JJ - LUN")) THEN 8
WHEN
Trim (to_char(DATE_NAME,'DD-MON')) BETWEEN the TRIM (TO_CHAR (to_DATE (26 - JUL ',' DD - MY '), "JJ - LUN")) AND TRIM (TO_CHAR (to_DATE (22 - AUG ',' DD - MY '), "JJ - LUN")) THEN 9
WHEN
Trim (to_char(DATE_NAME,'DD-MON')) BETWEEN the TRIM (TO_CHAR (to_DATE (23 - AUG ',' DD - MY '), "JJ - LUN")) AND TRIM (TO_CHAR (to_DATE (19-SEP ',' DD - MY '), "JJ - LUN")) THEN 10
WHEN
Trim (to_char(DATE_NAME,'DD-MON')) BETWEEN the TRIM (TO_CHAR (to_DATE (20-SEP ',' DD - MY '), "JJ - LUN")) AND TRIM (TO_CHAR (to_DATE (17 - OCT ',' DD - MY '), "JJ - LUN")) THEN 11
WHEN
Trim (to_char(DATE_NAME,'DD-MON')) BETWEEN the TRIM (TO_CHAR (to_DATE (18 - OCT ',' DD - MY '), "JJ - LUN")) AND TRIM (TO_CHAR (to_DATE (14 - NOV ',' DD - MY '), "JJ - LUN")) THEN 12
WHEN
Trim (to_char(DATE_NAME,'DD-MON')) BETWEEN the TRIM (TO_CHAR (to_DATE (15 - NOV ',' DD - MY '), "JJ - LUN")) AND TRIM (TO_CHAR (to_DATE (12 - DEC ',' DD - MY '), "JJ - LUN")) THEN 13
0 OTHERWISE
END AS D_TIME PERIOD;
Any help will be appreciated.
PS: DATE_NAME is of DATE data type.
Thank you
G
Published by: Gurusank on June 24, 2009 15:53
Do not convert the date to a string for comparison. For example your following code snippet:
TRIM(TO_CHAR(DATE_NAME,'DD-MON')) BETWEEN
TRIM(TO_CHAR(to_DATE('15-DEC', 'DD-MON'),'DD-MON') )
AND
TRIM(TO_CHAR(to_DATE('10-JAN', 'DD-MON'),'DD-MON'))
should be written as
DATE_NAME BETWEEN to_DATE('15-DEC', 'DD-MON')
and to_DATE('10-JAN', 'DD-MON')
Are you sure avoiding the year (YYYY) in your format to to_date mask. This will affect current year to date
In this case, something like
TO_DATE(TO_CHAR(DATE_NAME,'DD-MON')), 'DD-MON') BETWEEN
to_DATE('15-DEC', 'DD-MON')
AND
to_DATE('10-JAN', 'DD-MON')
(It could be an effective way to make this part. Nothing is striking for me from now on.)
I hope this helps.
Kind regards
JO
Tags: Database
Similar Questions
-
Need help to modify the Script to find the number of vCPU and reservation of memory in VC
Hello
Need help to modify the script so that his can person report to the vc all focus level instead of each level of the Cluster.
Thank you
KR
Try this instead:
$vmsInfo = Get-VM #Creating array to place new object $reportdata = @() Foreach ($vm in $vmsInfo) { #Creating new object $vmInfo = "" | Select Name, CPUReservationMHz, MemoryReservationGB $vmInfo.Name = $vm.Name $vmInfo.CPUReservationMHz = $vm.ExtensionData.ResourceConfig.CpuAllocation.Reservation $vmInfo.MemoryReservationGB = $vm.ExtensionData.ResourceConfig.MemoryAllocation.Reservation / 1024; #Inserting data into new object. $reportdata += $vminfo } $reportdata
-
I try to write a script by my slef but not work
app.findGrepPreferencest = firstLineIndent:8, leftIndent:8;
app.changeGrepPreferences = firstLineIndent:8, leftIndent:16;
app.changeGrep ();
app.findGrepPreferences = app.changeGrepPreferences = null;
Can someone please help me fix the script, please.
Hello
Try this.
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.firstLineIndent = '8 ';
app.findGrepPreferences.leftIndent = '8 ';
app.changeGrepPreferences.firstLineIndent = '8 ';
app.changeGrepPreferences.leftIndent = "16pt;
app.changeGrep ();
app.findGrepPreferences = app.changeGrepPreferences = null;
Kind regards
Cognet
-
Hi guys,.
My client is trying to run this script, but continues to encounter this error. Could someone please help us understand what not do we have here?
The script must be run from the vMA, not a Windows system with vcli/viperltoolkit. Try to run it from the vMA.
http://communities.VMware.com/docs/doc-11901
Requirements
ESX(I) 4.x or vCenter 4.x
VMware 4.x VMA
-
I have disable debugging the scripts, but it turns! is this a virus?
I have a Pavilion dv7, I'll tab in tools, Internet options, click the Advanced tab, and disable debugging scripts, but in a short time I get the message to turn off the script, again the tab tools, etc. and it is clicked again once, I tried to click on these tabs and restart my computer, but it maintains that the script turned off in the 1st window I use it! It's annoying to anyone can help?
Run Microsoft fixit below link
-
SQL query help needed in the Clause type
Hello
I'm currently learning Clause type. How can I write in the clause type to get the result below:
I have a table like this
DEPTNO ENAME
------- ------
20 SMITH
CELINE 10
BOND 20
ALLEN 30
WARD 30
20 JONES
30 MARTIN
30 BLAKE
10 CLARK
SCOTT 20
10 KING
30 TURNER
20 ADAMS
30 JAMES
20 FORD
10 MILLER
I want the output should look like this
DEPTNO ENAME
------ -----
CELINE 10, CLARK, KING, MILLER
20 JONES, ADAMS, BOND, FORD, SCOTT, SMITH
30 MARTIN, JAMES BLAKE, WARD, TURNER, ALLEN
Hear is the script I am currently working on.
with emp_group as
(
Select 20 deptno, ename 'SMITH' Union double all the
choose 10, 'CÉLINE' from dual union all
Select 20, "BOND" of all the double union
Select 30, 'ALLEN' from dual union all
Select 30, 'WARD' of all the double union
Select 20, "JONES' from dual union all
Select 30, 'MARTIN' from dual union all
Select 30, "BLAKE" from dual union all
choose 10, 'CLARK' from dual union all
Select 20, 'SCOTT' from dual union all
choose 10, 'KING' of the dual union all
Select 30, 'TURNER' from dual union all
Select 20, 'ADAMS' from dual union all
Select 30, 'JAMES' of the dual union all
Select 20, 'FORD' Union double all the
choose 10, 'MILLER' from dual
)
Select
DEPTNO
A1
of emp_group
model
ignore the nav
partition (deptno)
dimension (ROW_NUMBER() over (PARTITION BY deptno ORDER BY ename DESC) rn)
measures (ename, LPAD(' ', 100) A1)
rules)
A1 [rn > 0] = ename [cv ()],
A1 [0] = ename [cv ()]
)
order by deptno
;
your help is very appreciated.
Thank you in advance.
Try this.
Select
*
Of
(
with emp_group as
(
Select 20 deptno, ename 'SMITH' Union double all the
choose 10, 'CÉLINE' from dual union all
Select 20, "BOND" of all the double union
Select 30, 'ALLEN' from dual union all
Select 30, 'WARD' of all the double union
Select 20, "JONES' from dual union all
Select 30, 'MARTIN' from dual union all
Select 30, "BLAKE" from dual union all
choose 10, 'CLARK' from dual union all
Select 20, 'SCOTT' from dual union all
choose 10, 'KING' of the dual union all
Select 30, 'TURNER' from dual union all
Select 20, 'ADAMS' from dual union all
Select 30, 'JAMES' of the dual union all
Select 20, 'FORD' Union double all the
choose 10, 'MILLER' from dual
)
Select
DEPTNO
names
rn
of emp_group
model
ignore the nav
partition (deptno)
dimension of)
ROW_NUMBER() over (PARTITION BY deptno ORDER BY ename) rn
)
measures (ename, cast (null as names of varchar2 (40)))
rules
(
names [any] order by desc = ename [cv ()] rn | «, » || names [cv () + 1]
)
order by deptno
)
where rn = 1
Best regards, Andrei
-
Can someone help me change the script function?
I have a script for indesign:
var link, image, frame,.
doc = app.activeDocument,
Links = doc.links,.
counter = 0;
for (var i = links.length - 1; i > = 0; i--) {}
If (links [i] .status == LinkStatus.LINK_MISSING) {}
try {}
link = links [i];
image = link.parent;
Frame = image.parent;
Frame.Remove ();
counter ++;
}
{} catch (err)
$.writeln (i + "-" + err);
}
}
}
which is made by Kasyan Servetsky, function: remove all objects from the missing link, it works fine, but only works on the single file,.
now, I want to change the purpose of the function to let him work on all open files.
for example, I opened more than a dozen files, all the files have disappeared as objects, I want to delete all items in the missing link in the file by a simple click the script,
is this possible?Hi Harvey.
I guess that's what you expect below,
***********************************************************************
var link, image, image;
var openDocs = app.documents.
var openDocsLen = openDocs.length;
for (var d = 0; d)< opendocslen;="" d="">
currDoc = openDocs [d],
Links = currDoc.links,.
counter = 0;
for (var i = links.length - 1; I > = 0; i--) {}
If (links [i] .status == LinkStatus.LINK_MISSING) {}
try {}
link = links [i];
image = link.parent;
Frame = image.parent;
Frame.Remove ();
counter ++;
}
{} catch (err)
$.writeln (i + "-" + err);
}
}
}
}
*****************************************************************************
Please add extra code to save the document if you need
Concerning
Augustine
-
HI I'm new to HYPERION planning. Can someone help me with the script Calclation.
I wrote a script DataExport in the hyperion planning calculation script.
The Script is validated and successfully deployed. But I do not get to the exported file. What's in it.
This is my script.
exportactual:
{SET DATAEXPORTOPTIONS
DataExportLevel Level0.
DataExportDynamicCalc
DataExportColHeader 'period '.
DATAEXPORTCOLFORMAT ON;
};
DIFFICULTY (@IDESCENDANTS ("all accounts", 0), "Jan", "FY14', 'Power', 'Work', 'New York', 'RIN')
DATAEXPORT 'file ' '; '. "D:\exportedfile.txt" "#MI";
ENDFIX
The rule runs successfully.
When I look in the D: the exported file is not created.
When I look in the rule once again it displays / / error detected while trying to perform the work: exportactual
I'm new to this environment.
Can someone give me suggestion.
You can find the file in the Essbase server.
Check in one place everything you mentioned in script in Essbase Server.
Thank you
Mady
-
Help needed on the links between drop-down list boxes
Hello
I use 8 adobe life cycle designer to make shapes. These forms are usesd to collect information on people working in the health sector.
I want to use drop-down lists that are "connected". According to the choice made in the first box, the user will receive new options in the second box.
Example:
Dropbox 1
Values
-value 1
-value 2
-value 3
Dropbox 2
If the value of things 1 user, they can choose the following values in dropbox 2:
-Value has
-Value B
If the value of things 2 user, they can choose the following values in dropbox 2:
-Value C
-Value D
If the value of things 3 user, they can choose the following values in dropbox 2:
-Value E
-Value F
I've been puzzeling for awhile, but impossible to find the solution for this.
Thanks in advance
Daniel
I'm compatible pdf for ES 8. Now we work. https://workspaces.Acrobat.com/?d=qBsk3hERFH2RcSn5vQ5rBg
When the script does not check
scripting language - javascript
ObjectName - is your identical objectname (when your dd called dd_choice2 or dropbox_2, then you must modify the script)
case "123": dropbox_2.clearItems(); dropbox_2.addItem("Please select a value"); dropbox_2.addItem("456"); dropbox_2.addItem("789"); dropbox_2.selectedIndex = 0; break;
The behavior is correct when you copy them.
You select '123 '.
2 JJ '456' and '678 '.
You select "456".
2 JJ "123" and "678".
You select "678".
2 JJ '456' and '678 '.
Please give your feedback tomorrow if it's work.
Kind regards Mandy
-
Hi people,
I'm trying to set up an access control list. So that I can access with success the service network as user sys, but not as long as the user test1.
I was just wondering, if anyone can be able to take a look at my code and point out my error.
DB version: * 11.2.0.1.0 *.
Platform: Windows 7 (64-bit)
Creation of ACL code:
Test results:# Create a user CREATE USER test1 IDENTIFIED BY xxxxxx; GRANT CONNECT TO test1; # Create the ACL BEGIN dbms_network_acl_admin.create_acl ( acl => 'test_acl_file.xml', description => 'A test of the ACL functionality', principal => 'TEST1', is_grant => TRUE, PRIVILEGE => 'connect', start_date => SYSTIMESTAMP, end_date => NULL); COMMIT; END; / # BEGIN dbms_network_acl_admin.assign_acl ( acl => 'test_acl_file.xml', host => 'dbaexpert.com', lower_port => NULL, upper_port => NULL); END; /
User: test1User: sys SELECT utl_http.request('http://www.dbaexpert.com') from DUAL; Output: UTL_HTTP.REQUEST('HTTP://WWW.DBAEXPERT.COM') -------------------------------------------------------------------------------------- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head> ...... </head>
The statement above as a user 'test1 '.
Validation test:Output: Error starting at line 1 in command: SELECT utl_http.request('http://www.dbaexpert.com') from DUAL Error report: SQL Error: ORA-29273: HTTP request failed ORA-06512: at "SYS.UTL_HTTP", line 1722 ORA-24247: network access denied by access control list (ACL) ORA-06512: at line 1 29273. 00000 - "HTTP request failed" *Cause: The UTL_HTTP package failed to execute the HTTP request. *Action: Use get_detailed_sqlerrm to check the detailed error message. Fix the error and retry the HTTP request.
Thanks in advanceselect ACL, PRINCIPAL, privilege, IS_GRANT from DBA_NETWORK_ACL_PRIVILEGES; Output: ACL||','||PRINCIPAL||','||PRIVILEGE||','||IS_GRANT /sys/acls/test_acl_file.xml,TEST1,connect,true
rogers42Hello
www.dbaexpert.com differs from dbaexpert.com ACL configuration must match exactly, host names
Greetings,
Damage ten Monkshood
-
Help please change the script number
Hello!
There is one such script or plugin, hand Controller.jsx and there is a single track camera parameter limit somehow the number that allows you to control up to 1370, for example, I need to infinity, or at least to 20,000, to try to change the number in the main Controller.jsx file but nothing changed. wrote one person here, he said the difficulty of "PresetEffects.xml" in the folder "C:-Program Files-Adobe------Adobe after effects CC 2015------Support Files. I changed the track camera up to the desired value, but as soon as I change more than 1370 all is lost. Plug-and-project joint. project of https://Cloud.mail.ru/public/3AwZ/fCu2WcPSh and https://cloud.mail.ru/public/H6C8/smxDKdXPM
Help me please.
-
Help needed on the export of the Photo App
I'm a photo hobbyest with thousands of photos stored in my Mac using the Photos app. I already saved them on Time Machine and iCloud. However, I try to upload some on an external hard drive but can't. The Photo app continues to CHANGE the resolution of my images when I export them. Here is what happens...
- I have uploaded a JPEG of 5 MB in the Photo app earlier this year.
- Now, I'm ready to take a copy of this picture on my external hard drive.
- If I just move the original photo to the Photo app on my counter top, the resolution GOES from 5MB to 2.1 MB.
- If I export 'The Original unmodified' I lose all the changes that I made in the Photo app.
- If I export the 'High' quality jpeg image, it DROPS my resolution of 2.1 MB.
- If I export the photo to the "Maximum" quality jpeg, it INCREASES my resolution to 14.3 MB!
- I found NO WAY to download my original photo size!
Question... How to export or copy an image from within the app of the Photo on an external hard drive with the resolution of the EXACT SAME as it is?
Thank you!
You first need to understand the resolution - the file size is not resolution - the resolution concerns the dimensions in pixels of the image - file to a JPEG file size is determined by the compression you choose - compression of the image does not change the dimensions in pixels of all - compression removes the donnΘes form the pictures and all JPEG in theory is inferior finial an uncompressed image as TIFF - but for practically all the uses, it does not matter
When you export a modified version of the photo you create a new file that contains the image and the size of the files is determined by the selections you make and has no resolution at all to the original file
Photos has limited control over file size - ir you want a file size, then export a copy of very high quality (maximum or even a TIFF uncompressed) and use another program that gives you more control to compress in the JPEG compression you want
But at the end of the day the size of the file is really no different and it is very likely that the big JPEG will give you the same results as an uncompressed TIFF
LN
-
Help needed on the BlackBerry PUSH API
Hi ALL, I've learned that by using the BlackBerry PUSH API, we can send data to any user of blackberry (beyond the company) (reference: BlackBerry_Push_APIs_Whitepaper.pdf).
(1) is it necessary to configure BlackBerry Enterprise Server to use the BlackBerry PUSH API.
(2) using the PUSH API, can we send data or store data or add data to a file in persistent memory on the BlackBerry smartphone.
Thanks in advance.
you need a bes
You can do whatever you want with the received data, which includes adding them to the other persistent memory stuff.
-
Help needed in the parameter validation and ownership
Hello Denzz/Dupont,
Sorry for the confusion between you guys, but please find a new parameter of condition that I need for a property evaluation and validation above top of it.
I have 2 Essbase property i, e Essbase.ASO.DataStorage and Essbase.BSO.DataStorage that are defined with the default as empty from now.
I want to do it derived property satisfying the scenarios below.
(1) all the Member of sheet under hierarchy account should be Essbase.ASO.DataStorage = Nevershare
All the Limb Member of the hierarchy that account must have Essbase.ASO.DataStorage = StoreData
(2) all the leaf Member of the hierarchy that account must have Essbase.BSO.DataStorage = Nevershare
All the Limb Member of the hierarchy that account must have Essbase.BSO.DataStorage = DynamicCalc
(3) as it is requested to the point 2, all the sheet military under the hierarchy ought to have Essbase.BSO.DataStorage = Nevershare
(with condition applied here)
Essbase.Bso.Formula property if it is filled or have all the values in it, then Essbase.BSO.DataStorage should be replaced by DynamicCalc
Alternatively it can be Nevershare if Essbase.Bso.Formula property is empty.
I also want a parameter validation here, if the user tries to change all values in these two different properties of the derived value, then it should give them a validation error.
Yes it would be then that node add and that was my main reason to ask if it worked - the fire
The thing is it prevents the two properties ASO and storage BSO to have empty values and while creating nodes these accessories will be empty
OK try this-
If (PropValue (Core.Leaf),
And)
If)
IsBlank (PropValue (Custom.Essbase.BSO.DataStorage)), it's true.
If)
IsBlank (PropValue (Custom.Essbase.BSO.Formula)).
Equals (String, PropValue (Custom.Essbase.BSO.datastorage), Nevershare),
Equals (String, PropValue (Custom.Essbase.BSO.datastorage), DynamicCalc)
)
),
If)
IsBlank (PropValue (Custom.Essbase.ASO.DataStorage)), it's true.
Equals (String, PropValue (Custom.Essbase.ASO.datastorage), Nevershare)
)),
And)
If)
IsBlank (PropValue (Custom.Essbase.ASO.DataStorage)), it's true.
Equals (String, PropValue (Custom.Essbase.ASO.datastorage), StoreData)
),
If)
IsBlank (PropValue (Custom.Essbase.BSO.DataStorage)), it's true.
Equals (String, PropValue (Custom.Essbase.BSO.datastorage), DynamicCalc)
))
)
-
Hi team,Please help on the below questions on BICS.
1. How do I delete records that has been loaded into the DATABASE LOADER?
2. how to remove the database tables in DATA MODELER?
3. how change the data type varchar to Date format in the DATA LOADER loading data? I can see only the number and the type varchar.
4. after the publication of the data model with success, I can create visual reports. If I change the data model for all the changes, the join conditions are go (missing persons) automatically. Don't know why its happening. I have to recreate the model again for this.
Please provide documentation for the same if no.
Thank you
Malli
At the beginning of the end, the tabs are domain names when loading data using the data loader fixed the issue with the knuckles that disappears into the data model.
We can delete, create, and can change the formats of data using Oracle Apex for BICS.
Thank you
Malli
Maybe you are looking for
-
Hi I'm new Apple Watch brand, but its wake of wrist does not properly .it means this wrist wake up, but he is not waking up when I raised
-
To continue using iCloud on this iPhone...
How to stop this error from popping up?
-
Please read!I can't make a partition of my drive!I got a free space as 431 GB and I can not make a partition!When everything I do at leats this message comes to me!Please tell me what I should do to solve this problem!
-
When you download an anti virus program I get the message of insufficient permissions, why is it I am logged as administrator.
-
Is there an easy way to dual boot Windows 7 and Windows XP?
I have win xp pro on a single hard drive and just installed the new drive with win 7pro, y at - it a simple way for dual boot original title: how to dual boot