Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I've been able to connect to a Vertica database, and also been able to run a SELECT query. But I'm not being able to run a query with a backslash in it. (Vertica has commands like postgresql.) The command I'm trying to run is \d;. I've tried variations like below with a varying number of backslashes without success:

SQLExecute[conn, "\\\d;"]

What am I doing wrong? Any help would be greatly appreciated!

Edit: I should add that the error I'm getting is this: JDBC::error: [Vertica][VJDBC](4856) ERROR: Syntax error at or near "\" >>

share|improve this question
2  
Three backslashes cannot be correct. Mathematica requires that each one be escaped, once, as \\. If Vertica requires an additional escape, you will have to enter four backslashes for each one you want to appear in the query. Beyond that, I have no suggestions, since I've never used this software--sorry. –  Oleksandr R. Mar 27 '13 at 8:49
    
@OleksandrR. What is the Vertica connection string? It's native into Mathematica? –  Murta Oct 22 at 18:26

1 Answer 1

This is more a workaround than an answer. Schema information for all tables is also available in a table. In the case of vertica, a query like the following would get all schemas:

columns={"table_schema","table_name","column_name","data_type","data_type_length","is_nullable","column_default"};
SQLExecute[conn,"SELECT "<>StringJoin[Riffle[columns, ", "]]<>" FROM v_catalog.columns"];
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.