non-null in the creation
Hi all
I have a table with data, I want to add the new column which is not null
with the fall of the table is can anyone help pls
Hello
first add a Nullable column, fill in the data column, and then change the column not null.
Or if you have a default try something like this
alter table
ID | Country | Hobby | Internal_ID | CAT |
1 | Oman | Rugby Union | 63180 | Juv |
1 | Oman | Rugby Union | 63180 | Teacher |
1 | Oman | Rugby Union | 63180 | Juv |
the request requires the output as follows:
ID | Country | Hobby | Internal_ID | CAT |
1 | Oman | Rugby Union | 63180 | 7 |
because cat = 'juv' (5) is less cat =' teacher (7).
all columns are not null and the primary key of the new_table is ID + hobby
The script displays the following output:
01400 00000 - 'impossible to insert NULL into (%s)' because does not recognize the function max.
Thanks in advance.
Kind regards.
Actually there are values not in the range of cat. There is an error in the old data table.
I proceeded to remove the lines out of reach in the cat because column that are not relevant in this case.
The parameters I use Oracle are:
Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
PL/SQL Release 11.2.0.1.0 - Production
"CORE 11.2.0.1.0 Production."
AMT for 64-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
Thank you very much. You are so helpful.
Kind regards.
Need to count the number of occurrences (non-null) not empty for an XML element
Hello
I have XML data stored in a CLOB, there is a fragment below:
<ADDR> <AutoNameOfOrganisation>2nd Image</AutoNameOfOrganisation> <AutoLine1>105 Risbygate Street</AutoLine1> <AutoLine2> </AutoLine2> <AutoLine3> </AutoLine3> <AutoU40.16>BURY ST. EDMUNDS</AutoU40.16> <AutoStateOrCounty>Suffolk</AutoStateOrCounty> <AutoU40.13>IP33 3AA</AutoU40.13> <AutoU40.14>UNITED KINGDOM</AutoU40.14> </ADDR> <ADDR> <AutoNameOfOrganisation></AutoNameOfOrganisation> <AutoLine1>2 2nd Avenue</AutoLine1> <AutoLine2> </AutoLine2> <AutoLine3> </AutoLine3> <AutoU40.16>HULL</AutoU40.16> <AutoStateOrCounty>East Riding of Yorkshire</AutoStateOrCounty> <AutoU40.13>HU6 9NT</AutoU40.13> <AutoU40.14>UNITED KINGDOM</AutoU40.14> </ADDR>
What I want to do is to look at all of the xml code and derive a count for a particular item where there are data.
In the case above < AutoNameOfOrganisation > is not null in the first record and null in the second then < AutoLine3 > is null in both files, so I that counts 1 to < AutoNameOfOrganisation > and < AutoLine3 > 0.
The reason is so that I can avoid showing a column in a report, if there is no data for that particular column in the results.
I'm using Oracle 11 G.
Thanks for any help,
Chris
Here's one way:
Select count (AutoNameOfOrganisation)
count (AutoLine3)
from my_table t
xmltable)
' / root/ADDR.
by the way xmlparse (document my_clob)
path of columns AutoNameOfOrganisation varchar2 (30) "normalize-space (AutoNameOfOrganisation).
, Path of varchar2 (30) AutoLine3 "normalize-space (AutoLine3).
) x ;
There is no root element in the fragment of your sample, so I added one to test the application (although it is also possible to work with real XML fragments).
You can also omit normalize - space () calls if empty nodes are really empty. In your example, there is a space so I added the function to strip it.
Return the first line with a non-null value in a column
Hey there, gurus. Can someone give me a hand with this?I have a table with six columns: Class_ID, Course_ID, start_date, Last_Name, First_Name, company. When our students take a class and will fill in an evaluation form, they fill in the Class_ID Last_Name First_Name, and Company. The Course_ID and Start_Date are filled automatically based on the Class_ID.
I am trying to generate a report that contains Class_ID, Course_ID and Start_Date, PLUS the value of the first not null in the column of company for a combination given to the three first columns. Here is my SQL that does not quite do the trick:
Select distinct c.class_id, c.course_id, c.start_date, p.company
class c, person p, student s
where substr (c.course_id, 1, 3) = "OBI".
and c.start_date > = SYSDATE-30
and c.class_id = s.class_id
and s.pid = p.pid
order start_date, company, class_id, course_id
At present, if in a given class, a student entered "CCCC" under the name of the company and another entry "Collin Co Comm Coll" and another between "Collin College", I would get three rows of this class when you use the SQL above. I want just one line. I don't really like which company names gets selected - one of them will be great for our needs. I just need to see a line for each class_id and single value that some students entered the area of the company. And I guess I have to say that if no student fills in the name of the company I need to see the value null, because I need to see the line no matter what.
Looks like some sort of funky outer join or a coalesce, but it is beyond my ability to understand.
Now I get this:
During class 1234 SQL271 Date 22/07/2013 company XYZ Inc.
Made up of class 1234 SQL271 Date 22/07/2013 company XYZ
1234 SQL271 Date 22/07/2013 company XYZ, class
What I want:
Class 1234 SQL271 22/07/2013 Date course XYZ Inc. or one of the other 2
Thanks in advance!
select c.class_id, c.course_id, c.start_date, max(p.company) company
from class c, person p, student s
where substr(c.course_id,1,3) = 'OBI'
and c.start_date >= SYSDATE-30
and c.class_id = s.class_id
and s.pid = p.pid
group by c.class_id, c.course_id, c.start_date
order by class_id, start_date, course_id
Or if you want to list all businesses, you can use LISTAGG if you're on the latest version of ORACLE
Non-Null Validation step does not work with the hidden field?
HelloI have a field that is a selection list.
I have another field, which is also a selection list, but which is masked by the dynamic loading of the page Action (if the value of the first field is 'False').
If the value of the 1st select list is 'True', the 2nd selection list appears and the user must select a value.
I have created a "Item Not Null" Validation, because I need to force the users to select the value in the 2nd, select list.
However, the Validation does not work! I guess it's because the 2nd selection list is hidden / display by dynamic action!
The 2nd selection list is null to display the value 'NULL '.
How can I solve it please?
It has nothing to do with the dynamic Action.
Try to delete "NULL" in the value of the Null display field. Just leave it blank.
In this case, "specified element is NOT NULL" must be selected in the Validation.
update of NULL in the column with the values of the adjacent column
Examples of data
with test_data as (select 1 as one, null as two, 2 as three,5 as four, 6 as five, null as six from dual union all select 1 as one, null as two, 2 as three,5 as four, 6 as five, null as six from dual) select * from test_data;
This is one of those cases, the case may be where any value of a column can be null
or two similar columns can be null. If the column is null then I want to update the adjacent column
average value of the column, if the first column is null so I want to take the next non-null column and update, if the last column is null
so I want to take prev not zero column and to update.
In this case would be my expected output
Un | Two | Three | Four | Five | Six |
---|---|---|---|---|---|
1 | 1.5 | 2 | 5 | 6 | 6 |
1 | 2 | 3 | 5 | 6 | 6 |
Prospects for the future the suggesion or advice.
Or, using Analytics:
SQL> with test_data (id, one, two, three, four, five, six) as ( 2 select 1, 1 , null, 2 , 5, 6, null from dual union all 3 select 2, 1 , null, 3 , 5, 6, null from dual union all 4 select 3, 1 , null, null, 5, 6, null from dual union all 5 select 4, null, null, null, 5, 6, null from dual 6 ) 7 select * 8 from ( 9 select id 10 , cell 11 , case when next_nn is not null and prev_nn is not null 12 then (next_nn + prev_nn)/2 13 else nvl(next_nn, prev_nn) 14 end val 15 from ( 16 select id 17 , cell 18 , val 19 , last_value(val) ignore nulls over(partition by id order by cell) as prev_nn 20 , first_value(val) ignore nulls over(partition by id order by cell range between current row and unbounded following) as next_nn 21 from test_data 22 unpivot include nulls (val for cell in (one as 1, two as 2, three as 3, four as 4, five as 5, six as 6) ) 23 ) 24 ) 25 pivot ( min(val) for cell in (1 as "ONE", 2 as "TWO", 3 as "THREE", 4 as "FOUR", 5 as "FIVE", 6 as "SIX") ) 26 ; ID ONE TWO THREE FOUR FIVE SIX ---------- ---------- ---------- ---------- ---------- ---------- ---------- 1 1 1,5 2 5 6 6 2 1 2 3 5 6 6 3 1 3 3 5 6 6 4 5 5 5 5 6 6
Error #2007: HitTestObject parameter must be non-null
at flash.display::DisplayObject/_hitTest()
at flash.display::DisplayObject/hitTestObject()
but my hitTestObject works well in the frame 4 displays error when I goto another frame without hitting the object
If I touched the subject, then I goto frame 1 this error does not appear. This means that the code made mandatory hit error otherwise. How to get rid of this
var live: myscrew = new myscrew();
addEventListener (Event.ENTER_FRAME, checkCollision);
function checkCollision(event:Event) {}
star test against crescent
If (keys.hitTestObject (chest)) {}
Screw.x = 100;
Screw.y = 100;
addChild (screw);
removeChild (chest);
}
}
This code used to goto frame 1.
arrowtwo.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler_two222);
function fl_MouseClickHandler_two222(event:MouseEvent):void
{
gotoAndStop (1);
}
Remove the event listener before you change settings.
removeEventListener (Event.ENTER_FRAME, checkCollision);
Assistance with the creation of the VM for the automation of laboratory and criticism
Being a novice at scripting powershellCLI from scratch, I managed to put together a script to automate the creation of virtual machines for my ESXi5.1 training laboratory. Some of my orders have been adapted from Luc - D blog. Many thanks for your great blog.
I have a list of virtual computers that have different OS, memory, CPU, disk, NetworkPort, ISOPath, FloppyDrive etc.
Here's the routine I created to go after using the help of VMware PowerCLI and the reference and examples of the VMware community. I would like to help to be able to optimize the code to speed up the processing, because it does not have enough in the process, I tried to use the | Out-Null but it does not seem to turn off the output. I also wanted to know how read a CSV file parameters and phase of each virtual machine created by feeding one after the other time it has been fully configured, as remotely via VMTools looking for the existence of a file or setting on a virtual machine before the next VM is created in order--something like a configuration of vAPP. I tried the CSV file, but only managed to partially run my script is included below:
Finally, when it's time to clean up a script to check if the virtual machine is turned on then turn off and delete the inventory and drive of the virtual computer. (I think I could manage removing relatively easily). Hope my request is not a big ask.
Thanks in advance.
# Connect to vSphere Host with root
$date = get-Date
$ESXhost = Read-Host "enter the host ESX or IP name.
$username = Read-Host "Username".
$password = Read-Host "Password."
SE connect-VIServer-Server $ESXhost - User $username - Password $password
# Create DC
$VMname = "Lab_DC".
New-VM - VMHost $ESXhost - CD - name $VMname - MemoryMB 512 - NumCPU 1 - Version v9 - ID windows7Server64Guest-Floppy - Datastore LUN1-DiskGB 15 - DiskStorageFormat thin - Notes '$VMname AutoDeployed on $date.
Get - VM $VMname | Get-CDDrive. Game-CDDrive - ISOPath "[Host3] VM/Lab_Local\WIN2K8R2SP1_CUST.» "ISO" - StartConnected $true - confirm: $false
$DelayValue = "5000".
$vm = get - VM $VMname | Get-View
$vmConfigSpec = new-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec.BootOptions = new-Object VMware.Vim.VirtualMachineBootOptions
$vmConfigSpec.BootOptions.BootDelay = $DelayValue
$vmConfigSpec.flags = new-Object VMware.Vim.VirtualMachineFlagInfo
$vmConfigSpec.flags.enableLogging = $false
$vm. ReconfigVM_Task ($vmConfigSpec)
Get - VM $VMname | Get-NetworkAdapter | Together-NetworkAdapter - NetworkName "Lab_Local" - confirm: $False
FloppyDrive get - VM $VMname | Game-FloppyDrive - FloppyImagePath "Automate/BootFloppies/LAB-DC.flp [build]" - StartConnected $true - confirm: $false
Most of the time the foregoing successfully created the virtual machine, but I have about 20 MV that I need to build/remove and the only way I can do it is by adding the individual game published for each virtual computer orders - it isn't nice to handle, so I tried to add a loop foreach to read the name of the virtual machine and the settings for each computer virtual to a CSV file.
The CSV file is formatted as follows:
VMName MemoryMB NumCpu Version, ID, Datastore, DiskGB, ISOPath, NetworkName, FloppyPath
Lab_DC, 512, 1, v9, windows7Server64Guest, Lun1, 15, [Host3] VM/Lab_Local\WIN2K8R2SP1_CUST. ISO, Lab_Local, Automate/BootFloppies/LAN-DC.flp [build]
Lab_VC, 2048, 1, v9, windows7Server64Guest, Lun2, 20, [Host3] VM/Lab_Local\WIN2K8R2SP1_CUST. ISO, Lab_Local, Automate/BootFloppies/LAN-VC.flp [build]
I tried to add this to "test" as below, but it seems to work partially. It fails to set the path of the ISO, disk path and the Network Port correctly - could not understand how to properly use the BootOptions so I left it.
$VMs = import-CSV - UseCulture b:\automate\servers.csv
New-VM - VMhost Host3 - CD-name $VM. VMName - MemoryMB $VM. MemoryMB - NumCPU $VM. NumCPU-Version $VM. Version - ID $VM. ID-floppy - Datastore $VM. Store data-DiskGB $VM. DiskGB - DiskStorageFormat 'thin' - Notes '$name Auto deployed on $date.
Get - VM $VM | Get-CDDrive. Game-CDDrive - ISOPath $VM. ISOPath - StartConnected $true - confirm: $false
Get - VM $VM | Get-NetworkAdapter | Together-NetworkAdapter NetworkName - $VM.NetworkName - confirm: $False
FloppyDrive get - VM | Game-FloppyDrive - FloppyImagePath $VM. FloppyPath - StartConnected $true - confirm: $false
This is the result I get from the routine above.
Name | Use of the port |
---- | ---- ---- |
Host3 | root of 443 |
WARNING: The 'Description' of type VirtualMachine property is deprecated. Use the property "Note".
WARNING: The 'Hard drives' property type VirtualMachine is discouraged. The "Get-hard drive" cmdlet instead.
WARNING: The 'NetworkAdapters"type VirtualMachine property is deprecated. The cmdlet "Get-NetworkAdapter" instead.
WARNING: The 'UsbDevices' of type VritualMachine property is obsolete. Use the "Get-UsbDevice" cmdlet instead.
WARNING: The 'CDDrives' of type VitrualMachine property is obsolete. Use the "Get-CDDrive" cmdlet instead.
WARNING: The 'FloppyDrives"type VirtualMachine property is deprecated. Use the "Get-FloppyDrive" cmdlet instead.
WARNING: The 'Host' of type VirtualMachine property is deprecated. Use the property "$vmhost".
WARNING: The "HostId" type VirtualMachine property is deprecated. Use the property "VMHostId".
Get-FloppyDrive: it lacks an argument for the parameter "VM". Specify a parameter of type ' VMware.VimAutomation.ViCore.Type
s.V1. [Inventory.VirtualMachine] ' and try again.
To b:\Automate\Various Scripts\CreateVM.ps1:48 tank: 20
+ Get-FloppyDrive - VM < < < < | Game-FloppyDrive - FloppyImagePath $VM. FloppyPath - StartConnected $true - confirm: $false
+ CategoryInfo | : InvalidArgument: (:)) [Get-FloppyDrive], ParameterBindingException) | |
+ FullyQualifiedErrorId: MissingArgument, VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.GetFloppyDriv |
e
Ah, my mistake, I don't check your code.
Inside the loop, the script must use the variable $_ instead of the variable $VM to the New - VM.
The variable $_ will have extracted the CSV file line.
I've updated the code above. Give him another chance.
Error #2007: Text parameter must be non-null.
I'm currently testing a ranking of best scores, everything seems to work but I seem to be getting an error
TypeError: Error #2007: text parameter must be non-null.
to flash. text::TextField / set text()
at prac2_fla::MainTimeline/pulse() [prac2_fla. MainTimeline::frame1:87]
Here is the pastebin .fla
The error is on line 87 as shown,
I played but just can't understand it, it is the last film in my game.
All you have 87 online tries to target something that does not exist. It is the 87 line as you now with some tracks that you added.
Optimize the creation of large INDB exported as an interactive PDF
I'm running into some problems of speed when creating an InDesign book that is exported as an interactive PDF. This process is be script using JSX and running on a server of InDesign CC. I tried various combinations of settings for interactivePDFExportPreferences, and which none does not seem to make a difference. I don't think that it takes as long InDesign to create the book itself, most of the time is spent by exporting it as an interactive PDF.
Some background information, a PDF page 'unique' for each page of the publication has already been created. Most pages also took - what I call a superposition of hyperlink - another created INDD file containing rectangles with hyperlinks. Each 'page PDF' is then imported into a new INDD and if there is a corresponding "hyperlink overlay" then it is duplicated on the top of the "single page PDF", then the result is recorded as a new INDD. The result is then an INDD for each page in the publication that will be used in the creation of the InDesign book.
Now that we have an InDesign doc for each page we create an INDB script and that will be exported as an interactive PDF. Here comes my question. Someone has suggestions to optimize the creation of a book of InDesing that is exported as an interactive PDF? The PDF file takes a little over half an hour to create just for a 80 page publication. Some of our publications are 300 + pages, so the time it takes to create this size of a book and export to PDF is unacceptable.
I would also like to note that the interactive PDF file that has been exported from InDesign book will be used with 3D issue online. Added hyperlinks - hence the need for the interactive PDF - link ads/announcements in our publication on the 3D issue to the respective pieces of the inventory on our Web sites.
Another solution, I'm currently entertaining is thread creation of the InDesign book and splitting it up which would result in several small interactive PDF which then I would write something to combine them into a single PDF file.
with ( app.interactivePDFExportPreferences ) { exportLayers = false; exportReaderSpreads = false; flipPages = false; generateThumbnails = false; includeStructure = false; interactivePDFInteractiveElementsOption = InteractivePDFInteractiveElementsOptions.INCLUDE_ALL_MEDIA; //APPEARANCE_ONLY pageRange = PageRange.ALL_PAGES; pageTransitionOverride = PageTransitionOverrideOptions.NONE; //FROM_DOCUMENT; pdfJPEGQuality = PDFJPEGQualityOptions.HIGH; pdfMagnification = PdfMagnificationOptions.DEFAULT_VALUE; pdfPageLayout = PageLayoutOptions.SINGLE_PAGE_CONTINUOUS; //SINGLE_PAGE; //DEFAULT_VALUE; pdfRasterCompression = PDFRasterCompressionOptions.JPEG_COMPRESSION; //AUTOMATIC_COMPRESSION (same time using auto, but resulting file is 2x the size) rasterResolution = 192; // No time diff between 144 or 192 DPI but there was a noticeable quality diff }
Post edited by: Wayne Ritchie fixed the formatting of my snip of code.
Thanks for the reply. I agree, the script itself is not the issue. I was hoping that someone out there knew a small export/parameter preferably that would help me. I know that the quality of some graphics or even PDF files would reduce the time it takes. Reduce the quality of the graphics and the PDF output have been attempted. However, 3D issue allows Zoom and when the output quality was reduced and a user zooms in it looks pretty bad. Also, it doesn't give me enough compromise time/quality to justify reducing the quality.
However, I have found another solution. PDFsharp is a great open source solution. Instead of creating all INDDs using InDesign, create an INDB and export to a PDF file. I can now create PDF files in the first place and use .NET and the PDFsharp library to combine all of the PDF files in a single PDF file. This is a lot faster and without any sacrifice of quality! I wish I would have looked into this type of solution before you spend hours trying to find a way to optimize the creation of the INDB.
History of backfilling with non-null values
Hi gurus,in Oracle 11 g, which would be the best way to update a null with the next available non-null value?
For example: in the code below, I need to update the null in 20130201 record (key = 1) (key date) with a value of 100 available at the next available date IE 20130203.
Same key = 3 value will be updated with key = 4 value i.e. 200.
1,ABCD, 20130201, NULL
2,ABCD,20130203, 100
3,ABCD, 20130205, NULL
4, ABCD,20130207, 200
Thank youS
with t as (
select tbl.*,
last_value(nvl2(c4,c1,null) ignore nulls) over(order by c1) prev_c1,
last_value(c4 ignore nulls) over(order by c1) prev_c4,
first_value(nvl2(c4,c1,null) ignore nulls) over(order by c1 rows between current row and unbounded following) next_c1,
first_value(c4 ignore nulls) over(order by c1 rows between current row and unbounded following) next_c4
from tbl
)
select c1,
c2,
c3,
c4,
case
when c4 is not null then c4
when c1 - prev_c1 < next_c1 - c1 then prev_c4
else next_c4
end new_c4
from t
/
C1 C2 C3 C4 NEW_C4
---------- ---- ---------- ---------- ----------
1 ABCD 20130201 100
2 ABCD 20130203 100 100
3 ABCD 20130205 200
4 ABCD 20130207 200 200
SQL>
SY.
Maybe you are looking for
-
PX4 - 300 d no info on the LCD displays
I bought a storage NAS PX4 - 300 d on Ebay. It seems that he not serve unitl now. The device running and works well, the only problem is that the LCD appear only the iomega logo at the beginning but no info after this (white screen). When I reset the
-
HP Envy 17 J11tx: Capricious USB Ports
My USB ports have ALL (4/4) disconnect started all peripheral USB is inserted. Iintially recognizes them, but after a few moments, it disconnects them (I get the tone on my laptop) and the device disappears, only to be reconnected a few seconds later
-
I have acquired my Office 2010 through a program of purchase - paid, downloaded, installed (3 licenses)... All licenses have been used. When I update will I be able to carry on this setting? I don't want to buy Office again just because I upgraded m
-
(Redirected) Print color/non-black on series 5200N
Win7, series B & W printer, IE11, Gmail and AOL 5200N, Vista Driver (I think). I tried 10 or more different solutions suggested to obtaining by series 5200N convert all colors / non-black (gray, cyan re.g.) in pure black and white for printing readab
-
How to connect a Lenovo Ideapad S10 - 3 t a Emerson HDTV?
I have a Lenovo Ideapad S10 - 3T and an HDTV of Emerson. I want to be able to see things on my laptop on a large widescreen as my TV. I already know that my laptop has a VGA port. My TV does not work. My TV has a HDMI port. My laptop does not work. I