| View previous topic :: View next topic |
| Author |
Message |
Cenda Power User


Joined: 18 Feb 2011 Posts: 92 Location: Czech Republic
|
Posted: Wed Mar 09, 2011 5:32 am Post subject: [Solved] SQL parameter syntax |
|
|
How is the syntax of parameter in OO SQL . I am used to Oracle SQL but its syntax doesn’t work in OO . I’ve tried a lot of variations but am not able to find the right one .
My code which doesn’t work is :
| Code: |
SELECT "BOZP_REAL" AS "DATE", 'BOZP_REAL', 'BOZP', "JMENO_PRACOVNIKA"
FROM "Renka_new"
WHERE "JMENO_PRACOVNIKA" = :name
|
Please help me to show user parameter in form to populate .
Any advice appreciated .
Cenda
Last edited by Cenda on Wed Mar 09, 2011 9:15 am; edited 1 time in total |
|
| Back to top |
|
 |
RPG Super User

Joined: 24 Apr 2008 Posts: 2696 Location: Apeldoorn, Netherland
|
Posted: Wed Mar 09, 2011 5:47 am Post subject: |
|
|
Hello
I think you can use the query only when it is not in native mode.
Romke |
|
| Back to top |
|
 |
Cenda Power User


Joined: 18 Feb 2011 Posts: 92 Location: Czech Republic
|
Posted: Wed Mar 09, 2011 5:54 am Post subject: Native mode |
|
|
| Sorry, what does mean „native mode“ ? |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Wed Mar 09, 2011 6:15 am Post subject: |
|
|
| Quote: | | Sorry, what does mean „native mode“ ? |
Sorry, what means "doesn't work"? _________________ Rest in peace, oooforum.org
Get help on http://forum.openoffice.org |
|
| Back to top |
|
 |
Cenda Power User


Joined: 18 Feb 2011 Posts: 92 Location: Czech Republic
|
Posted: Wed Mar 09, 2011 6:21 am Post subject: It doesnt retrieve any row |
|
|
| Doesn’t work mean that the select doesn’t retrieve any row . |
|
| Back to top |
|
 |
Cenda Power User


Joined: 18 Feb 2011 Posts: 92 Location: Czech Republic
|
Posted: Wed Mar 09, 2011 6:23 am Post subject: |
|
|
| And it doesn’t ask for parameter to be populated |
|
| Back to top |
|
 |
RPG Super User

Joined: 24 Apr 2008 Posts: 2696 Location: Apeldoorn, Netherland
|
Posted: Wed Mar 09, 2011 6:29 am Post subject: |
|
|
Hello
You have notice that there are two modes for SQL.
One is Native or direct mode. The other is this not.
| Help file wrote: | SQL Mode
SQL stands for "Structured Query Language" and describes instructions for updating and administering relational databases.
In LibreOffice you do not need any knowledge of SQL for most queries, since you do not have to enter the SQL code. If you create a query in the query design, LibreOffice automatically converts your instructions into the corresponding SQL syntax. If, with the help of the Switch Design View On/Off button, you change to the SQL view, you can see the SQL commands for a query that has been created previously.
You can formulate your query directly in the SQL code. Note, however, that the special syntax is dependent upon the database system that you use.
If you enter the SQL code manually, you can create SQL-specific queries that are not supported by the graphical interface in Query design. These queries must be executed in native SQL mode.
|
| Quote: | | By clicking the Run SQL command directly icon in the SQL view, you can formulate a query that is not processed by LibreOffice. |
In OOo mode
a) You can use named parameters in queries.
in Native mode
a) You can use special commands of the database engine.
b) You cannot used named parameters |
|
| Back to top |
|
 |
Cenda Power User


Joined: 18 Feb 2011 Posts: 92 Location: Czech Republic
|
Posted: Wed Mar 09, 2011 6:43 am Post subject: |
|
|
| I think it is ran in OO mode cause I launch it by double click on the query name in the query folder . |
|
| Back to top |
|
 |
RPG Super User

Joined: 24 Apr 2008 Posts: 2696 Location: Apeldoorn, Netherland
|
Posted: Wed Mar 09, 2011 6:47 am Post subject: |
|
|
Hello
This is a wrong answers. See to the query
Romke |
|
| Back to top |
|
 |
RPG Super User

Joined: 24 Apr 2008 Posts: 2696 Location: Apeldoorn, Netherland
|
Posted: Wed Mar 09, 2011 7:15 am Post subject: |
|
|
Hello
The only way you can see is how you did made the query. You need double clickking for running the query. Does not matter what kind of query this is.
I use here Normal query against to native query. I think a normal query is a word not normally used in OOo-base
When you see the gui then it is an Normal query.
When you see only text then it can be a Normal query or a native query.
When you can go back to the GUI then it is a Normal query. When you cannot go back to the GUI interface then it is a native query. But be aware some Normal queries can be a native query.
This means a native query is not processed as a Normal query. That not processed as a normal query makes it to a native query. This procesing of the query is a kind of translating of the query from the OOo syntax to the syntax of the current Database engine
When you look to the button then if the SQL button is highlight then it is a native query.
When the button is not highlight then i is a normal query.
I hope this clear to you and also I hope I did not make an error in the explanation.
Romke |
|
| Back to top |
|
 |
Cenda Power User


Joined: 18 Feb 2011 Posts: 92 Location: Czech Republic
|
Posted: Wed Mar 09, 2011 7:55 am Post subject: Partly solved |
|
|
| Thank you very much . Now I figured it out how doest it work . I un highlighted the SQL icon and then it prompted for parameter input . Unfortunately it reorganized the code which is not so simple as the one posted to the forum . |
|
| Back to top |
|
 |
|