PostsreSQL / SQL newbie question

Bob Fiering bob at maxolution.nl
Sat Apr 13 11:22:00 EDT 2013


Hi Andy,

Both my code and the code that Omnis is generating when creating a Window (display grid based on schema or query class) isn't working.

So even the by Omnis generated code of:

Do iSqlList.$definefromsqlclass('Sc_Contracts')
Do iSqlList.$sessionobject.$assign($root.$sessions.POSTGRES_OBIS.$sessionobject) Returns #F
Do iSqlList.$select()
Do iSqlList.$fetch(kFetchAll)

is not working.

My own code 

Do tvStatementObj.$prepare('SELECT * FROM F_Contracten') Returns #F (also tried to Sc_Contracts)
Do tvStatementObj.$execute() Returns #F
Do tvStatementObj.$fetch(iList_Contracts,999,kTrue) Returns lFetchStatus

I have tried many different ways. Strange thing is when I make a connection with Omnissql to my datafile and select the data from the table everything is fine.
When connection to PostgreSQL the same strategy is not working.




regards,

Bob

Op 13 apr. 2013, om 16:28 heeft Andy Hilton <andyh at totallybrilliant.com> het volgende geschreven:

Bob

Can you post what the code actually is doing ? It's hard to suggest anything without knowing what it is attempting to actually do first off !!

You say 'when you went to fetch data' but you don't explain :

Is your list a proper sql defined list ?
Is your select statement working ok ?
What kind of $fetch are you performing ?
Are you running your own table class ?

Andy

On Apr 13, 2013, at 10:20 AM, Bob Fiering <bob at maxolution.nl> wrote:

> Hi,
> 
> Yes, I am one of those guys who are still working with DML in Omnis, and yes i know it is time to change because of a lot of reasons.
> 
> So i dusted some old SQL knowledge and with some time to invest in this process i made a fresh start.
> Ofcourse i am having problems, but sooner as i expected, and on a different level.
> 
> I installed on my Mac PostgreSQL, created a database, connected with Omnis SQL to my data.df1 file and created a session with the new PostgreSQL database.
> I dragged the datafile tables to the SQL database and it created all tables. After this i checked if the old sequence fields were integer4 in PostgreSQL and had sequences connected to it, checked the indexes, primary keys and privileges.
> I made a new library, created schema and table classes from the database, made a login screen and connection objects and was able to login with Omnis 5.2.3 into the new database (PostgreSQL 9.2).
> SessionObject and StatementObject are are looking good.
> Everything fine until this moment.
> 
> When I want to fetch data no data is fetched. So i made a testwindow with the Omnis wizzard to see if my coding was bad. But this isn't fetching data either.
> Looking in the SQL browser and opening the tables, it shows the data. In pgAdmin i made a new table and added data but the same problem in Omnis.
> 
> I hope someone can tell me what i am doing wrong here or which step I forgot.
> 
> 
> regards,
> 
> Bob_____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com

_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com




More information about the omnisdev-en mailing list