On 05/02/2013 08:29 AM, John Fabiani wrote:
On 05/01/2013 04:43 PM, Paul McNett wrote:
On 5/1/13 4:16 PM, John Fabiani wrote:
Hi,
In the past I was able to use a temp table doing the following:

csql = 'a long create temp table statement with the name tempstudent'

biz = dabo.biz.dBizobj(connection)
biz.execute(csql)
biz.DataSource = 'temptstudent'  #the temp table name
biz.KeyField = "pkid"
biz.new()

What is the correct to use a temp table (a temp table must be used within the same
session)?
This looks right. But you have:
    biz.DataSource = 'temptstudent'

and then:

File "/home/johnf/dabo/dabo/db/dCursorMixin.py", line 389, in execute
     raise dException.DBQueryException(errMsg)
dabo.dException.DBQueryException: relation "tempstudent" does not exist
LINE 2:   from tempstudent
So it looks to me like you jumped to the conclusion your typo was Dabo's fault. ;)

Paul
I know it's not a typo. On a hunch I decided to check other postgres installs.
My setup is new -
I have setup hot_standby replication on a postgres 9.1.9 (uses two computers) and that is where I'm seeing the problem of access.
On a single setup postgres 9.1.4 I do not see the problem.

No changes to the code - so I doubt this directly something to do with Dabo. But I have to find it.

Thanks,
Johnf


Man is this getting weird! I removed "biz.new()" from the code and all works! I still needed the blank record so I created one with an insert. I'm not sure why I used 'biz'. What was wrong with 'self.biz'???? There must have been a reason but I don't see it now.


biz = self.biz = dabo.biz.dBizobj(conn)
        biz.execute(create_StudenttableStr)
        #insert blank record into the student
        insert_str = """ insert into tempstudent (pkid) values (1) """
        biz.execute(insert_str)
        biz.execute('commit')
        biz.DataSource = 'tempstudent'
        biz.KeyField = "pkid"
        #biz.VirtualFields =
biz.DefaultValues={"referral":None,'enrolled':None,'born':None,'ret_to_court':None,'mustenrollby':None,'incident_date':None, 'gender':'Male','state_1':'na','victim_state_1':'CA','dvrslicst': 'CA' }

        #biz.new()
        self.recordstate = None

        return self.biz

Johnf


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to