Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy command Not working in DevCenter

I have DevCenter 1.2.1.Some CQL commands working well but COPY command is not working.It shows error message "You made a type...sorry typo".Any hint???

like image 516
user3778192 Avatar asked Apr 23 '26 18:04

user3778192


2 Answers

The copy command, as well as some other commands are unique to cqlsh only and not part of the CQL spec proper, so they cannot be used in DevCenter.

Source: https://groups.google.com/a/lists.datastax.com/forum/#!topic/java-driver-user/JQXF99YAB_E (what applies to drivers also applies to DevCenter)

like image 127
Andy Tolbert Avatar answered Apr 27 '26 08:04

Andy Tolbert


While DevCenter does not support cqlsh specific commands such as COPY, it does allow you to copy results of a query from the Results view in either a CSV or INSERT statement format.

For CSV, execute your query and select the rows you want to copy in the Results view, then right-click and select "COPY as CSV". You can also select "COPY All as CSV" as a shortcut if you want all rows from the result set. This will copy all the result data to the clipboard and the format of this data should be compatible with cqlsh COPY. You can paste this data into a file to get a result similar to COPY TO in cqlsh.

You cannot directly achieve the same thing as cqlsh COPY FROM in DevCenter, however the "Copy [All] as INSERT" option provides the ability to generate INSERT statements from a given query result set to the clipboard which can then be pasted back into the editor and executed again. For small data sets, this method can be a convenient to create a script to load data for testing or backup.

like image 30
djatnieks Avatar answered Apr 27 '26 07:04

djatnieks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!