0

how to translate this code?

Select * from view.view where ageYear = "combobox.value"

I know the code in sql but i cant do it in lotus script,

LyodMichael
  • 85
  • 2
  • 13
  • There's nothing wrong with posting a follow-up after having already gotten an answer to another question; but it would be a lot better for everyone if you included a link from this question back to the original. People need to understand the context of your problem. – Richard Schwartz Nov 22 '12 at 05:26

2 Answers2

0

@DBlookup is your friend. I haven't written Formula in a long, long time--all my major code for Domino is in Java now, but something like

 @dblookup("Notes": "NoCache"; "" : "ViewName"; "combobox.value"; columnnumber)

You cannot look up multiple columns with one @dblookup the way you can select them in SQL. You will need multiple @dblookups.

Also, this assumes you have a view sorted by the indexed value, in your case ageYear.

If you really need multiple columns, perhaps you should be using LotusScript or Java, or reanalyzing what you are trying to do. Context would help.

SAJ14SAJ
  • 1,698
  • 1
  • 13
  • 32
0

Lotus Notes is not a relational database. It is a programmable user interface and document-oriented storage system all integrated into one package. You need to learn the elements of Notes programming. You can't just think of a SQL query and "translate" it.

In the context of your previous question, you can use a form and an embedded view to do what you want. You don't need LotusScript. Ken's answer to that question has already pointed you in the right direction. My answer provides another perspective.

But there are many other ways to do what you want; and there are many other circumstances in which you might want to select documents from a view.

Community
  • 1
  • 1
Richard Schwartz
  • 14,463
  • 2
  • 23
  • 41
  • 1
    I have to agree--Notes is not relational. Most of the so-called "NoSQL" movement of databases are essentially clones of the Notes backend :-) I admit, the answer I gave above was specific to the question as phrased, and not about what the best approach is. The comment about "or reanalyzing what you are trying to do" hints at that. I have been doing Domino since 3.0 was in Beta--I wrote the first developer certification tests--but I still don't know everything about it. – SAJ14SAJ Nov 23 '12 at 00:46