Thread: Re: Problem with plpython editing
> Dear Luigi Lumento.
>
> ----- Original Message -----
>
> > I'm writing to submit a problem on using pgadmin2 to
> > write plpython functions. It didn' happen with pltcl.
> > When i write a function that is longer than one line of code,
> > the server accepts its definition but isn't able to execute it due to
> > a sintax error at the second line. I suppose it is because of
> > linefeed/carriage return characters at the end of each line.
> >
> > Hope the problem can be resolved.
>
> It is strange.
>
> Will you try this?
> Try to add this before the SQL practice of about the 32nd line.
> ----------------------------------------------------------------
> frmSQLInput.frm
> ....
> ' change CRLF -> LF
> szSQL = Replace(szSQL, vbCrLf, vbLf)
>
> Set rsQuery = frmMain.svr.Databases(szDatabase).Execute(szSQL, , , qryUser)
> ----------------------------------------------------------------
> Frank Lupo will apply it if this seems to be normal.
>
> Regards,
> Hiroshi-Saito
>
Ok, fix error new binary in
----
Email.it, the professional e-mail, gratis per te: clicca qui
Sponsor:
Le nuove iniziative del Garden Center Peraga: i Tour Day Peraga per andare alla scoperta del Canavese e il Labirinto delle Pannocchie per perdersi in unoasi di pace, a contatto con la natura.
Clicca qui
Hi Luigi Lumento. From: Luigi Lumento > Thanks to Frank Lupo and Hiroshi Saito for modifying frmSQLInput.frm. > Now it works good with writing plpython functions. It was good.! > However the problem still remains with frmFunction.frm. For this form to > work with plpython we need to do the same work. I did try and works. > > This is the code. (Hope it doesn't break something else). > > frmFunction.frm > > Private Sub cmdOK_Click() > ..... (snip) It seems to be good. I applied it, too, and confirmed that there was no problem.! It can apply it by Frank Lupo. While it is probably near. Regards, Hiroshi-Saito
Thanks to Frank Lupo and Hiroshi Saito for modifying frmSQLInput.frm. Now it works good with writing plpython functions.
However the problem still remains with frmFunction.frm. For this form to work with plpython we need to do the same work. I did try and works.
This is the code. (Hope it doesn't break something else).
frmFunction.frm
Private Sub cmdOK_Click()
.....
If bNew Then
StartMsg "Creating Function..."
Set objNewFunction = frmMain.svr.Databases(szDatabase).Namespaces(szNamespace).Functions.Add(txtProperties(0).Text, szArguments, cboProperties(1).Text, Replace(hbxProperties(1).Text, vbCrLf, vbLf), cboProperties(0).Text, Bin2Bool(chkProperties(0).Value), Bin2Bool(chkProperties(1).Value), hbxProperties(0).Text, cboProperties(3).Text, Bin2Bool(chkProperties(3).Value), Bin2Bool(chkProperties(2).Value))
'Add a new node and update the text on the parent
On Error Resume Next
Set objNode = frmMain.svr.Databases(szDatabase).Namespaces(szNamespace).Functions.Tag
Set objNewFunction.Tag = frmMain.tv.Nodes.Add(objNode.Key, tvwChild, "FNC-" & GetID, txtProperties(0).Text & "(" & szArguments & ")", "function")
objNode.Text = "Functions (" & objNode.Children & ")"
If inIDE Then: On Error GoTo 0: Else: On Error GoTo Err_Handler
Else
StartMsg "Updating Function..."
If hbxProperties(0).Tag = "Y" Then objFunction.Comment = hbxProperties(0).Text
' luigi
If hbxProperties(1).Tag = "Y" Then objFunction.Source = Replace(hbxProperties(1).Text, vbCrLf, vbLf)
End If
However the problem still remains with frmFunction.frm. For this form to work with plpython we need to do the same work. I did try and works.
This is the code. (Hope it doesn't break something else).
frmFunction.frm
Private Sub cmdOK_Click()
.....
If bNew Then
StartMsg "Creating Function..."
Set objNewFunction = frmMain.svr.Databases(szDatabase).Namespaces(szNamespace).Functions.Add(txtProperties(0).Text, szArguments, cboProperties(1).Text, Replace(hbxProperties(1).Text, vbCrLf, vbLf), cboProperties(0).Text, Bin2Bool(chkProperties(0).Value), Bin2Bool(chkProperties(1).Value), hbxProperties(0).Text, cboProperties(3).Text, Bin2Bool(chkProperties(3).Value), Bin2Bool(chkProperties(2).Value))
'Add a new node and update the text on the parent
On Error Resume Next
Set objNode = frmMain.svr.Databases(szDatabase).Namespaces(szNamespace).Functions.Tag
Set objNewFunction.Tag = frmMain.tv.Nodes.Add(objNode.Key, tvwChild, "FNC-" & GetID, txtProperties(0).Text & "(" & szArguments & ")", "function")
objNode.Text = "Functions (" & objNode.Children & ")"
If inIDE Then: On Error GoTo 0: Else: On Error GoTo Err_Handler
Else
StartMsg "Updating Function..."
If hbxProperties(0).Tag = "Y" Then objFunction.Comment = hbxProperties(0).Text
' luigi
If hbxProperties(1).Tag = "Y" Then objFunction.Source = Replace(hbxProperties(1).Text, vbCrLf, vbLf)
End If
Regards
Luigi Lumento